GSI_EVENTS(3)

NAME
gsi_events (GSI_EV_*) - sound events sent by gsi_server (part of GSI - general sound interface).

INTRODUCTION
Notation: after an event are denoted the arguments and how many bytes are used for the event and each argument. Note that 16 and 32 bit quantities must be sent MSB first. Note that only the events that are implemented or important but not yet implemented are mentioned here. Others can be found in the header file gsi_events.h.

EVENT SELECTION
GSI_EVMASK_CHANNEL -- start/end of samples
GSI_EVMASK_SONG -- start/end of songs
GSI_EVMASK_CD -- start/end of tracks
GSI_EVMASK_MIDI_INFO -- change of pan, volumes etc
GSI_EVMASK_DEVICE_STATUS -- whether the PCM was grabbed exclusively etc.
GSI_EVMASK_STREAM
GSI_EVMASK_ALL -- selects all events

EVENTS
1. Errors :
GSI_EV_SERVER_KILLED 1
Issued from the interface ..
GSI_EV_BAD_COMMAND <command> 1 1
GSI_EV_NO_SUCH_FILE <slot> 1 1
GSI_EV_NO_SUCH_SONG_FILE 1
GSI_EV_NO_SUCH_LIST_FILE 1
GSI_EV_SLOT_BUSY <slot> 1 1; Sent when a free_sound or load_sound command is given for a slot that is being played.
GSI_EV_NO_INSTRUMENT_SPACE <instrument no> 1 1 GSI_EV_NOT_IMPLEMENTED <command> 1 1
Warn that a command is not known; Useful? GSI_EV_OUT_OF_MEMORY 1; Out of memory in some part of the server. GSI_EV_OUT_OF_MEMORY_LOADING_SLOT <slot> 1 1; GSI_EV_BAD_SLOT <slot> 1 1; Undeclared slot.
GSI_EV_PCM_BUSY 1; PCM unavailable to GSI.
GSI_EV_SYNTH_BUSY 1; SYNTH unavailable to GSI or client.
GSI_EV_CD_BUSY <cd> 1 1; CD grabbed by other client
GSI_EV_CD_NO_DISK <cd> 1 1
GSI_EV_CD_NO_AUDIO_TRACKS <cd> 1 1
GSI_EV_CD_MOUNTED <cd> 1 1; eject on a mounted CD (or if another program also has a fd open on the CD (possible in Linux)). Rename: GSI_EV_CD_SHARED ?
GSI_EV_CD_NO_CHANGER <cd> 1 1;
GSI_EV_CD_BAD_SLOT <cd> <slot> 1 1 1; CD changer doesn't have given slot.
GSI_EV_CD_EMPTY_SLOT <cd> <slot> 1 1 1; given slot has no CD. GSI_EV_NO_PCM 1
GSI_EV_NO_SYNTH 1
GSI_EV_NO_CD 1
GSI_EV_UNKNOWN_SAMPLE_FILEFORMAT <slot> 1 1;
GSI_EV_UNKNOWN_SONG_FILEFORMAT 1; GSI_EV_NO_ROOM <slot> <discarded> 1 1 4; no room for the last 'discarded' nr. of bytes of the block of data sent. Status events (gsi_set_info_callback):
GSI_EV_PCM_GRABBED 1; only on sending GSI_CMD_STATUS or something? (then an GSI_STATUS_SENT is also needed)
GSI_EV_SYNTH_GRABBED 1; ditto
GSI_EV_CD_GRABBED 1; ditto GSI_EV_SYNTH_RELEASED 1; another client has released the synth.
GSI_EV_CD_RELEASED <cd> 1 1; another client has released the cd. Status part 2 (responses to information requests etc.):
GSI_EV_CD_TRACK_LIST <tracks> <trk-list> 1 1 tracks*4; gives all track data (m,s,f,track_type). Track_type = 0 for DATA, 1 for AUDIO.
GSI_EV_CD_STATUS <cd> <status> 1 1 1; status is one of CD_STATUS_NONE, CD_STATUS_PLAYING, CD_STATUS_PAUSED = 0,1,2 GSI_EV_MIXER_STATUS <mix ch> <val> 1 1 1; returns new mixer settings (possibly changed by another program) GSI_EV_SLOT_INFO <slot> <samplerate> <type> <channels> <size> 1 1 4 1 1 4; GSI_EV_CLIENT_ID <id> 1 4;
GSI_EV_SYNC 1
 => acknowledges a GSI_CMD_SYNC
GSI_EV_SERVER_PROTOCOL_VERSION 1 4; to check for obsolete server/clients. Play status :
GSI_EV_CHANNEL_STARTED <ch> 1 1
 => gives channel number on which a sound was started.
GSI_EV_CHANNEL_END <ch> 1 1
 => gives channel number on which a sound finished playing (or was killed).
GSI_EV_CHANNEL_ENDALL 1
 => all channels were stopped (GSI_CMD_KILL_ALL)
GSI_EV_SONG_STARTED 1
GSI_EV_SONG_END 1 GSI_EV_STREAM_UPDATE <slot> <bytes done> 1 1 4; sent after writing the data in the server's buffer for the next fragment.
GSI_EV_STREAM_UNDERFLOW <slot> <bytes added> 1 1 4; sent after writing the data in the server's buffer for the next fragment. GSI_EV_SEND_INSTRUMENT <GM instrument no> <instrument/synth type> 1 1 1; sent when custom instruments have been loaded by the application, the app has given up the synth, then grabs it again and continues playing the song.

SEE ALSO
gsi(3), gsi_commands(3)

AUTHOR
Wouter Scholten email: whs@xs4all.nl
WWW page: http://www.xs4all.nl/~whs/