annotate plugin/api/alsa/seq_event.h @ 1881:b504df98c3be

Ensure completion on output model is started at zero, so if it's checked before the input model has become ready and the transform has begun, it is not accidentally reported as complete (affected re-aligning models in Sonic Lineup when replacing the session)
author Chris Cannam
date Fri, 26 Jun 2020 11:45:39 +0100
parents 48e9f538e6e9
children
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@1429 51 /** system status; event data type = #snd_seq_result_t */
Chris@1429 52 SND_SEQ_EVENT_SYSTEM = 0,
Chris@1429 53 /** returned result status; event data type = #snd_seq_result_t */
Chris@1429 54 SND_SEQ_EVENT_RESULT,
Chris@0 55
Chris@1429 56 /** note on and off with duration; event data type = #snd_seq_ev_note_t */
Chris@1429 57 SND_SEQ_EVENT_NOTE = 5,
Chris@1429 58 /** note on; event data type = #snd_seq_ev_note_t */
Chris@1429 59 SND_SEQ_EVENT_NOTEON,
Chris@1429 60 /** note off; event data type = #snd_seq_ev_note_t */
Chris@1429 61 SND_SEQ_EVENT_NOTEOFF,
Chris@1429 62 /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
Chris@1429 63 SND_SEQ_EVENT_KEYPRESS,
Chris@1429 64
Chris@1429 65 /** controller; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 66 SND_SEQ_EVENT_CONTROLLER = 10,
Chris@1429 67 /** program change; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 68 SND_SEQ_EVENT_PGMCHANGE,
Chris@1429 69 /** channel pressure; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 70 SND_SEQ_EVENT_CHANPRESS,
Chris@1429 71 /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
Chris@1429 72 SND_SEQ_EVENT_PITCHBEND,
Chris@1429 73 /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 74 SND_SEQ_EVENT_CONTROL14,
Chris@1429 75 /** 14 bit NRPN; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 76 SND_SEQ_EVENT_NONREGPARAM,
Chris@1429 77 /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 78 SND_SEQ_EVENT_REGPARAM,
Chris@0 79
Chris@1429 80 /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 81 SND_SEQ_EVENT_SONGPOS = 20,
Chris@1429 82 /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 83 SND_SEQ_EVENT_SONGSEL,
Chris@1429 84 /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 85 SND_SEQ_EVENT_QFRAME,
Chris@1429 86 /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 87 SND_SEQ_EVENT_TIMESIGN,
Chris@1429 88 /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@1429 89 SND_SEQ_EVENT_KEYSIGN,
Chris@1429 90
Chris@1429 91 /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 92 SND_SEQ_EVENT_START = 30,
Chris@1429 93 /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 94 SND_SEQ_EVENT_CONTINUE,
Chris@1429 95 /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 96 SND_SEQ_EVENT_STOP,
Chris@1429 97 /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 98 SND_SEQ_EVENT_SETPOS_TICK,
Chris@1429 99 /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 100 SND_SEQ_EVENT_SETPOS_TIME,
Chris@1429 101 /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 102 SND_SEQ_EVENT_TEMPO,
Chris@1429 103 /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 104 SND_SEQ_EVENT_CLOCK,
Chris@1429 105 /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 106 SND_SEQ_EVENT_TICK,
Chris@1429 107 /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 108 SND_SEQ_EVENT_QUEUE_SKEW,
Chris@1429 109 /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
Chris@1429 110 SND_SEQ_EVENT_SYNC_POS,
Chris@0 111
Chris@1429 112 /** Tune request; event data type = none */
Chris@1429 113 SND_SEQ_EVENT_TUNE_REQUEST = 40,
Chris@1429 114 /** Reset to power-on state; event data type = none */
Chris@1429 115 SND_SEQ_EVENT_RESET,
Chris@1429 116 /** Active sensing event; event data type = none */
Chris@1429 117 SND_SEQ_EVENT_SENSING,
Chris@0 118
Chris@1429 119 /** Echo-back event; event data type = any type */
Chris@1429 120 SND_SEQ_EVENT_ECHO = 50,
Chris@1429 121 /** OSS emulation raw event; event data type = any type */
Chris@1429 122 SND_SEQ_EVENT_OSS,
Chris@0 123
Chris@1429 124 /** New client has connected; event data type = #snd_seq_addr_t */
Chris@1429 125 SND_SEQ_EVENT_CLIENT_START = 60,
Chris@1429 126 /** Client has left the system; event data type = #snd_seq_addr_t */
Chris@1429 127 SND_SEQ_EVENT_CLIENT_EXIT,
Chris@1429 128 /** Client status/info has changed; event data type = #snd_seq_addr_t */
Chris@1429 129 SND_SEQ_EVENT_CLIENT_CHANGE,
Chris@1429 130 /** New port was created; event data type = #snd_seq_addr_t */
Chris@1429 131 SND_SEQ_EVENT_PORT_START,
Chris@1429 132 /** Port was deleted from system; event data type = #snd_seq_addr_t */
Chris@1429 133 SND_SEQ_EVENT_PORT_EXIT,
Chris@1429 134 /** Port status/info has changed; event data type = #snd_seq_addr_t */
Chris@1429 135 SND_SEQ_EVENT_PORT_CHANGE,
Chris@0 136
Chris@1429 137 /** Ports connected; event data type = #snd_seq_connect_t */
Chris@1429 138 SND_SEQ_EVENT_PORT_SUBSCRIBED,
Chris@1429 139 /** Ports disconnected; event data type = #snd_seq_connect_t */
Chris@1429 140 SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
Chris@0 141
Chris@1429 142 /** Sample select; event data type = #snd_seq_ev_sample_control_t */
Chris@1429 143 SND_SEQ_EVENT_SAMPLE = 70,
Chris@1429 144 /** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */
Chris@1429 145 SND_SEQ_EVENT_SAMPLE_CLUSTER,
Chris@1429 146 /** voice start */
Chris@1429 147 SND_SEQ_EVENT_SAMPLE_START,
Chris@1429 148 /** voice stop */
Chris@1429 149 SND_SEQ_EVENT_SAMPLE_STOP,
Chris@1429 150 /** playback frequency */
Chris@1429 151 SND_SEQ_EVENT_SAMPLE_FREQ,
Chris@1429 152 /** volume and balance */
Chris@1429 153 SND_SEQ_EVENT_SAMPLE_VOLUME,
Chris@1429 154 /** sample loop */
Chris@1429 155 SND_SEQ_EVENT_SAMPLE_LOOP,
Chris@1429 156 /** sample position */
Chris@1429 157 SND_SEQ_EVENT_SAMPLE_POSITION,
Chris@1429 158 /** private (hardware dependent) event */
Chris@1429 159 SND_SEQ_EVENT_SAMPLE_PRIVATE1,
Chris@0 160
Chris@1429 161 /** user-defined event; event data type = any (fixed size) */
Chris@1429 162 SND_SEQ_EVENT_USR0 = 90,
Chris@1429 163 /** user-defined event; event data type = any (fixed size) */
Chris@1429 164 SND_SEQ_EVENT_USR1,
Chris@1429 165 /** user-defined event; event data type = any (fixed size) */
Chris@1429 166 SND_SEQ_EVENT_USR2,
Chris@1429 167 /** user-defined event; event data type = any (fixed size) */
Chris@1429 168 SND_SEQ_EVENT_USR3,
Chris@1429 169 /** user-defined event; event data type = any (fixed size) */
Chris@1429 170 SND_SEQ_EVENT_USR4,
Chris@1429 171 /** user-defined event; event data type = any (fixed size) */
Chris@1429 172 SND_SEQ_EVENT_USR5,
Chris@1429 173 /** user-defined event; event data type = any (fixed size) */
Chris@1429 174 SND_SEQ_EVENT_USR6,
Chris@1429 175 /** user-defined event; event data type = any (fixed size) */
Chris@1429 176 SND_SEQ_EVENT_USR7,
Chris@1429 177 /** user-defined event; event data type = any (fixed size) */
Chris@1429 178 SND_SEQ_EVENT_USR8,
Chris@1429 179 /** user-defined event; event data type = any (fixed size) */
Chris@1429 180 SND_SEQ_EVENT_USR9,
Chris@0 181
Chris@1429 182 /** begin of instrument management */
Chris@1429 183 SND_SEQ_EVENT_INSTR_BEGIN = 100,
Chris@1429 184 /** end of instrument management */
Chris@1429 185 SND_SEQ_EVENT_INSTR_END,
Chris@1429 186 /** query instrument interface info */
Chris@1429 187 SND_SEQ_EVENT_INSTR_INFO,
Chris@1429 188 /** result of instrument interface info */
Chris@1429 189 SND_SEQ_EVENT_INSTR_INFO_RESULT,
Chris@1429 190 /** query instrument format info */
Chris@1429 191 SND_SEQ_EVENT_INSTR_FINFO,
Chris@1429 192 /** result of instrument format info */
Chris@1429 193 SND_SEQ_EVENT_INSTR_FINFO_RESULT,
Chris@1429 194 /** reset instrument instrument memory */
Chris@1429 195 SND_SEQ_EVENT_INSTR_RESET,
Chris@1429 196 /** get instrument interface status */
Chris@1429 197 SND_SEQ_EVENT_INSTR_STATUS,
Chris@1429 198 /** result of instrument interface status */
Chris@1429 199 SND_SEQ_EVENT_INSTR_STATUS_RESULT,
Chris@1429 200 /** put an instrument to port */
Chris@1429 201 SND_SEQ_EVENT_INSTR_PUT,
Chris@1429 202 /** get an instrument from port */
Chris@1429 203 SND_SEQ_EVENT_INSTR_GET,
Chris@1429 204 /** result of instrument query */
Chris@1429 205 SND_SEQ_EVENT_INSTR_GET_RESULT,
Chris@1429 206 /** free instrument(s) */
Chris@1429 207 SND_SEQ_EVENT_INSTR_FREE,
Chris@1429 208 /** get instrument list */
Chris@1429 209 SND_SEQ_EVENT_INSTR_LIST,
Chris@1429 210 /** result of instrument list */
Chris@1429 211 SND_SEQ_EVENT_INSTR_LIST_RESULT,
Chris@1429 212 /** set cluster parameters */
Chris@1429 213 SND_SEQ_EVENT_INSTR_CLUSTER,
Chris@1429 214 /** get cluster parameters */
Chris@1429 215 SND_SEQ_EVENT_INSTR_CLUSTER_GET,
Chris@1429 216 /** result of cluster parameters */
Chris@1429 217 SND_SEQ_EVENT_INSTR_CLUSTER_RESULT,
Chris@1429 218 /** instrument change */
Chris@1429 219 SND_SEQ_EVENT_INSTR_CHANGE,
Chris@0 220
Chris@1429 221 /** system exclusive data (variable length); event data type = #snd_seq_ev_ext_t */
Chris@1429 222 SND_SEQ_EVENT_SYSEX = 130,
Chris@1429 223 /** error event; event data type = #snd_seq_ev_ext_t */
Chris@1429 224 SND_SEQ_EVENT_BOUNCE,
Chris@1429 225 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429 226 SND_SEQ_EVENT_USR_VAR0 = 135,
Chris@1429 227 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429 228 SND_SEQ_EVENT_USR_VAR1,
Chris@1429 229 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429 230 SND_SEQ_EVENT_USR_VAR2,
Chris@1429 231 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429 232 SND_SEQ_EVENT_USR_VAR3,
Chris@1429 233 /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429 234 SND_SEQ_EVENT_USR_VAR4,
Chris@0 235
Chris@1429 236 /** NOP; ignored in any case */
Chris@1429 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@1429 243 unsigned char client; /**< Client id */
Chris@1429 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@1429 249 snd_seq_addr_t sender; /**< sender address */
Chris@1429 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@1429 256 unsigned int tv_sec; /**< seconds */
Chris@1429 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@1429 265 snd_seq_tick_time_t tick; /**< tick-time */
Chris@1429 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@1429 275 #define SND_SEQ_TIME_STAMP_TICK (0<<0) /**< timestamp in clock ticks */
Chris@1429 276 #define SND_SEQ_TIME_STAMP_REAL (1<<0) /**< timestamp in real time */
Chris@1429 277 #define SND_SEQ_TIME_STAMP_MASK (1<<0) /**< mask for timestamp bits */
Chris@0 278
Chris@1429 279 #define SND_SEQ_TIME_MODE_ABS (0<<1) /**< absolute timestamp */
Chris@1429 280 #define SND_SEQ_TIME_MODE_REL (1<<1) /**< relative to current time */
Chris@1429 281 #define SND_SEQ_TIME_MODE_MASK (1<<1) /**< mask for time mode bits */
Chris@0 282
Chris@1429 283 #define SND_SEQ_EVENT_LENGTH_FIXED (0<<2) /**< fixed event size */
Chris@1429 284 #define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /**< variable event size */
Chris@1429 285 #define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2) /**< variable event size - user memory space */
Chris@1429 286 #define SND_SEQ_EVENT_LENGTH_MASK (3<<2) /**< mask for event length bits */
Chris@0 287
Chris@1429 288 #define SND_SEQ_PRIORITY_NORMAL (0<<4) /**< normal priority */
Chris@1429 289 #define SND_SEQ_PRIORITY_HIGH (1<<4) /**< event should be processed before others */
Chris@1429 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@1429 295 unsigned char channel; /**< channel number */
Chris@1429 296 unsigned char note; /**< note */
Chris@1429 297 unsigned char velocity; /**< velocity */
Chris@1429 298 unsigned char off_velocity; /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
Chris@1429 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@1429 304 unsigned char channel; /**< channel number */
Chris@1429 305 unsigned char unused[3]; /**< reserved */
Chris@1429 306 unsigned int param; /**< control parameter */
Chris@1429 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@1429 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@1429 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@1429 322 unsigned int len; /**< length of data */
Chris@1429 323 void *ptr; /**< pointer to data (note: can be 64-bit) */
Chris@1218 324 }
Chris@1218 325 #ifdef __GNUC__
Chris@1218 326 __attribute__((packed))
Chris@1218 327 #endif
Chris@1218 328 snd_seq_ev_ext_t;
Chris@0 329
Chris@0 330 /** Instrument cluster type */
Chris@0 331 typedef unsigned int snd_seq_instr_cluster_t;
Chris@0 332
Chris@0 333 /** Instrument type */
Chris@0 334 typedef struct snd_seq_instr {
Chris@1429 335 snd_seq_instr_cluster_t cluster; /**< cluster id */
Chris@1429 336 unsigned int std; /**< instrument standard id; the upper byte means a private instrument (owner - client id) */
Chris@1429 337 unsigned short bank; /**< instrument bank id */
Chris@1429 338 unsigned short prg; /**< instrument program id */
Chris@0 339 } snd_seq_instr_t;
Chris@0 340
Chris@0 341 /** sample number */
Chris@0 342 typedef struct snd_seq_ev_sample {
Chris@1429 343 unsigned int std; /**< sample standard id */
Chris@1429 344 unsigned short bank; /**< sample bank id */
Chris@1429 345 unsigned short prg; /**< sample program id */
Chris@0 346 } snd_seq_ev_sample_t;
Chris@0 347
Chris@0 348 /** sample cluster */
Chris@0 349 typedef struct snd_seq_ev_cluster {
Chris@1429 350 snd_seq_instr_cluster_t cluster; /**< cluster id */
Chris@0 351 } snd_seq_ev_cluster_t;
Chris@0 352
Chris@0 353 /** sample position */
Chris@0 354 typedef unsigned int snd_seq_position_t; /**< playback position (in samples) * 16 */
Chris@0 355
Chris@0 356 /** sample stop mode */
Chris@0 357 typedef enum snd_seq_stop_mode {
Chris@1429 358 SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0, /**< terminate playing immediately */
Chris@1429 359 SND_SEQ_SAMPLE_STOP_VENVELOPE = 1, /**< finish volume envelope */
Chris@1429 360 SND_SEQ_SAMPLE_STOP_LOOP = 2 /**< terminate loop and finish wave */
Chris@0 361 } snd_seq_stop_mode_t;
Chris@0 362
Chris@0 363 /** sample frequency */
Chris@0 364 typedef int snd_seq_frequency_t; /**< playback frequency in HZ * 16 */
Chris@0 365
Chris@0 366 /** sample volume control; if any value is set to -1 == do not change */
Chris@0 367 typedef struct snd_seq_ev_volume {
Chris@1429 368 signed short volume; /**< range: 0-16383 */
Chris@1429 369 signed short lr; /**< left-right balance; range: 0-16383 */
Chris@1429 370 signed short fr; /**< front-rear balance; range: 0-16383 */
Chris@1429 371 signed short du; /**< down-up balance; range: 0-16383 */
Chris@0 372 } snd_seq_ev_volume_t;
Chris@0 373
Chris@0 374 /** simple loop redefinition */
Chris@0 375 typedef struct snd_seq_ev_loop {
Chris@1429 376 unsigned int start; /**< loop start (in samples) * 16 */
Chris@1429 377 unsigned int end; /**< loop end (in samples) * 16 */
Chris@0 378 } snd_seq_ev_loop_t;
Chris@0 379
Chris@0 380 /** Sample control events */
Chris@0 381 typedef struct snd_seq_ev_sample_control {
Chris@1429 382 unsigned char channel; /**< channel */
Chris@1429 383 unsigned char unused[3]; /**< reserved */
Chris@1429 384 union {
Chris@1429 385 snd_seq_ev_sample_t sample; /**< sample number */
Chris@1429 386 snd_seq_ev_cluster_t cluster; /**< cluster number */
Chris@1429 387 snd_seq_position_t position; /**< position */
Chris@1429 388 snd_seq_stop_mode_t stop_mode; /**< stop mode */
Chris@1429 389 snd_seq_frequency_t frequency; /**< frequency */
Chris@1429 390 snd_seq_ev_volume_t volume; /**< volume */
Chris@1429 391 snd_seq_ev_loop_t loop; /**< loop control */
Chris@1429 392 unsigned char raw8[8]; /**< raw 8-bit */
Chris@1429 393 } param; /**< control parameters */
Chris@0 394 } snd_seq_ev_sample_control_t;
Chris@0 395
Chris@0 396
Chris@0 397
Chris@0 398 /** INSTR_BEGIN event */
Chris@0 399 typedef struct snd_seq_ev_instr_begin {
Chris@1429 400 int timeout; /**< zero = forever, otherwise timeout in ms */
Chris@0 401 } snd_seq_ev_instr_begin_t;
Chris@0 402
Chris@0 403 /** Result events */
Chris@0 404 typedef struct snd_seq_result {
Chris@1429 405 int event; /**< processed event type */
Chris@1429 406 int result; /**< status */
Chris@0 407 } snd_seq_result_t;
Chris@0 408
Chris@0 409 /** Queue skew values */
Chris@0 410 typedef struct snd_seq_queue_skew {
Chris@1429 411 unsigned int value; /**< skew value */
Chris@1429 412 unsigned int base; /**< skew base */
Chris@0 413 } snd_seq_queue_skew_t;
Chris@0 414
Chris@0 415 /** queue timer control */
Chris@0 416 typedef struct snd_seq_ev_queue_control {
Chris@1429 417 unsigned char queue; /**< affected queue */
Chris@1429 418 unsigned char unused[3]; /**< reserved */
Chris@1429 419 union {
Chris@1429 420 signed int value; /**< affected value (e.g. tempo) */
Chris@1429 421 snd_seq_timestamp_t time; /**< time */
Chris@1429 422 unsigned int position; /**< sync position */
Chris@1429 423 snd_seq_queue_skew_t skew; /**< queue skew */
Chris@1429 424 unsigned int d32[2]; /**< any data */
Chris@1429 425 unsigned char d8[8]; /**< any data */
Chris@1429 426 } param; /**< data value union */
Chris@0 427 } snd_seq_ev_queue_control_t;
Chris@0 428
Chris@0 429
Chris@0 430 /** Sequencer event */
Chris@0 431 typedef struct snd_seq_event {
Chris@1429 432 snd_seq_event_type_t type; /**< event type */
Chris@1429 433 unsigned char flags; /**< event flags */
Chris@1429 434 unsigned char tag; /**< tag */
Chris@1429 435
Chris@1429 436 unsigned char queue; /**< schedule queue */
Chris@1429 437 snd_seq_timestamp_t time; /**< schedule time */
Chris@0 438
Chris@1429 439 snd_seq_addr_t source; /**< source address */
Chris@1429 440 snd_seq_addr_t dest; /**< destination address */
Chris@0 441
Chris@1429 442 union {
Chris@1429 443 snd_seq_ev_note_t note; /**< note information */
Chris@1429 444 snd_seq_ev_ctrl_t control; /**< MIDI control information */
Chris@1429 445 snd_seq_ev_raw8_t raw8; /**< raw8 data */
Chris@1429 446 snd_seq_ev_raw32_t raw32; /**< raw32 data */
Chris@1429 447 snd_seq_ev_ext_t ext; /**< external data */
Chris@1429 448 snd_seq_ev_queue_control_t queue; /**< queue control */
Chris@1429 449 snd_seq_timestamp_t time; /**< timestamp */
Chris@1429 450 snd_seq_addr_t addr; /**< address */
Chris@1429 451 snd_seq_connect_t connect; /**< connect information */
Chris@1429 452 snd_seq_result_t result; /**< operation result code */
Chris@1429 453 snd_seq_ev_instr_begin_t instr_begin; /**< instrument */
Chris@1429 454 snd_seq_ev_sample_control_t sample; /**< sample control */
Chris@1429 455 } data; /**< event data... */
Chris@0 456 } snd_seq_event_t;
Chris@0 457
Chris@0 458
Chris@0 459 /** \} */
Chris@0 460
Chris@0 461 #endif /* __ALSA_SEQ_EVENT_H */
Chris@0 462