Chris@0: /* DSSI ALSA compatibility library
Chris@0:  *
Chris@0:  * This library provides for Mac OS X the ALSA snd_seq_event_t handling
Chris@0:  * necessary to compile and run DSSI.  It was extracted from alsa-lib 1.0.8.
Chris@0:  */
Chris@0: 
Chris@0: /**
Chris@0:  * \file <alsa/seq_event.h>
Chris@0:  * \brief Application interface library for the ALSA driver
Chris@0:  * \author Jaroslav Kysela <perex@suse.cz>
Chris@0:  * \author Abramo Bagnara <abramo@alsa-project.org>
Chris@0:  * \author Takashi Iwai <tiwai@suse.de>
Chris@0:  * \date 1998-2001
Chris@0:  *
Chris@0:  * Application interface library for the ALSA driver
Chris@0:  *
Chris@0:  *
Chris@0:  *   This library is free software; you can redistribute it and/or modify
Chris@0:  *   it under the terms of the GNU Lesser General Public License as
Chris@0:  *   published by the Free Software Foundation; either version 2.1 of
Chris@0:  *   the License, or (at your option) any later version.
Chris@0:  *
Chris@0:  *   This program is distributed in the hope that it will be useful,
Chris@0:  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@0:  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Chris@0:  *   GNU Lesser General Public License for more details.
Chris@0:  *
Chris@0:  *   You should have received a copy of the GNU Lesser General Public
Chris@0:  *   License along with this library; if not, write to the Free Software
Chris@0:  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
Chris@0:  *
Chris@0:  */
Chris@0: 
Chris@0: #ifndef __ALSA_SEQ_EVENT_H
Chris@0: #define __ALSA_SEQ_EVENT_H
Chris@0: 
Chris@0: /**
Chris@0:  *  \defgroup SeqEvents Sequencer Event Definitions
Chris@0:  *  Sequencer Event Definitions
Chris@0:  *  \ingroup Sequencer
Chris@0:  *  \{
Chris@0:  */
Chris@0: 
Chris@0: /**
Chris@0:  * Sequencer event data type
Chris@0:  */
Chris@0: typedef unsigned char snd_seq_event_type_t;
Chris@0: 
Chris@0: /** Sequencer event type */
Chris@0: enum snd_seq_event_type {
Chris@1429:         /** system status; event data type = #snd_seq_result_t */
Chris@1429:         SND_SEQ_EVENT_SYSTEM = 0,
Chris@1429:         /** returned result status; event data type = #snd_seq_result_t */
Chris@1429:         SND_SEQ_EVENT_RESULT,
Chris@0: 
Chris@1429:         /** note on and off with duration; event data type = #snd_seq_ev_note_t */
Chris@1429:         SND_SEQ_EVENT_NOTE = 5,
Chris@1429:         /** note on; event data type = #snd_seq_ev_note_t */
Chris@1429:         SND_SEQ_EVENT_NOTEON,
Chris@1429:         /** note off; event data type = #snd_seq_ev_note_t */
Chris@1429:         SND_SEQ_EVENT_NOTEOFF,
Chris@1429:         /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
Chris@1429:         SND_SEQ_EVENT_KEYPRESS,
Chris@1429:         
Chris@1429:         /** controller; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_CONTROLLER = 10,
Chris@1429:         /** program change; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_PGMCHANGE,
Chris@1429:         /** channel pressure; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_CHANPRESS,
Chris@1429:         /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
Chris@1429:         SND_SEQ_EVENT_PITCHBEND,
Chris@1429:         /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_CONTROL14,
Chris@1429:         /** 14 bit NRPN;  event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_NONREGPARAM,
Chris@1429:         /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_REGPARAM,
Chris@0: 
Chris@1429:         /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_SONGPOS = 20,
Chris@1429:         /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_SONGSEL,
Chris@1429:         /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_QFRAME,
Chris@1429:         /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_TIMESIGN,
Chris@1429:         /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@1429:         SND_SEQ_EVENT_KEYSIGN,
Chris@1429:                 
Chris@1429:         /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_START = 30,
Chris@1429:         /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_CONTINUE,
Chris@1429:         /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_STOP,
Chris@1429:         /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_SETPOS_TICK,
Chris@1429:         /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_SETPOS_TIME,
Chris@1429:         /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_TEMPO,
Chris@1429:         /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_CLOCK,
Chris@1429:         /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_TICK,
Chris@1429:         /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_QUEUE_SKEW,
Chris@1429:         /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
Chris@1429:         SND_SEQ_EVENT_SYNC_POS,
Chris@0: 
Chris@1429:         /** Tune request; event data type = none */
Chris@1429:         SND_SEQ_EVENT_TUNE_REQUEST = 40,
Chris@1429:         /** Reset to power-on state; event data type = none */
Chris@1429:         SND_SEQ_EVENT_RESET,
Chris@1429:         /** Active sensing event; event data type = none */
Chris@1429:         SND_SEQ_EVENT_SENSING,
Chris@0: 
Chris@1429:         /** Echo-back event; event data type = any type */
Chris@1429:         SND_SEQ_EVENT_ECHO = 50,
Chris@1429:         /** OSS emulation raw event; event data type = any type */
Chris@1429:         SND_SEQ_EVENT_OSS,
Chris@0: 
Chris@1429:         /** New client has connected; event data type = #snd_seq_addr_t */
Chris@1429:         SND_SEQ_EVENT_CLIENT_START = 60,
Chris@1429:         /** Client has left the system; event data type = #snd_seq_addr_t */
Chris@1429:         SND_SEQ_EVENT_CLIENT_EXIT,
Chris@1429:         /** Client status/info has changed; event data type = #snd_seq_addr_t */
Chris@1429:         SND_SEQ_EVENT_CLIENT_CHANGE,
Chris@1429:         /** New port was created; event data type = #snd_seq_addr_t */
Chris@1429:         SND_SEQ_EVENT_PORT_START,
Chris@1429:         /** Port was deleted from system; event data type = #snd_seq_addr_t */
Chris@1429:         SND_SEQ_EVENT_PORT_EXIT,
Chris@1429:         /** Port status/info has changed; event data type = #snd_seq_addr_t */
Chris@1429:         SND_SEQ_EVENT_PORT_CHANGE,
Chris@0: 
Chris@1429:         /** Ports connected; event data type = #snd_seq_connect_t */
Chris@1429:         SND_SEQ_EVENT_PORT_SUBSCRIBED,
Chris@1429:         /** Ports disconnected; event data type = #snd_seq_connect_t */
Chris@1429:         SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
Chris@0: 
Chris@1429:         /** Sample select; event data type = #snd_seq_ev_sample_control_t */
Chris@1429:         SND_SEQ_EVENT_SAMPLE = 70,
Chris@1429:         /** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_CLUSTER,
Chris@1429:         /** voice start */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_START,
Chris@1429:         /** voice stop */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_STOP,
Chris@1429:         /** playback frequency */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_FREQ,
Chris@1429:         /** volume and balance */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_VOLUME,
Chris@1429:         /** sample loop */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_LOOP,
Chris@1429:         /** sample position */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_POSITION,
Chris@1429:         /** private (hardware dependent) event */
Chris@1429:         SND_SEQ_EVENT_SAMPLE_PRIVATE1,
Chris@0: 
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR0 = 90,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR1,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR2,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR3,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR4,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR5,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR6,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR7,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR8,
Chris@1429:         /** user-defined event; event data type = any (fixed size) */
Chris@1429:         SND_SEQ_EVENT_USR9,
Chris@0: 
Chris@1429:         /** begin of instrument management */
Chris@1429:         SND_SEQ_EVENT_INSTR_BEGIN = 100,
Chris@1429:         /** end of instrument management */
Chris@1429:         SND_SEQ_EVENT_INSTR_END,
Chris@1429:         /** query instrument interface info */
Chris@1429:         SND_SEQ_EVENT_INSTR_INFO,
Chris@1429:         /** result of instrument interface info */
Chris@1429:         SND_SEQ_EVENT_INSTR_INFO_RESULT,
Chris@1429:         /** query instrument format info */
Chris@1429:         SND_SEQ_EVENT_INSTR_FINFO,
Chris@1429:         /** result of instrument format info */
Chris@1429:         SND_SEQ_EVENT_INSTR_FINFO_RESULT,
Chris@1429:         /** reset instrument instrument memory */
Chris@1429:         SND_SEQ_EVENT_INSTR_RESET,
Chris@1429:         /** get instrument interface status */
Chris@1429:         SND_SEQ_EVENT_INSTR_STATUS,
Chris@1429:         /** result of instrument interface status */
Chris@1429:         SND_SEQ_EVENT_INSTR_STATUS_RESULT,
Chris@1429:         /** put an instrument to port */
Chris@1429:         SND_SEQ_EVENT_INSTR_PUT,
Chris@1429:         /** get an instrument from port */
Chris@1429:         SND_SEQ_EVENT_INSTR_GET,
Chris@1429:         /** result of instrument query */
Chris@1429:         SND_SEQ_EVENT_INSTR_GET_RESULT,
Chris@1429:         /** free instrument(s) */
Chris@1429:         SND_SEQ_EVENT_INSTR_FREE,
Chris@1429:         /** get instrument list */
Chris@1429:         SND_SEQ_EVENT_INSTR_LIST,
Chris@1429:         /** result of instrument list */
Chris@1429:         SND_SEQ_EVENT_INSTR_LIST_RESULT,
Chris@1429:         /** set cluster parameters */
Chris@1429:         SND_SEQ_EVENT_INSTR_CLUSTER,
Chris@1429:         /** get cluster parameters */
Chris@1429:         SND_SEQ_EVENT_INSTR_CLUSTER_GET,
Chris@1429:         /** result of cluster parameters */
Chris@1429:         SND_SEQ_EVENT_INSTR_CLUSTER_RESULT,
Chris@1429:         /** instrument change */
Chris@1429:         SND_SEQ_EVENT_INSTR_CHANGE,
Chris@0: 
Chris@1429:         /** system exclusive data (variable length);  event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_SYSEX = 130,
Chris@1429:         /** error event;  event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_BOUNCE,
Chris@1429:         /** reserved for user apps;  event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_USR_VAR0 = 135,
Chris@1429:         /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_USR_VAR1,
Chris@1429:         /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_USR_VAR2,
Chris@1429:         /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_USR_VAR3,
Chris@1429:         /** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@1429:         SND_SEQ_EVENT_USR_VAR4,
Chris@0: 
Chris@1429:         /** NOP; ignored in any case */
Chris@1429:         SND_SEQ_EVENT_NONE = 255
Chris@0: };
Chris@0: 
Chris@0: 
Chris@0: /** Sequencer event address */
Chris@0: typedef struct snd_seq_addr {
Chris@1429:         unsigned char client;        /**< Client id */
Chris@1429:         unsigned char port;        /**< Port id */
Chris@0: } snd_seq_addr_t;
Chris@0: 
Chris@0: /** Connection (subscription) between ports */
Chris@0: typedef struct snd_seq_connect {
Chris@1429:         snd_seq_addr_t sender;        /**< sender address */
Chris@1429:         snd_seq_addr_t dest;        /**< destination address */
Chris@0: } snd_seq_connect_t;
Chris@0: 
Chris@0: 
Chris@0: /** Real-time data record */
Chris@0: typedef struct snd_seq_real_time {
Chris@1429:         unsigned int tv_sec;                /**< seconds */
Chris@1429:         unsigned int tv_nsec;                /**< nanoseconds */
Chris@0: } snd_seq_real_time_t;
Chris@0: 
Chris@0: /** (MIDI) Tick-time data record */
Chris@0: typedef unsigned int snd_seq_tick_time_t;
Chris@0: 
Chris@0: /** unioned time stamp */
Chris@0: typedef union snd_seq_timestamp {
Chris@1429:         snd_seq_tick_time_t tick;        /**< tick-time */
Chris@1429:         struct snd_seq_real_time time;        /**< real-time */
Chris@0: } snd_seq_timestamp_t;
Chris@0: 
Chris@0: 
Chris@0: /**
Chris@0:  * Event mode flags
Chris@0:  *
Chris@0:  * NOTE: only 8 bits available!
Chris@0:  */
Chris@1429: #define SND_SEQ_TIME_STAMP_TICK                (0<<0)        /**< timestamp in clock ticks */
Chris@1429: #define SND_SEQ_TIME_STAMP_REAL                (1<<0)        /**< timestamp in real time */
Chris@1429: #define SND_SEQ_TIME_STAMP_MASK                (1<<0)        /**< mask for timestamp bits */
Chris@0: 
Chris@1429: #define SND_SEQ_TIME_MODE_ABS                (0<<1)        /**< absolute timestamp */
Chris@1429: #define SND_SEQ_TIME_MODE_REL                (1<<1)        /**< relative to current time */
Chris@1429: #define SND_SEQ_TIME_MODE_MASK                (1<<1)        /**< mask for time mode bits */
Chris@0: 
Chris@1429: #define SND_SEQ_EVENT_LENGTH_FIXED        (0<<2)        /**< fixed event size */
Chris@1429: #define SND_SEQ_EVENT_LENGTH_VARIABLE        (1<<2)        /**< variable event size */
Chris@1429: #define SND_SEQ_EVENT_LENGTH_VARUSR        (2<<2)        /**< variable event size - user memory space */
Chris@1429: #define SND_SEQ_EVENT_LENGTH_MASK        (3<<2)        /**< mask for event length bits */
Chris@0: 
Chris@1429: #define SND_SEQ_PRIORITY_NORMAL                (0<<4)        /**< normal priority */
Chris@1429: #define SND_SEQ_PRIORITY_HIGH                (1<<4)        /**< event should be processed before others */
Chris@1429: #define SND_SEQ_PRIORITY_MASK                (1<<4)        /**< mask for priority bits */
Chris@0: 
Chris@0: 
Chris@0: /** Note event */
Chris@0: typedef struct snd_seq_ev_note {
Chris@1429:         unsigned char channel;                /**< channel number */
Chris@1429:         unsigned char note;                /**< note */
Chris@1429:         unsigned char velocity;                /**< velocity */
Chris@1429:         unsigned char off_velocity;        /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
Chris@1429:         unsigned int duration;                /**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */
Chris@0: } snd_seq_ev_note_t;
Chris@0: 
Chris@0: /** Controller event */
Chris@0: typedef struct snd_seq_ev_ctrl {
Chris@1429:         unsigned char channel;                /**< channel number */
Chris@1429:         unsigned char unused[3];        /**< reserved */
Chris@1429:         unsigned int param;                /**< control parameter */
Chris@1429:         signed int value;                /**< control value */
Chris@0: } snd_seq_ev_ctrl_t;
Chris@0: 
Chris@0: /** generic set of bytes (12x8 bit) */
Chris@0: typedef struct snd_seq_ev_raw8 {
Chris@1429:         unsigned char d[12];                /**< 8 bit value */
Chris@0: } snd_seq_ev_raw8_t;
Chris@0: 
Chris@0: /** generic set of integers (3x32 bit) */
Chris@0: typedef struct snd_seq_ev_raw32 {
Chris@1429:         unsigned int d[3];                /**< 32 bit value */
Chris@0: } snd_seq_ev_raw32_t;
Chris@0: 
Chris@0: /** external stored data */
Chris@0: typedef struct snd_seq_ev_ext {
Chris@1429:         unsigned int len;                /**< length of data */
Chris@1429:         void *ptr;                        /**< pointer to data (note: can be 64-bit) */
Chris@1218: }
Chris@1218: #ifdef __GNUC__
Chris@1218: __attribute__((packed))
Chris@1218: #endif
Chris@1218: snd_seq_ev_ext_t;
Chris@0: 
Chris@0: /** Instrument cluster type */
Chris@0: typedef unsigned int snd_seq_instr_cluster_t;
Chris@0: 
Chris@0: /** Instrument type */
Chris@0: typedef struct snd_seq_instr {
Chris@1429:         snd_seq_instr_cluster_t cluster;        /**< cluster id */
Chris@1429:         unsigned int std;        /**< instrument standard id; the upper byte means a private instrument (owner - client id) */
Chris@1429:         unsigned short bank;        /**< instrument bank id */
Chris@1429:         unsigned short prg;        /**< instrument program id */
Chris@0: } snd_seq_instr_t;
Chris@0: 
Chris@0: /** sample number */
Chris@0: typedef struct snd_seq_ev_sample {
Chris@1429:         unsigned int std;        /**< sample standard id */
Chris@1429:         unsigned short bank;        /**< sample bank id */
Chris@1429:         unsigned short prg;        /**< sample program id */
Chris@0: } snd_seq_ev_sample_t;
Chris@0: 
Chris@0: /** sample cluster */
Chris@0: typedef struct snd_seq_ev_cluster {
Chris@1429:         snd_seq_instr_cluster_t cluster;        /**< cluster id */
Chris@0: } snd_seq_ev_cluster_t;
Chris@0: 
Chris@0: /** sample position */
Chris@0: typedef unsigned int snd_seq_position_t; /**< playback position (in samples) * 16 */
Chris@0: 
Chris@0: /** sample stop mode */
Chris@0: typedef enum snd_seq_stop_mode {
Chris@1429:         SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0,        /**< terminate playing immediately */
Chris@1429:         SND_SEQ_SAMPLE_STOP_VENVELOPE = 1,        /**< finish volume envelope */
Chris@1429:         SND_SEQ_SAMPLE_STOP_LOOP = 2                /**< terminate loop and finish wave */
Chris@0: } snd_seq_stop_mode_t;
Chris@0: 
Chris@0: /** sample frequency */
Chris@0: typedef int snd_seq_frequency_t; /**< playback frequency in HZ * 16 */
Chris@0: 
Chris@0: /** sample volume control; if any value is set to -1 == do not change */
Chris@0: typedef struct snd_seq_ev_volume {
Chris@1429:         signed short volume;        /**< range: 0-16383 */
Chris@1429:         signed short lr;        /**< left-right balance; range: 0-16383 */
Chris@1429:         signed short fr;        /**< front-rear balance; range: 0-16383 */
Chris@1429:         signed short du;        /**< down-up balance; range: 0-16383 */
Chris@0: } snd_seq_ev_volume_t;
Chris@0: 
Chris@0: /** simple loop redefinition */
Chris@0: typedef struct snd_seq_ev_loop {
Chris@1429:         unsigned int start;        /**< loop start (in samples) * 16 */
Chris@1429:         unsigned int end;        /**< loop end (in samples) * 16 */
Chris@0: } snd_seq_ev_loop_t;
Chris@0: 
Chris@0: /** Sample control events */
Chris@0: typedef struct snd_seq_ev_sample_control {
Chris@1429:         unsigned char channel;                /**< channel */
Chris@1429:         unsigned char unused[3];        /**< reserved */
Chris@1429:         union {
Chris@1429:                 snd_seq_ev_sample_t sample;        /**< sample number */
Chris@1429:                 snd_seq_ev_cluster_t cluster;        /**< cluster number */
Chris@1429:                 snd_seq_position_t position;        /**< position */
Chris@1429:                 snd_seq_stop_mode_t stop_mode;        /**< stop mode */
Chris@1429:                 snd_seq_frequency_t frequency;        /**< frequency */
Chris@1429:                 snd_seq_ev_volume_t volume;        /**< volume */
Chris@1429:                 snd_seq_ev_loop_t loop;                /**< loop control */
Chris@1429:                 unsigned char raw8[8];                /**< raw 8-bit */
Chris@1429:         } param;                /**< control parameters */
Chris@0: } snd_seq_ev_sample_control_t;
Chris@0: 
Chris@0: 
Chris@0: 
Chris@0: /** INSTR_BEGIN event */
Chris@0: typedef struct snd_seq_ev_instr_begin {
Chris@1429:         int timeout;                /**< zero = forever, otherwise timeout in ms */
Chris@0: } snd_seq_ev_instr_begin_t;
Chris@0: 
Chris@0: /** Result events */
Chris@0: typedef struct snd_seq_result {
Chris@1429:         int event;                /**< processed event type */
Chris@1429:         int result;                /**< status */
Chris@0: } snd_seq_result_t;
Chris@0: 
Chris@0: /** Queue skew values */
Chris@0: typedef struct snd_seq_queue_skew {
Chris@1429:         unsigned int value;        /**< skew value */
Chris@1429:         unsigned int base;        /**< skew base */
Chris@0: } snd_seq_queue_skew_t;
Chris@0: 
Chris@0: /** queue timer control */
Chris@0: typedef struct snd_seq_ev_queue_control {
Chris@1429:         unsigned char queue;                        /**< affected queue */
Chris@1429:         unsigned char unused[3];                /**< reserved */
Chris@1429:         union {
Chris@1429:                 signed int value;                /**< affected value (e.g. tempo) */
Chris@1429:                 snd_seq_timestamp_t time;        /**< time */
Chris@1429:                 unsigned int position;                /**< sync position */
Chris@1429:                 snd_seq_queue_skew_t skew;        /**< queue skew */
Chris@1429:                 unsigned int d32[2];                /**< any data */
Chris@1429:                 unsigned char d8[8];                /**< any data */
Chris@1429:         } param;                                /**< data value union */
Chris@0: } snd_seq_ev_queue_control_t;
Chris@0: 
Chris@0: 
Chris@0: /** Sequencer event */
Chris@0: typedef struct snd_seq_event {
Chris@1429:         snd_seq_event_type_t type;        /**< event type */
Chris@1429:         unsigned char flags;                /**< event flags */
Chris@1429:         unsigned char tag;                /**< tag */
Chris@1429:         
Chris@1429:         unsigned char queue;                /**< schedule queue */
Chris@1429:         snd_seq_timestamp_t time;        /**< schedule time */
Chris@0: 
Chris@1429:         snd_seq_addr_t source;                /**< source address */
Chris@1429:         snd_seq_addr_t dest;                /**< destination address */
Chris@0: 
Chris@1429:         union {
Chris@1429:                 snd_seq_ev_note_t note;                /**< note information */
Chris@1429:                 snd_seq_ev_ctrl_t control;        /**< MIDI control information */
Chris@1429:                 snd_seq_ev_raw8_t raw8;                /**< raw8 data */
Chris@1429:                 snd_seq_ev_raw32_t raw32;        /**< raw32 data */
Chris@1429:                 snd_seq_ev_ext_t ext;                /**< external data */
Chris@1429:                 snd_seq_ev_queue_control_t queue; /**< queue control */
Chris@1429:                 snd_seq_timestamp_t time;        /**< timestamp */
Chris@1429:                 snd_seq_addr_t addr;                /**< address */
Chris@1429:                 snd_seq_connect_t connect;        /**< connect information */
Chris@1429:                 snd_seq_result_t result;        /**< operation result code */
Chris@1429:                 snd_seq_ev_instr_begin_t instr_begin; /**< instrument */
Chris@1429:                 snd_seq_ev_sample_control_t sample; /**< sample control */
Chris@1429:         } data;                                /**< event data... */
Chris@0: } snd_seq_event_t;
Chris@0: 
Chris@0: 
Chris@0: /** \} */
Chris@0: 
Chris@0: #endif /* __ALSA_SEQ_EVENT_H */
Chris@0: