XIII. Sequencer event handlers

On ALSA library, events are buffered on both user- and kernel-space in order to reduce the number of system calls. Output events are once decoded to byte-stream and written on the user-space buffer. Once it's filled or flushed manually via snd_seq_flush_output, the events are transferred to sequencer core. Then sequencer puts the received events to scheduled queues, or deliver them directly to their destinations.

The input events, which are delivered from other clients either via queue or direct dispatch, are stored in FIFO of the sequencer on kernel space. Then they are transferred to FIFO of ALSA lib on user-space.

Application can deal with all these operations via the functions described below.

Table of Contents
snd_seq_create_event — create an event record
snd_seq_free_event — free an event record
snd_seq_event_length — calculate the length of event-byte-stream
snd_seq_event_output — output the event to sequencer
snd_seq_flush_output — flush output event buffer
snd_seq_event_output_pending — return the size of unprocessed data on output buffer
snd_seq_extract_output — remove the event on output buffer
snd_seq_drain_output — remove all events on output buffer
snd_seq_drain_output_buffer — remove all events on user-space output buffer
snd_seq_event_input — return an input event from sequencer
snd_seq_event_input_selective — return an input event with the specified type
snd_seq_event_input_pending — return the number of remaining input events
snd_seq_drain_input — remove all events on input FIFO
snd_seq_drain_input_buffer — remove all events on user-space input FIFO
snd_seq_remove_events — remove events on input/output buffers
snd_seq_ev_clear — clear the event record
snd_seq_ev_set_dest — set the given destination address
snd_seq_ev_set_subs — set subscribers as destination
snd_seq_ev_set_broadcast — set broadcast as destination
snd_seq_ev_set_source — set the source port
snd_seq_ev_set_direct — set the direct dispatch mode
snd_seq_ev_schedule_tick — set the scheduling queue and tick time
snd_seq_ev_schedule_real — set the scheduling queue and time
snd_seq_ev_set_priority — set the event priority
snd_seq_ev_set_fixed — set event size as fixed length
snd_seq_ev_set_variable — associate the variable length data