📄 seq.h
字号:
SND_ALLOCA(snd_seq_queue_timer, ptr)int snd_seq_queue_timer_malloc(snd_seq_queue_timer_t **ptr);void snd_seq_queue_timer_free(snd_seq_queue_timer_t *ptr);void snd_seq_queue_timer_copy(snd_seq_queue_timer_t *dst, const snd_seq_queue_timer_t *src);int snd_seq_queue_timer_get_queue(const snd_seq_queue_timer_t *info);snd_seq_queue_timer_type_t snd_seq_queue_timer_get_type(const snd_seq_queue_timer_t *info);const snd_timer_id_t *snd_seq_queue_timer_get_id(const snd_seq_queue_timer_t *info);unsigned int snd_seq_queue_timer_get_resolution(const snd_seq_queue_timer_t *info);void snd_seq_queue_timer_set_type(snd_seq_queue_timer_t *info, snd_seq_queue_timer_type_t type);void snd_seq_queue_timer_set_id(snd_seq_queue_timer_t *info, const snd_timer_id_t *id);void snd_seq_queue_timer_set_resolution(snd_seq_queue_timer_t *info, unsigned int resolution);int snd_seq_get_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);int snd_seq_set_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);/** \} *//** * \defgroup SeqEvent Sequencer Event API * Sequencer Event API * \ingroup Sequencer * \{ */int snd_seq_free_event(snd_seq_event_t *ev);ssize_t snd_seq_event_length(snd_seq_event_t *ev);int snd_seq_event_output(snd_seq_t *handle, snd_seq_event_t *ev);int snd_seq_event_output_buffer(snd_seq_t *handle, snd_seq_event_t *ev);int snd_seq_event_output_direct(snd_seq_t *handle, snd_seq_event_t *ev);int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev);int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer);int snd_seq_drain_output(snd_seq_t *handle);int snd_seq_event_output_pending(snd_seq_t *seq);int snd_seq_extract_output(snd_seq_t *handle, snd_seq_event_t **ev);int snd_seq_drop_output(snd_seq_t *handle);int snd_seq_drop_output_buffer(snd_seq_t *handle);int snd_seq_drop_input(snd_seq_t *handle);int snd_seq_drop_input_buffer(snd_seq_t *handle);/** event removal conditionals */typedef struct _snd_seq_remove_events snd_seq_remove_events_t;/** Remove conditional flags */#define SND_SEQ_REMOVE_INPUT (1<<0) /**< Flush input queues */#define SND_SEQ_REMOVE_OUTPUT (1<<1) /**< Flush output queues */#define SND_SEQ_REMOVE_DEST (1<<2) /**< Restrict by destination q:client:port */#define SND_SEQ_REMOVE_DEST_CHANNEL (1<<3) /**< Restrict by channel */#define SND_SEQ_REMOVE_TIME_BEFORE (1<<4) /**< Restrict to before time */#define SND_SEQ_REMOVE_TIME_AFTER (1<<5) /**< Restrict to time or after */#define SND_SEQ_REMOVE_TIME_TICK (1<<6) /**< Time is in ticks */#define SND_SEQ_REMOVE_EVENT_TYPE (1<<7) /**< Restrict to event type */#define SND_SEQ_REMOVE_IGNORE_OFF (1<<8) /**< Do not flush off events */#define SND_SEQ_REMOVE_TAG_MATCH (1<<9) /**< Restrict to events with given tag */size_t snd_seq_remove_events_sizeof(void);/** allocate a #snd_seq_remove_events_t container on stack */#define snd_seq_remove_events_alloca(ptr) \ SND_ALLOCA(snd_seq_remove_events, ptr)int snd_seq_remove_events_malloc(snd_seq_remove_events_t **ptr);void snd_seq_remove_events_free(snd_seq_remove_events_t *ptr);void snd_seq_remove_events_copy(snd_seq_remove_events_t *dst, const snd_seq_remove_events_t *src);unsigned int snd_seq_remove_events_get_condition(const snd_seq_remove_events_t *info);int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info);const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info);const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info);int snd_seq_remove_events_get_channel(const snd_seq_remove_events_t *info);int snd_seq_remove_events_get_event_type(const snd_seq_remove_events_t *info);int snd_seq_remove_events_get_tag(const snd_seq_remove_events_t *info);void snd_seq_remove_events_set_condition(snd_seq_remove_events_t *info, unsigned int flags);void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue);void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time);void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr);void snd_seq_remove_events_set_channel(snd_seq_remove_events_t *info, int channel);void snd_seq_remove_events_set_event_type(snd_seq_remove_events_t *info, int type);void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag);int snd_seq_remove_events(snd_seq_t *handle, snd_seq_remove_events_t *info);/** \} *//** * \defgroup SeqMisc Sequencer Miscellaneous * Sequencer Miscellaneous * \ingroup Sequencer * \{ */void snd_seq_set_bit(int nr, void *array);int snd_seq_change_bit(int nr, void *array);int snd_seq_get_bit(int nr, void *array);/** \} *//** * \defgroup SeqEvType Sequencer Event Type Checks * Sequencer Event Type Checks * \ingroup Sequencer * \{ *//* event type macros */enum { SND_SEQ_EVFLG_RESULT, SND_SEQ_EVFLG_NOTE, SND_SEQ_EVFLG_CONTROL, SND_SEQ_EVFLG_QUEUE, SND_SEQ_EVFLG_SYSTEM, SND_SEQ_EVFLG_MESSAGE, SND_SEQ_EVFLG_CONNECTION, SND_SEQ_EVFLG_SAMPLE, SND_SEQ_EVFLG_USERS, SND_SEQ_EVFLG_INSTR, SND_SEQ_EVFLG_QUOTE, SND_SEQ_EVFLG_NONE, SND_SEQ_EVFLG_RAW, SND_SEQ_EVFLG_FIXED, SND_SEQ_EVFLG_VARIABLE, SND_SEQ_EVFLG_VARUSR};enum { SND_SEQ_EVFLG_NOTE_ONEARG, SND_SEQ_EVFLG_NOTE_TWOARG};enum { SND_SEQ_EVFLG_QUEUE_NOARG, SND_SEQ_EVFLG_QUEUE_TICK, SND_SEQ_EVFLG_QUEUE_TIME, SND_SEQ_EVFLG_QUEUE_VALUE};/** * Exported event type table * * This table is referred by snd_seq_ev_is_xxx. */extern const unsigned int snd_seq_event_types[];#define _SND_SEQ_TYPE(x) (1<<(x)) /**< master type - 24bit */#define _SND_SEQ_TYPE_OPT(x) ((x)<<24) /**< optional type - 8bit *//** check the event type */#define snd_seq_type_check(ev,x) (snd_seq_event_types[(ev)->type] & _SND_SEQ_TYPE(x))/** event type check: result events */#define snd_seq_ev_is_result_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_RESULT)/** event type check: note events */#define snd_seq_ev_is_note_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_NOTE)/** event type check: control events */#define snd_seq_ev_is_control_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_CONTROL)/** event type check: channel specific events */#define snd_seq_ev_is_channel_type(ev) \ (snd_seq_event_types[(ev)->type] & (_SND_SEQ_TYPE(SND_SEQ_EVFLG_NOTE) | _SND_SEQ_TYPE(SND_SEQ_EVFLG_CONTROL)))/** event type check: queue control events */#define snd_seq_ev_is_queue_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_QUEUE)/** event type check: system status messages */#define snd_seq_ev_is_message_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_MESSAGE)/** event type check: system status messages */#define snd_seq_ev_is_subscribe_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_CONNECTION)/** event type check: sample messages */#define snd_seq_ev_is_sample_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_SAMPLE)/** event type check: user-defined messages */#define snd_seq_ev_is_user_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_USERS)/** event type check: instrument layer events */#define snd_seq_ev_is_instr_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_INSTR)/** event type check: fixed length events */#define snd_seq_ev_is_fixed_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_FIXED)/** event type check: variable length events */#define snd_seq_ev_is_variable_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_VARIABLE)/** event type check: user pointer events */#define snd_seq_ev_is_varusr_type(ev) \ snd_seq_type_check(ev, SND_SEQ_EVFLG_VARUSR)/** event type check: reserved for kernel */#define snd_seq_ev_is_reserved(ev) \ (! snd_seq_event_types[(ev)->type])/** * macros to check event flags *//** prior events */#define snd_seq_ev_is_prior(ev) \ (((ev)->flags & SND_SEQ_PRIORITY_MASK) == SND_SEQ_PRIORITY_HIGH)/** get the data length type */#define snd_seq_ev_length_type(ev) \ ((ev)->flags & SND_SEQ_EVENT_LENGTH_MASK)/** fixed length events */#define snd_seq_ev_is_fixed(ev) \ (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_FIXED)/** variable length events */#define snd_seq_ev_is_variable(ev) \ (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARIABLE)/** variable length on user-space */#define snd_seq_ev_is_varusr(ev) \ (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARUSR)/** time-stamp type */#define snd_seq_ev_timestamp_type(ev) \ ((ev)->flags & SND_SEQ_TIME_STAMP_MASK)/** event is in tick time */#define snd_seq_ev_is_tick(ev) \ (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_TICK)/** event is in real-time */#define snd_seq_ev_is_real(ev) \ (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_REAL)/** time-mode type */#define snd_seq_ev_timemode_type(ev) \ ((ev)->flags & SND_SEQ_TIME_MODE_MASK)/** scheduled in absolute time */#define snd_seq_ev_is_abstime(ev) \ (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_ABS)/** scheduled in relative time */#define snd_seq_ev_is_reltime(ev) \ (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_REL)/** direct dispatched events */#define snd_seq_ev_is_direct(ev) \ ((ev)->queue == SND_SEQ_QUEUE_DIRECT)/** \} */#ifdef __cplusplus}#endif#endif /* __ALSA_SEQ_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -