snd_seq_event_input

Name

snd_seq_event_input -- return an input event from sequencer

Synopsis

int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev);

Description

Obtains an input event from sequencer. The event is created via snd_seq_create_event, and its pointer is stored on ev argument. Application is requested to release the event if the process is finished using snd_seq_free_event.

This function first recives the event byte-stream data from sequencer as much as possible at once. Then it converts the data to event records and stores them on FIFO. By calling this function succeedingly, events are extract from FIFO.

If there is no input from sequencer, function falls into sleep in blocking mode until an event is received, or returns -EAGAIN error in non-blocking mode. Occasionally, this function may return -ENOSPC error. This means that the input FIFO of sequencer overran, and some events are lost. Once this error is returned, the input FIFO is cleared automatically.

Function returns the number of remaining events on FIFO if an event is successfully received. Application can determine from the returned value whether to call input once more or not.

See Also

snd_seq_event_input_selective, snd_seq_event_input_pending, snd_seq_drain_input, snd_seq_create_event, snd_seq_free_event