00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __ALSA_SEQ_EVENT_H
00029 #define __ALSA_SEQ_EVENT_H
00030
00041 typedef unsigned char snd_seq_event_type_t;
00042
00044 enum snd_seq_event_type {
00046 SND_SEQ_EVENT_SYSTEM = 0,
00048 SND_SEQ_EVENT_RESULT,
00049
00051 SND_SEQ_EVENT_NOTE = 5,
00053 SND_SEQ_EVENT_NOTEON,
00055 SND_SEQ_EVENT_NOTEOFF,
00057 SND_SEQ_EVENT_KEYPRESS,
00058
00060 SND_SEQ_EVENT_CONTROLLER = 10,
00062 SND_SEQ_EVENT_PGMCHANGE,
00064 SND_SEQ_EVENT_CHANPRESS,
00066 SND_SEQ_EVENT_PITCHBEND,
00068 SND_SEQ_EVENT_CONTROL14,
00070 SND_SEQ_EVENT_NONREGPARAM,
00072 SND_SEQ_EVENT_REGPARAM,
00073
00075 SND_SEQ_EVENT_SONGPOS = 20,
00077 SND_SEQ_EVENT_SONGSEL,
00079 SND_SEQ_EVENT_QFRAME,
00081 SND_SEQ_EVENT_TIMESIGN,
00083 SND_SEQ_EVENT_KEYSIGN,
00084
00086 SND_SEQ_EVENT_START = 30,
00088 SND_SEQ_EVENT_CONTINUE,
00090 SND_SEQ_EVENT_STOP,
00092 SND_SEQ_EVENT_SETPOS_TICK,
00094 SND_SEQ_EVENT_SETPOS_TIME,
00096 SND_SEQ_EVENT_TEMPO,
00098 SND_SEQ_EVENT_CLOCK,
00100 SND_SEQ_EVENT_TICK,
00102 SND_SEQ_EVENT_QUEUE_SKEW,
00104 SND_SEQ_EVENT_SYNC_POS,
00105
00107 SND_SEQ_EVENT_TUNE_REQUEST = 40,
00109 SND_SEQ_EVENT_RESET,
00111 SND_SEQ_EVENT_SENSING,
00112
00114 SND_SEQ_EVENT_ECHO = 50,
00116 SND_SEQ_EVENT_OSS,
00117
00119 SND_SEQ_EVENT_CLIENT_START = 60,
00121 SND_SEQ_EVENT_CLIENT_EXIT,
00123 SND_SEQ_EVENT_CLIENT_CHANGE,
00125 SND_SEQ_EVENT_PORT_START,
00127 SND_SEQ_EVENT_PORT_EXIT,
00129 SND_SEQ_EVENT_PORT_CHANGE,
00130
00132 SND_SEQ_EVENT_PORT_SUBSCRIBED,
00134 SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
00135
00137 SND_SEQ_EVENT_USR0 = 90,
00139 SND_SEQ_EVENT_USR1,
00141 SND_SEQ_EVENT_USR2,
00143 SND_SEQ_EVENT_USR3,
00145 SND_SEQ_EVENT_USR4,
00147 SND_SEQ_EVENT_USR5,
00149 SND_SEQ_EVENT_USR6,
00151 SND_SEQ_EVENT_USR7,
00153 SND_SEQ_EVENT_USR8,
00155 SND_SEQ_EVENT_USR9,
00156
00158 SND_SEQ_EVENT_SYSEX = 130,
00160 SND_SEQ_EVENT_BOUNCE,
00162 SND_SEQ_EVENT_USR_VAR0 = 135,
00164 SND_SEQ_EVENT_USR_VAR1,
00166 SND_SEQ_EVENT_USR_VAR2,
00168 SND_SEQ_EVENT_USR_VAR3,
00170 SND_SEQ_EVENT_USR_VAR4,
00171
00173 SND_SEQ_EVENT_NONE = 255
00174 };
00175
00176
00178 typedef struct snd_seq_addr {
00179 unsigned char client;
00180 unsigned char port;
00181 } snd_seq_addr_t;
00182
00184 typedef struct snd_seq_connect {
00185 snd_seq_addr_t sender;
00186 snd_seq_addr_t dest;
00187 } snd_seq_connect_t;
00188
00189
00191 typedef struct snd_seq_real_time {
00192 unsigned int tv_sec;
00193 unsigned int tv_nsec;
00194 } snd_seq_real_time_t;
00195
00197 typedef unsigned int snd_seq_tick_time_t;
00198
00200 typedef union snd_seq_timestamp {
00201 snd_seq_tick_time_t tick;
00202 struct snd_seq_real_time time;
00203 } snd_seq_timestamp_t;
00204
00205
00211 #define SND_SEQ_TIME_STAMP_TICK (0<<0)
00212 #define SND_SEQ_TIME_STAMP_REAL (1<<0)
00213 #define SND_SEQ_TIME_STAMP_MASK (1<<0)
00215 #define SND_SEQ_TIME_MODE_ABS (0<<1)
00216 #define SND_SEQ_TIME_MODE_REL (1<<1)
00217 #define SND_SEQ_TIME_MODE_MASK (1<<1)
00219 #define SND_SEQ_EVENT_LENGTH_FIXED (0<<2)
00220 #define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2)
00221 #define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2)
00222 #define SND_SEQ_EVENT_LENGTH_MASK (3<<2)
00224 #define SND_SEQ_PRIORITY_NORMAL (0<<4)
00225 #define SND_SEQ_PRIORITY_HIGH (1<<4)
00226 #define SND_SEQ_PRIORITY_MASK (1<<4)
00230 typedef struct snd_seq_ev_note {
00231 unsigned char channel;
00232 unsigned char note;
00233 unsigned char velocity;
00234 unsigned char off_velocity;
00235 unsigned int duration;
00236 } snd_seq_ev_note_t;
00237
00239 typedef struct snd_seq_ev_ctrl {
00240 unsigned char channel;
00241 unsigned char unused[3];
00242 unsigned int param;
00243 signed int value;
00244 } snd_seq_ev_ctrl_t;
00245
00247 typedef struct snd_seq_ev_raw8 {
00248 unsigned char d[12];
00249 } snd_seq_ev_raw8_t;
00250
00252 typedef struct snd_seq_ev_raw32 {
00253 unsigned int d[3];
00254 } snd_seq_ev_raw32_t;
00255
00257 typedef struct snd_seq_ev_ext {
00258 unsigned int len;
00259 void *ptr;
00260 } __attribute__((packed)) snd_seq_ev_ext_t;
00261
00263 typedef struct snd_seq_result {
00264 int event;
00265 int result;
00266 } snd_seq_result_t;
00267
00269 typedef struct snd_seq_queue_skew {
00270 unsigned int value;
00271 unsigned int base;
00272 } snd_seq_queue_skew_t;
00273
00275 typedef struct snd_seq_ev_queue_control {
00276 unsigned char queue;
00277 unsigned char unused[3];
00278 union {
00279 signed int value;
00280 snd_seq_timestamp_t time;
00281 unsigned int position;
00282 snd_seq_queue_skew_t skew;
00283 unsigned int d32[2];
00284 unsigned char d8[8];
00285 } param;
00286 } snd_seq_ev_queue_control_t;
00287
00288
00290 typedef struct snd_seq_event {
00291 snd_seq_event_type_t type;
00292 unsigned char flags;
00293 unsigned char tag;
00295 unsigned char queue;
00296 snd_seq_timestamp_t time;
00298 snd_seq_addr_t source;
00299 snd_seq_addr_t dest;
00301 union {
00302 snd_seq_ev_note_t note;
00303 snd_seq_ev_ctrl_t control;
00304 snd_seq_ev_raw8_t raw8;
00305 snd_seq_ev_raw32_t raw32;
00306 snd_seq_ev_ext_t ext;
00307 snd_seq_ev_queue_control_t queue;
00308 snd_seq_timestamp_t time;
00309 snd_seq_addr_t addr;
00310 snd_seq_connect_t connect;
00311 snd_seq_result_t result;
00312 } data;
00313 } snd_seq_event_t;
00314
00315
00318 #endif
00319