00001
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_SAMPLE = 70,
00139 SND_SEQ_EVENT_SAMPLE_CLUSTER,
00141 SND_SEQ_EVENT_SAMPLE_START,
00143 SND_SEQ_EVENT_SAMPLE_STOP,
00145 SND_SEQ_EVENT_SAMPLE_FREQ,
00147 SND_SEQ_EVENT_SAMPLE_VOLUME,
00149 SND_SEQ_EVENT_SAMPLE_LOOP,
00151 SND_SEQ_EVENT_SAMPLE_POSITION,
00153 SND_SEQ_EVENT_SAMPLE_PRIVATE1,
00154
00156 SND_SEQ_EVENT_USR0 = 90,
00158 SND_SEQ_EVENT_USR1,
00160 SND_SEQ_EVENT_USR2,
00162 SND_SEQ_EVENT_USR3,
00164 SND_SEQ_EVENT_USR4,
00166 SND_SEQ_EVENT_USR5,
00168 SND_SEQ_EVENT_USR6,
00170 SND_SEQ_EVENT_USR7,
00172 SND_SEQ_EVENT_USR8,
00174 SND_SEQ_EVENT_USR9,
00175
00177 SND_SEQ_EVENT_INSTR_BEGIN = 100,
00179 SND_SEQ_EVENT_INSTR_END,
00181 SND_SEQ_EVENT_INSTR_INFO,
00183 SND_SEQ_EVENT_INSTR_INFO_RESULT,
00185 SND_SEQ_EVENT_INSTR_FINFO,
00187 SND_SEQ_EVENT_INSTR_FINFO_RESULT,
00189 SND_SEQ_EVENT_INSTR_RESET,
00191 SND_SEQ_EVENT_INSTR_STATUS,
00193 SND_SEQ_EVENT_INSTR_STATUS_RESULT,
00195 SND_SEQ_EVENT_INSTR_PUT,
00197 SND_SEQ_EVENT_INSTR_GET,
00199 SND_SEQ_EVENT_INSTR_GET_RESULT,
00201 SND_SEQ_EVENT_INSTR_FREE,
00203 SND_SEQ_EVENT_INSTR_LIST,
00205 SND_SEQ_EVENT_INSTR_LIST_RESULT,
00207 SND_SEQ_EVENT_INSTR_CLUSTER,
00209 SND_SEQ_EVENT_INSTR_CLUSTER_GET,
00211 SND_SEQ_EVENT_INSTR_CLUSTER_RESULT,
00213 SND_SEQ_EVENT_INSTR_CHANGE,
00214
00216 SND_SEQ_EVENT_SYSEX = 130,
00218 SND_SEQ_EVENT_BOUNCE,
00220 SND_SEQ_EVENT_USR_VAR0 = 135,
00222 SND_SEQ_EVENT_USR_VAR1,
00224 SND_SEQ_EVENT_USR_VAR2,
00226 SND_SEQ_EVENT_USR_VAR3,
00228 SND_SEQ_EVENT_USR_VAR4,
00229
00231 SND_SEQ_EVENT_NONE = 255
00232 };
00233
00234
00236 typedef struct snd_seq_addr {
00237 unsigned char client;
00238 unsigned char port;
00239 } snd_seq_addr_t;
00240
00242 typedef struct snd_seq_connect {
00243 snd_seq_addr_t sender;
00244 snd_seq_addr_t dest;
00245 } snd_seq_connect_t;
00246
00247
00249 typedef struct snd_seq_real_time {
00250 unsigned int tv_sec;
00251 unsigned int tv_nsec;
00252 } snd_seq_real_time_t;
00253
00255 typedef unsigned int snd_seq_tick_time_t;
00256
00258 typedef union snd_seq_timestamp {
00259 snd_seq_tick_time_t tick;
00260 struct snd_seq_real_time time;
00261 } snd_seq_timestamp_t;
00262
00263
00269 #define SND_SEQ_TIME_STAMP_TICK (0<<0)
00270 #define SND_SEQ_TIME_STAMP_REAL (1<<0)
00271 #define SND_SEQ_TIME_STAMP_MASK (1<<0)
00273 #define SND_SEQ_TIME_MODE_ABS (0<<1)
00274 #define SND_SEQ_TIME_MODE_REL (1<<1)
00275 #define SND_SEQ_TIME_MODE_MASK (1<<1)
00277 #define SND_SEQ_EVENT_LENGTH_FIXED (0<<2)
00278 #define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2)
00279 #define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2)
00280 #define SND_SEQ_EVENT_LENGTH_MASK (3<<2)
00282 #define SND_SEQ_PRIORITY_NORMAL (0<<4)
00283 #define SND_SEQ_PRIORITY_HIGH (1<<4)
00284 #define SND_SEQ_PRIORITY_MASK (1<<4)
00288 typedef struct snd_seq_ev_note {
00289 unsigned char channel;
00290 unsigned char note;
00291 unsigned char velocity;
00292 unsigned char off_velocity;
00293 unsigned int duration;
00294 } snd_seq_ev_note_t;
00295
00297 typedef struct snd_seq_ev_ctrl {
00298 unsigned char channel;
00299 unsigned char unused[3];
00300 unsigned int param;
00301 signed int value;
00302 } snd_seq_ev_ctrl_t;
00303
00305 typedef struct snd_seq_ev_raw8 {
00306 unsigned char d[12];
00307 } snd_seq_ev_raw8_t;
00308
00310 typedef struct snd_seq_ev_raw32 {
00311 unsigned int d[3];
00312 } snd_seq_ev_raw32_t;
00313
00315 typedef struct snd_seq_ev_ext {
00316 unsigned int len;
00317 void *ptr;
00318 } __attribute__((packed)) snd_seq_ev_ext_t;
00319
00321 typedef unsigned int snd_seq_instr_cluster_t;
00322
00324 typedef struct snd_seq_instr {
00325 snd_seq_instr_cluster_t cluster;
00326 unsigned int std;
00327 unsigned short bank;
00328 unsigned short prg;
00329 } snd_seq_instr_t;
00330
00332 typedef struct snd_seq_ev_sample {
00333 unsigned int std;
00334 unsigned short bank;
00335 unsigned short prg;
00336 } snd_seq_ev_sample_t;
00337
00339 typedef struct snd_seq_ev_cluster {
00340 snd_seq_instr_cluster_t cluster;
00341 } snd_seq_ev_cluster_t;
00342
00344 typedef unsigned int snd_seq_position_t;
00347 typedef enum snd_seq_stop_mode {
00348 SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0,
00349 SND_SEQ_SAMPLE_STOP_VENVELOPE = 1,
00350 SND_SEQ_SAMPLE_STOP_LOOP = 2
00351 } snd_seq_stop_mode_t;
00352
00354 typedef int snd_seq_frequency_t;
00357 typedef struct snd_seq_ev_volume {
00358 signed short volume;
00359 signed short lr;
00360 signed short fr;
00361 signed short du;
00362 } snd_seq_ev_volume_t;
00363
00365 typedef struct snd_seq_ev_loop {
00366 unsigned int start;
00367 unsigned int end;
00368 } snd_seq_ev_loop_t;
00369
00371 typedef struct snd_seq_ev_sample_control {
00372 unsigned char channel;
00373 unsigned char unused[3];
00374 union {
00375 snd_seq_ev_sample_t sample;
00376 snd_seq_ev_cluster_t cluster;
00377 snd_seq_position_t position;
00378 snd_seq_stop_mode_t stop_mode;
00379 snd_seq_frequency_t frequency;
00380 snd_seq_ev_volume_t volume;
00381 snd_seq_ev_loop_t loop;
00382 unsigned char raw8[8];
00383 } param;
00384 } snd_seq_ev_sample_control_t;
00385
00386
00387
00389 typedef struct snd_seq_ev_instr_begin {
00390 int timeout;
00391 } snd_seq_ev_instr_begin_t;
00392
00394 typedef struct snd_seq_result {
00395 int event;
00396 int result;
00397 } snd_seq_result_t;
00398
00400 typedef struct snd_seq_queue_skew {
00401 unsigned int value;
00402 unsigned int base;
00403 } snd_seq_queue_skew_t;
00404
00406 typedef struct snd_seq_ev_queue_control {
00407 unsigned char queue;
00408 unsigned char unused[3];
00409 union {
00410 signed int value;
00411 snd_seq_timestamp_t time;
00412 unsigned int position;
00413 snd_seq_queue_skew_t skew;
00414 unsigned int d32[2];
00415 unsigned char d8[8];
00416 } param;
00417 } snd_seq_ev_queue_control_t;
00418
00419
00421 typedef struct snd_seq_event {
00422 snd_seq_event_type_t type;
00423 unsigned char flags;
00424 unsigned char tag;
00426 unsigned char queue;
00427 snd_seq_timestamp_t time;
00429 snd_seq_addr_t source;
00430 snd_seq_addr_t dest;
00432 union {
00433 snd_seq_ev_note_t note;
00434 snd_seq_ev_ctrl_t control;
00435 snd_seq_ev_raw8_t raw8;
00436 snd_seq_ev_raw32_t raw32;
00437 snd_seq_ev_ext_t ext;
00438 snd_seq_ev_queue_control_t queue;
00439 snd_seq_timestamp_t time;
00440 snd_seq_addr_t addr;
00441 snd_seq_connect_t connect;
00442 snd_seq_result_t result;
00443 snd_seq_ev_instr_begin_t instr_begin;
00444 snd_seq_ev_sample_control_t sample;
00445 } data;
00446 } snd_seq_event_t;
00447
00448
00451 #endif
00452