Тема: Vibra, Data, Midi
Показать сообщение отдельно
Старый 08.12.2010, 02:11   #14
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: Vibra, Data, Midi

The player_enevt proc is an event handler and is called by the library if any player event, like end of media, occur. It should NOT be renamed or removed, becaus it cause application error.

In the beginning we mus initialize the library, defining necessary count of players (equals to the count of sounds)
init(n); n - players count
after this operation library is initialized, and player, assigned with index "0" is selected.

After that, any standard player function (OpenPlayer, StartPlayer, SetPlayerCount will be applied to it, so, writing
if not OpenPlayer('/message.mid', 'audio/midi') then Halt; we load the file to the player "0". Calling set_listener, we assign event handler (the player_event proc) to this player.

To work with another player(1..n-1) we should call player.select(i), where i is index of the necessary player, after that all functions will be applied to player, indexed as "i" (but event handler continues to work for any player, for which set_listener was called).
(Offline)
 
Ответить с цитированием