int snd_seq_event_input_selective
(snd_seq_t *hanle, snd_seq_event_t **ev, int type, int blocking);
Extracts an input event with the type specified in type argument. If a matching event is found, the event is extracted and its pointer is stored on ev argument. Application is required to release the event record after the process is finished via snd_seq_free_event.
If no matching event is found on input FIFO of user-space, function checks the events on sequencer FIFO. The behavior depends on blocking argument. If blocking is non-zero, the function never returns until a desired event is received or an error occurs. If blocking is zero, function checks the sequencer FIFO and returns immediately after transferring input data to user-space FIFO.
Function returns the number of remaining events on FIFO (zero of positive) if an event is successfully retrieved. Otherwise, returns zero in non-blocking mode, or a negative error code if some error happens.