annotate plugin/api/alsa/seq_event.h @ 490:c3fb8258e34d

* Make it possible to import an entire session from an RDF document. However, at the moment the timings of events appear to be constrained by how far the audio decoder has got through its audio file at the time the event is queried -- need to investigate.
author Chris Cannam
date Fri, 21 Nov 2008 18:03:14 +0000
parents da6937383da8
children 6b847a59d908
rev   line source
Chris@0 1 /* DSSI ALSA compatibility library
Chris@0 2 *
Chris@0 3 * This library provides for Mac OS X the ALSA snd_seq_event_t handling
Chris@0 4 * necessary to compile and run DSSI. It was extracted from alsa-lib 1.0.8.
Chris@0 5 */
Chris@0 6
Chris@0 7 /**
Chris@0 8 * \file <alsa/seq_event.h>
Chris@0 9 * \brief Application interface library for the ALSA driver
Chris@0 10 * \author Jaroslav Kysela <perex@suse.cz>
Chris@0 11 * \author Abramo Bagnara <abramo@alsa-project.org>
Chris@0 12 * \author Takashi Iwai <tiwai@suse.de>
Chris@0 13 * \date 1998-2001
Chris@0 14 *
Chris@0 15 * Application interface library for the ALSA driver
Chris@0 16 *
Chris@0 17 *
Chris@0 18 * This library is free software; you can redistribute it and/or modify
Chris@0 19 * it under the terms of the GNU Lesser General Public License as
Chris@0 20 * published by the Free Software Foundation; either version 2.1 of
Chris@0 21 * the License, or (at your option) any later version.
Chris@0 22 *
Chris@0 23 * This program is distributed in the hope that it will be useful,
Chris@0 24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@0 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@0 26 * GNU Lesser General Public License for more details.
Chris@0 27 *
Chris@0 28 * You should have received a copy of the GNU Lesser General Public
Chris@0 29 * License along with this library; if not, write to the Free Software
Chris@0 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Chris@0 31 *
Chris@0 32 */
Chris@0 33
Chris@0 34 #ifndef __ALSA_SEQ_EVENT_H
Chris@0 35 #define __ALSA_SEQ_EVENT_H
Chris@0 36
Chris@0 37 /**
Chris@0 38 * \defgroup SeqEvents Sequencer Event Definitions
Chris@0 39 * Sequencer Event Definitions
Chris@0 40 * \ingroup Sequencer
Chris@0 41 * \{
Chris@0 42 */
Chris@0 43
Chris@0 44 /**
Chris@0 45 * Sequencer event data type
Chris@0 46 */
Chris@0 47 typedef unsigned char snd_seq_event_type_t;
Chris@0 48
Chris@0 49 /** Sequencer event type */
Chris@0 50 enum snd_seq_event_type {
Chris@0 51 /** system status; event data type = #snd_seq_result_t */
Chris@0 52 SND_SEQ_EVENT_SYSTEM = 0,
Chris@0 53 /** returned result status; event data type = #snd_seq_result_t */
Chris@0 54 SND_SEQ_EVENT_RESULT,
Chris@0 55
Chris@0 56 /** note on and off with duration; event data type = #snd_seq_ev_note_t */
Chris@0 57 SND_SEQ_EVENT_NOTE = 5,
Chris@0 58 /** note on; event data type = #snd_seq_ev_note_t */
Chris@0 59 SND_SEQ_EVENT_NOTEON,
Chris@0 60 /** note off; event data type = #snd_seq_ev_note_t */
Chris@0 61 SND_SEQ_EVENT_NOTEOFF,
Chris@0 62 /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
Chris@0 63 SND_SEQ_EVENT_KEYPRESS,
Chris@0 64
Chris@0 65 /** controller; event data type = #snd_seq_ev_ctrl_t */
Chris@0 66 SND_SEQ_EVENT_CONTROLLER = 10,
Chris@0 67 /** program change; event data type = #snd_seq_ev_ctrl_t */
Chris@0 68 SND_SEQ_EVENT_PGMCHANGE,
Chris@0 69 /** channel pressure; event data type = #snd_seq_ev_ctrl_t */
Chris@0 70 SND_SEQ_EVENT_CHANPRESS,
Chris@0 71 /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
Chris@0 72 SND_SEQ_EVENT_PITCHBEND,
Chris@0 73 /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
Chris@0 74 SND_SEQ_EVENT_CONTROL14,
Chris@0 75 /** 14 bit NRPN; event data type = #snd_seq_ev_ctrl_t */
Chris@0 76 SND_SEQ_EVENT_NONREGPARAM,
Chris@0 77 /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
Chris@0 78 SND_SEQ_EVENT_REGPARAM,
Chris@0 79
Chris@0 80 /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
Chris@0 81 SND_SEQ_EVENT_SONGPOS = 20,
Chris@0 82 /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
Chris@0 83 SND_SEQ_EVENT_SONGSEL,
Chris@0 84 /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
Chris@0 85 SND_SEQ_EVENT_QFRAME,
Chris@0 86 /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@0 87 SND_SEQ_EVENT_TIMESIGN,
Chris@0 88 /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@0 89 SND_SEQ_EVENT_KEYSIGN,
Chris@0 90
Chris@0 91 /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
Chris@0 92 SND_SEQ_EVENT_START = 30,
Chris@0 93 /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
Chris@0 94 SND_SEQ_EVENT_CONTINUE,
Chris@0 95 /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
Chris@0 96 SND_SEQ_EVENT_STOP,
Chris@0 97 /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@0 98 SND_SEQ_EVENT_SETPOS_TICK,
Chris@0 99 /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@0 100 SND_SEQ_EVENT_SETPOS_TIME,
Chris@0 101 /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
Chris@0 102 SND_SEQ_EVENT_TEMPO,
Chris@0 103 /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
Chris@0 104 SND_SEQ_EVENT_CLOCK,
Chris@0 105 /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
Chris@0 106 SND_SEQ_EVENT_TICK,
Chris@0 107 /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
Chris@0 108 SND_SEQ_EVENT_QUEUE_SKEW,
Chris@0 109 /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
Chris@0 110 SND_SEQ_EVENT_SYNC_POS,
Chris@0 111
Chris@0 112 /** Tune request; event data type = none */
Chris@0 113 SND_SEQ_EVENT_TUNE_REQUEST = 40,
Chris@0 114 /** Reset to power-on state; event data type = none */
Chris@0 115 SND_SEQ_EVENT_RESET,
Chris@0 116 /** Active sensing event; event data type = none */
Chris@0 117 SND_SEQ_EVENT_SENSING,
Chris@0 118
Chris@0 119 /** Echo-back event; event data type = any type */
Chris@0 120 SND_SEQ_EVENT_ECHO = 50,
Chris@0 121 /** OSS emulation raw event; event data type = any type */
Chris@0 122 SND_SEQ_EVENT_OSS,
Chris@0 123
Chris@0 124 /** New client has connected; event data type = #snd_seq_addr_t */
Chris@0 125 SND_SEQ_EVENT_CLIENT_START = 60,
Chris@0 126 /** Client has left the system; event data type = #snd_seq_addr_t */
Chris@0 127 SND_SEQ_EVENT_CLIENT_EXIT,
Chris@0 128 /** Client status/info has changed; event data type = #snd_seq_addr_t */
Chris@0 129 SND_SEQ_EVENT_CLIENT_CHANGE,
Chris@0 130 /** New port was created; event data type = #snd_seq_addr_t */
Chris@0 131 SND_SEQ_EVENT_PORT_START,
Chris@0 132 /** Port was deleted from system; event data type = #snd_seq_addr_t */
Chris@0 133 SND_SEQ_EVENT_PORT_EXIT,
Chris@0 134 /** Port status/info has changed; event data type = #snd_seq_addr_t */
Chris@0 135 SND_SEQ_EVENT_PORT_CHANGE,
Chris@0 136
Chris@0 137 /** Ports connected; event data type = #snd_seq_connect_t */
Chris@0 138 SND_SEQ_EVENT_PORT_SUBSCRIBED,
Chris@0 139 /** Ports disconnected; event data type = #snd_seq_connect_t */
Chris@0 140 SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
Chris@0 141
Chris@0 142 /** Sample select; event data type = #snd_seq_ev_sample_control_t */
Chris@0 143 SND_SEQ_EVENT_SAMPLE = 70,
Chris@0 144 /** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */
Chris@0 145 SND_SEQ_EVENT_SAMPLE_CLUSTER,
Chris@0 146 /** voice start */
Chris@0 147 SND_SEQ_EVENT_SAMPLE_START,
Chris@0 148 /** voice stop */
Chris@0 149 SND_SEQ_EVENT_SAMPLE_STOP,
Chris@0 150 /** playback frequency */
Chris@0 151 SND_SEQ_EVENT_SAMPLE_FREQ,
Chris@0 152 /** volume and balance */
Chris@0 153 SND_SEQ_EVENT_SAMPLE_VOLUME,
Chris@0 154 /** sample loop */
Chris@0 155 SND_SEQ_EVENT_SAMPLE_LOOP,
Chris@0 156 /** sample position */
Chris@0 157 SND_SEQ_EVENT_SAMPLE_POSITION,
Chris@0 158 /** private (hardware dependent) event */
Chris@0 159 SND_SEQ_EVENT_SAMPLE_PRIVATE1,
Chris@0 160
Chris@0 161 /** user-defined event; event data type = any (fixed size) */
Chris@0 162 SND_SEQ_EVENT_USR0 = 90,
Chris@0 163 /** user-defined event; event data type = any (fixed size) */
Chris@0 164 SND_SEQ_EVENT_USR1,
Chris@0 165 /** user-defined event; event data type = any (fixed size) */
Chris@0 166 SND_SEQ_EVENT_USR2,
Chris@0 167 /** user-defined event; event data type = any (fixed size) */
Chris@0 168 SND_SEQ_EVENT_USR3,
Chris@0 169 /** user-defined event; event data type = any (fixed size) */
Chris@0 170 SND_SEQ_EVENT_USR4,
Chris@0 171 /** user-defined event; event data type = any (fixed size) */
Chris@0 172 SND_SEQ_EVENT_USR5,
Chris@0 173 /** user-defined event; event data type = any (fixed size) */
Chris@0 174 SND_SEQ_EVENT_USR6,
Chris@0 175 /** user-defined event; event data type = any (fixed size) */
Chris@0 176 SND_SEQ_EVENT_USR7,
Chris@0 177 /** user-defined event; event data type = any (fixed size) */
Chris@0 178 SND_SEQ_EVENT_USR8,
Chris@0 179 /** user-defined event; event data type = any (fixed size) */
Chris@0 180 SND_SEQ_EVENT_USR9,
Chris@0 181
Chris@0 182 /** begin of instrument management */
Chris@0 183 SND_SEQ_EVENT_INSTR_BEGIN = 100,
Chris@0 184 /** end of instrument management */
Chris@0 185 SND_SEQ_EVENT_INSTR_END,
Chris@0 186 /** query instrument interface info */
Chris@0 187 SND_SEQ_EVENT_INSTR_INFO,
Chris@0 188 /** result of instrument interface info */
Chris@0 189 SND_SEQ_EVENT_INSTR_INFO_RESULT,
Chris@0 190 /** query instrument format info */
Chris@0 191 SND_SEQ_EVENT_INSTR_FINFO,
Chris@0 192 /** result of instrument format info */
Chris@0 193 SND_SEQ_EVENT_INSTR_FINFO_RESULT,
Chris@0 194 /** reset instrument instrument memory */
Chris@0 195 SND_SEQ_EVENT_INSTR_RESET,
Chris@0 196 /** get instrument interface status */
Chris@0 197 SND_SEQ_EVENT_INSTR_STATUS,
Chris@0 198 /** result of instrument interface status */
Chris@0 199 SND_SEQ_EVENT_INSTR_STATUS_RESULT,
Chris@0 200 /** put an instrument to port */
Chris@0 201 SND_SEQ_EVENT_INSTR_PUT,
Chris@0 202 /** get an instrument from port */
Chris@0 203 SND_SEQ_EVENT_INSTR_GET,
Chris@0 204 /** result of instrument query */
Chris@0 205 SND_SEQ_EVENT_INSTR_GET_RESULT,
Chris@0 206 /** free instrument(s) */
Chris@0 207 SND_SEQ_EVENT_INSTR_FREE,
Chris@0 208 /** get instrument list */
Chris@0 209 SND_SEQ_EVENT_INSTR_LIST,
Chris@0 210 /** result of instrument list */
Chris@0 211 SND_SEQ_EVENT_INSTR_LIST_RESULT,
Chris@0 212 /** set cluster parameters */
Chris@0 213 SND_SEQ_EVENT_INSTR_CLUSTER,
Chris@0 214 /** get cluster parameters */
Chris@0 215 SND_SEQ_EVENT_INSTR_CLUSTER_GET,
Chris@0 216 /** result of cluster parameters */
Chris@0 217 SND_SEQ_EVENT_INSTR_CLUSTER_RESULT,
Chris@0 218 /** instrument change */
Chris@0 219 SND_SEQ_EVENT_INSTR_CHANGE,
Chris@0 220
Chris@0 221 /** system exclusive data (variable length); event data type = #snd_seq_ev_ext_t */
Chris@0 222 SND_SEQ_EVENT_SYSEX = 130,
Chris@0 223 /** error event; event data type = #snd_seq_ev_ext_t */
Chris@0 224 SND_SEQ_EVENT_BOUNCE,
Chris@0 225 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0 226 SND_SEQ_EVENT_USR_VAR0 = 135,
Chris@0 227 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0 228 SND_SEQ_EVENT_USR_VAR1,
Chris@0 229 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0 230 SND_SEQ_EVENT_USR_VAR2,
Chris@0 231 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0 232 SND_SEQ_EVENT_USR_VAR3,
Chris@0 233 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0 234 SND_SEQ_EVENT_USR_VAR4,
Chris@0 235
Chris@0 236 /** NOP; ignored in any case */
Chris@0 237 SND_SEQ_EVENT_NONE = 255
Chris@0 238 };
Chris@0 239
Chris@0 240
Chris@0 241 /** Sequencer event address */
Chris@0 242 typedef struct snd_seq_addr {
Chris@0 243 unsigned char client; /**< Client id */
Chris@0 244 unsigned char port; /**< Port id */
Chris@0 245 } snd_seq_addr_t;
Chris@0 246
Chris@0 247 /** Connection (subscription) between ports */
Chris@0 248 typedef struct snd_seq_connect {
Chris@0 249 snd_seq_addr_t sender; /**< sender address */
Chris@0 250 snd_seq_addr_t dest; /**< destination address */
Chris@0 251 } snd_seq_connect_t;
Chris@0 252
Chris@0 253
Chris@0 254 /** Real-time data record */
Chris@0 255 typedef struct snd_seq_real_time {
Chris@0 256 unsigned int tv_sec; /**< seconds */
Chris@0 257 unsigned int tv_nsec; /**< nanoseconds */
Chris@0 258 } snd_seq_real_time_t;
Chris@0 259
Chris@0 260 /** (MIDI) Tick-time data record */
Chris@0 261 typedef unsigned int snd_seq_tick_time_t;
Chris@0 262
Chris@0 263 /** unioned time stamp */
Chris@0 264 typedef union snd_seq_timestamp {
Chris@0 265 snd_seq_tick_time_t tick; /**< tick-time */
Chris@0 266 struct snd_seq_real_time time; /**< real-time */
Chris@0 267 } snd_seq_timestamp_t;
Chris@0 268
Chris@0 269
Chris@0 270 /**
Chris@0 271 * Event mode flags
Chris@0 272 *
Chris@0 273 * NOTE: only 8 bits available!
Chris@0 274 */
Chris@0 275 #define SND_SEQ_TIME_STAMP_TICK (0<<0) /**< timestamp in clock ticks */
Chris@0 276 #define SND_SEQ_TIME_STAMP_REAL (1<<0) /**< timestamp in real time */
Chris@0 277 #define SND_SEQ_TIME_STAMP_MASK (1<<0) /**< mask for timestamp bits */
Chris@0 278
Chris@0 279 #define SND_SEQ_TIME_MODE_ABS (0<<1) /**< absolute timestamp */
Chris@0 280 #define SND_SEQ_TIME_MODE_REL (1<<1) /**< relative to current time */
Chris@0 281 #define SND_SEQ_TIME_MODE_MASK (1<<1) /**< mask for time mode bits */
Chris@0 282
Chris@0 283 #define SND_SEQ_EVENT_LENGTH_FIXED (0<<2) /**< fixed event size */
Chris@0 284 #define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /**< variable event size */
Chris@0 285 #define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2) /**< variable event size - user memory space */
Chris@0 286 #define SND_SEQ_EVENT_LENGTH_MASK (3<<2) /**< mask for event length bits */
Chris@0 287
Chris@0 288 #define SND_SEQ_PRIORITY_NORMAL (0<<4) /**< normal priority */
Chris@0 289 #define SND_SEQ_PRIORITY_HIGH (1<<4) /**< event should be processed before others */
Chris@0 290 #define SND_SEQ_PRIORITY_MASK (1<<4) /**< mask for priority bits */
Chris@0 291
Chris@0 292
Chris@0 293 /** Note event */
Chris@0 294 typedef struct snd_seq_ev_note {
Chris@0 295 unsigned char channel; /**< channel number */
Chris@0 296 unsigned char note; /**< note */
Chris@0 297 unsigned char velocity; /**< velocity */
Chris@0 298 unsigned char off_velocity; /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
Chris@0 299 unsigned int duration; /**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */
Chris@0 300 } snd_seq_ev_note_t;
Chris@0 301
Chris@0 302 /** Controller event */
Chris@0 303 typedef struct snd_seq_ev_ctrl {
Chris@0 304 unsigned char channel; /**< channel number */
Chris@0 305 unsigned char unused[3]; /**< reserved */
Chris@0 306 unsigned int param; /**< control parameter */
Chris@0 307 signed int value; /**< control value */
Chris@0 308 } snd_seq_ev_ctrl_t;
Chris@0 309
Chris@0 310 /** generic set of bytes (12x8 bit) */
Chris@0 311 typedef struct snd_seq_ev_raw8 {
Chris@0 312 unsigned char d[12]; /**< 8 bit value */
Chris@0 313 } snd_seq_ev_raw8_t;
Chris@0 314
Chris@0 315 /** generic set of integers (3x32 bit) */
Chris@0 316 typedef struct snd_seq_ev_raw32 {
Chris@0 317 unsigned int d[3]; /**< 32 bit value */
Chris@0 318 } snd_seq_ev_raw32_t;
Chris@0 319
Chris@0 320 /** external stored data */
Chris@0 321 typedef struct snd_seq_ev_ext {
Chris@0 322 unsigned int len; /**< length of data */
Chris@0 323 void *ptr; /**< pointer to data (note: can be 64-bit) */
Chris@0 324 } __attribute__((packed)) snd_seq_ev_ext_t;
Chris@0 325
Chris@0 326 /** Instrument cluster type */
Chris@0 327 typedef unsigned int snd_seq_instr_cluster_t;
Chris@0 328
Chris@0 329 /** Instrument type */
Chris@0 330 typedef struct snd_seq_instr {
Chris@0 331 snd_seq_instr_cluster_t cluster; /**< cluster id */
Chris@0 332 unsigned int std; /**< instrument standard id; the upper byte means a private instrument (owner - client id) */
Chris@0 333 unsigned short bank; /**< instrument bank id */
Chris@0 334 unsigned short prg; /**< instrument program id */
Chris@0 335 } snd_seq_instr_t;
Chris@0 336
Chris@0 337 /** sample number */
Chris@0 338 typedef struct snd_seq_ev_sample {
Chris@0 339 unsigned int std; /**< sample standard id */
Chris@0 340 unsigned short bank; /**< sample bank id */
Chris@0 341 unsigned short prg; /**< sample program id */
Chris@0 342 } snd_seq_ev_sample_t;
Chris@0 343
Chris@0 344 /** sample cluster */
Chris@0 345 typedef struct snd_seq_ev_cluster {
Chris@0 346 snd_seq_instr_cluster_t cluster; /**< cluster id */
Chris@0 347 } snd_seq_ev_cluster_t;
Chris@0 348
Chris@0 349 /** sample position */
Chris@0 350 typedef unsigned int snd_seq_position_t; /**< playback position (in samples) * 16 */
Chris@0 351
Chris@0 352 /** sample stop mode */
Chris@0 353 typedef enum snd_seq_stop_mode {
Chris@0 354 SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0, /**< terminate playing immediately */
Chris@0 355 SND_SEQ_SAMPLE_STOP_VENVELOPE = 1, /**< finish volume envelope */
Chris@0 356 SND_SEQ_SAMPLE_STOP_LOOP = 2 /**< terminate loop and finish wave */
Chris@0 357 } snd_seq_stop_mode_t;
Chris@0 358
Chris@0 359 /** sample frequency */
Chris@0 360 typedef int snd_seq_frequency_t; /**< playback frequency in HZ * 16 */
Chris@0 361
Chris@0 362 /** sample volume control; if any value is set to -1 == do not change */
Chris@0 363 typedef struct snd_seq_ev_volume {
Chris@0 364 signed short volume; /**< range: 0-16383 */
Chris@0 365 signed short lr; /**< left-right balance; range: 0-16383 */
Chris@0 366 signed short fr; /**< front-rear balance; range: 0-16383 */
Chris@0 367 signed short du; /**< down-up balance; range: 0-16383 */
Chris@0 368 } snd_seq_ev_volume_t;
Chris@0 369
Chris@0 370 /** simple loop redefinition */
Chris@0 371 typedef struct snd_seq_ev_loop {
Chris@0 372 unsigned int start; /**< loop start (in samples) * 16 */
Chris@0 373 unsigned int end; /**< loop end (in samples) * 16 */
Chris@0 374 } snd_seq_ev_loop_t;
Chris@0 375
Chris@0 376 /** Sample control events */
Chris@0 377 typedef struct snd_seq_ev_sample_control {
Chris@0 378 unsigned char channel; /**< channel */
Chris@0 379 unsigned char unused[3]; /**< reserved */
Chris@0 380 union {
Chris@0 381 snd_seq_ev_sample_t sample; /**< sample number */
Chris@0 382 snd_seq_ev_cluster_t cluster; /**< cluster number */
Chris@0 383 snd_seq_position_t position; /**< position */
Chris@0 384 snd_seq_stop_mode_t stop_mode; /**< stop mode */
Chris@0 385 snd_seq_frequency_t frequency; /**< frequency */
Chris@0 386 snd_seq_ev_volume_t volume; /**< volume */
Chris@0 387 snd_seq_ev_loop_t loop; /**< loop control */
Chris@0 388 unsigned char raw8[8]; /**< raw 8-bit */
Chris@0 389 } param; /**< control parameters */
Chris@0 390 } snd_seq_ev_sample_control_t;
Chris@0 391
Chris@0 392
Chris@0 393
Chris@0 394 /** INSTR_BEGIN event */
Chris@0 395 typedef struct snd_seq_ev_instr_begin {
Chris@0 396 int timeout; /**< zero = forever, otherwise timeout in ms */
Chris@0 397 } snd_seq_ev_instr_begin_t;
Chris@0 398
Chris@0 399 /** Result events */
Chris@0 400 typedef struct snd_seq_result {
Chris@0 401 int event; /**< processed event type */
Chris@0 402 int result; /**< status */
Chris@0 403 } snd_seq_result_t;
Chris@0 404
Chris@0 405 /** Queue skew values */
Chris@0 406 typedef struct snd_seq_queue_skew {
Chris@0 407 unsigned int value; /**< skew value */
Chris@0 408 unsigned int base; /**< skew base */
Chris@0 409 } snd_seq_queue_skew_t;
Chris@0 410
Chris@0 411 /** queue timer control */
Chris@0 412 typedef struct snd_seq_ev_queue_control {
Chris@0 413 unsigned char queue; /**< affected queue */
Chris@0 414 unsigned char unused[3]; /**< reserved */
Chris@0 415 union {
Chris@0 416 signed int value; /**< affected value (e.g. tempo) */
Chris@0 417 snd_seq_timestamp_t time; /**< time */
Chris@0 418 unsigned int position; /**< sync position */
Chris@0 419 snd_seq_queue_skew_t skew; /**< queue skew */
Chris@0 420 unsigned int d32[2]; /**< any data */
Chris@0 421 unsigned char d8[8]; /**< any data */
Chris@0 422 } param; /**< data value union */
Chris@0 423 } snd_seq_ev_queue_control_t;
Chris@0 424
Chris@0 425
Chris@0 426 /** Sequencer event */
Chris@0 427 typedef struct snd_seq_event {
Chris@0 428 snd_seq_event_type_t type; /**< event type */
Chris@0 429 unsigned char flags; /**< event flags */
Chris@0 430 unsigned char tag; /**< tag */
Chris@0 431
Chris@0 432 unsigned char queue; /**< schedule queue */
Chris@0 433 snd_seq_timestamp_t time; /**< schedule time */
Chris@0 434
Chris@0 435 snd_seq_addr_t source; /**< source address */
Chris@0 436 snd_seq_addr_t dest; /**< destination address */
Chris@0 437
Chris@0 438 union {
Chris@0 439 snd_seq_ev_note_t note; /**< note information */
Chris@0 440 snd_seq_ev_ctrl_t control; /**< MIDI control information */
Chris@0 441 snd_seq_ev_raw8_t raw8; /**< raw8 data */
Chris@0 442 snd_seq_ev_raw32_t raw32; /**< raw32 data */
Chris@0 443 snd_seq_ev_ext_t ext; /**< external data */
Chris@0 444 snd_seq_ev_queue_control_t queue; /**< queue control */
Chris@0 445 snd_seq_timestamp_t time; /**< timestamp */
Chris@0 446 snd_seq_addr_t addr; /**< address */
Chris@0 447 snd_seq_connect_t connect; /**< connect information */
Chris@0 448 snd_seq_result_t result; /**< operation result code */
Chris@0 449 snd_seq_ev_instr_begin_t instr_begin; /**< instrument */
Chris@0 450 snd_seq_ev_sample_control_t sample; /**< sample control */
Chris@0 451 } data; /**< event data... */
Chris@0 452 } snd_seq_event_t;
Chris@0 453
Chris@0 454
Chris@0 455 /** \} */
Chris@0 456
Chris@0 457 #endif /* __ALSA_SEQ_EVENT_H */
Chris@0 458