0001
0002
0003
0004
0005
0006
0007 #ifndef __SOUND_ASEQUENCER_H
0008 #define __SOUND_ASEQUENCER_H
0009
0010 #include <linux/ioctl.h>
0011 #include <sound/asound.h>
0012 #include <uapi/sound/asequencer.h>
0013
0014
0015 #define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
0016
0017
0018
0019
0020
0021 #define snd_seq_ev_is_result_type(ev) ((ev)->type < 5)
0022
0023 #define snd_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)
0024
0025 #define snd_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)
0026
0027 #define snd_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)
0028
0029 #define snd_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)
0030
0031 #define snd_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)
0032
0033 #define snd_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)
0034
0035 #define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
0036
0037 #define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
0038
0039 #define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
0040
0041 #define snd_seq_ev_is_reserved(ev) ((ev)->type >= 150)
0042
0043
0044 #define snd_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)
0045
0046
0047
0048
0049
0050 #define snd_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)
0051
0052
0053 #define snd_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)
0054 #define snd_seq_ev_is_fixed(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)
0055 #define snd_seq_ev_is_variable(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
0056 #define snd_seq_ev_is_varusr(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)
0057
0058
0059 #define snd_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)
0060 #define snd_seq_ev_is_tick(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)
0061 #define snd_seq_ev_is_real(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)
0062
0063
0064 #define snd_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)
0065 #define snd_seq_ev_is_abstime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)
0066 #define snd_seq_ev_is_reltime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)
0067
0068
0069 #define snd_seq_queue_sync_port(q) ((q) + 16)
0070
0071 #endif