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@0: 	/** system status; event data type = #snd_seq_result_t */
Chris@0: 	SND_SEQ_EVENT_SYSTEM = 0,
Chris@0: 	/** returned result status; event data type = #snd_seq_result_t */
Chris@0: 	SND_SEQ_EVENT_RESULT,
Chris@0: 
Chris@0: 	/** note on and off with duration; event data type = #snd_seq_ev_note_t */
Chris@0: 	SND_SEQ_EVENT_NOTE = 5,
Chris@0: 	/** note on; event data type = #snd_seq_ev_note_t */
Chris@0: 	SND_SEQ_EVENT_NOTEON,
Chris@0: 	/** note off; event data type = #snd_seq_ev_note_t */
Chris@0: 	SND_SEQ_EVENT_NOTEOFF,
Chris@0: 	/** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
Chris@0: 	SND_SEQ_EVENT_KEYPRESS,
Chris@0: 	
Chris@0: 	/** controller; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_CONTROLLER = 10,
Chris@0: 	/** program change; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_PGMCHANGE,
Chris@0: 	/** channel pressure; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_CHANPRESS,
Chris@0: 	/** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
Chris@0: 	SND_SEQ_EVENT_PITCHBEND,
Chris@0: 	/** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_CONTROL14,
Chris@0: 	/** 14 bit NRPN;  event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_NONREGPARAM,
Chris@0: 	/** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_REGPARAM,
Chris@0: 
Chris@0: 	/** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_SONGPOS = 20,
Chris@0: 	/** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_SONGSEL,
Chris@0: 	/** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_QFRAME,
Chris@0: 	/** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_TIMESIGN,
Chris@0: 	/** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
Chris@0: 	SND_SEQ_EVENT_KEYSIGN,
Chris@0: 	        
Chris@0: 	/** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_START = 30,
Chris@0: 	/** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_CONTINUE,
Chris@0: 	/** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_STOP,
Chris@0: 	/** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_SETPOS_TICK,
Chris@0: 	/** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_SETPOS_TIME,
Chris@0: 	/** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_TEMPO,
Chris@0: 	/** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_CLOCK,
Chris@0: 	/** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_TICK,
Chris@0: 	/** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_QUEUE_SKEW,
Chris@0: 	/** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
Chris@0: 	SND_SEQ_EVENT_SYNC_POS,
Chris@0: 
Chris@0: 	/** Tune request; event data type = none */
Chris@0: 	SND_SEQ_EVENT_TUNE_REQUEST = 40,
Chris@0: 	/** Reset to power-on state; event data type = none */
Chris@0: 	SND_SEQ_EVENT_RESET,
Chris@0: 	/** Active sensing event; event data type = none */
Chris@0: 	SND_SEQ_EVENT_SENSING,
Chris@0: 
Chris@0: 	/** Echo-back event; event data type = any type */
Chris@0: 	SND_SEQ_EVENT_ECHO = 50,
Chris@0: 	/** OSS emulation raw event; event data type = any type */
Chris@0: 	SND_SEQ_EVENT_OSS,
Chris@0: 
Chris@0: 	/** New client has connected; event data type = #snd_seq_addr_t */
Chris@0: 	SND_SEQ_EVENT_CLIENT_START = 60,
Chris@0: 	/** Client has left the system; event data type = #snd_seq_addr_t */
Chris@0: 	SND_SEQ_EVENT_CLIENT_EXIT,
Chris@0: 	/** Client status/info has changed; event data type = #snd_seq_addr_t */
Chris@0: 	SND_SEQ_EVENT_CLIENT_CHANGE,
Chris@0: 	/** New port was created; event data type = #snd_seq_addr_t */
Chris@0: 	SND_SEQ_EVENT_PORT_START,
Chris@0: 	/** Port was deleted from system; event data type = #snd_seq_addr_t */
Chris@0: 	SND_SEQ_EVENT_PORT_EXIT,
Chris@0: 	/** Port status/info has changed; event data type = #snd_seq_addr_t */
Chris@0: 	SND_SEQ_EVENT_PORT_CHANGE,
Chris@0: 
Chris@0: 	/** Ports connected; event data type = #snd_seq_connect_t */
Chris@0: 	SND_SEQ_EVENT_PORT_SUBSCRIBED,
Chris@0: 	/** Ports disconnected; event data type = #snd_seq_connect_t */
Chris@0: 	SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
Chris@0: 
Chris@0: 	/** Sample select; event data type = #snd_seq_ev_sample_control_t */
Chris@0: 	SND_SEQ_EVENT_SAMPLE = 70,
Chris@0: 	/** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_CLUSTER,
Chris@0: 	/** voice start */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_START,
Chris@0: 	/** voice stop */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_STOP,
Chris@0: 	/** playback frequency */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_FREQ,
Chris@0: 	/** volume and balance */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_VOLUME,
Chris@0: 	/** sample loop */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_LOOP,
Chris@0: 	/** sample position */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_POSITION,
Chris@0: 	/** private (hardware dependent) event */
Chris@0: 	SND_SEQ_EVENT_SAMPLE_PRIVATE1,
Chris@0: 
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR0 = 90,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR1,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR2,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR3,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR4,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR5,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR6,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR7,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR8,
Chris@0: 	/** user-defined event; event data type = any (fixed size) */
Chris@0: 	SND_SEQ_EVENT_USR9,
Chris@0: 
Chris@0: 	/** begin of instrument management */
Chris@0: 	SND_SEQ_EVENT_INSTR_BEGIN = 100,
Chris@0: 	/** end of instrument management */
Chris@0: 	SND_SEQ_EVENT_INSTR_END,
Chris@0: 	/** query instrument interface info */
Chris@0: 	SND_SEQ_EVENT_INSTR_INFO,
Chris@0: 	/** result of instrument interface info */
Chris@0: 	SND_SEQ_EVENT_INSTR_INFO_RESULT,
Chris@0: 	/** query instrument format info */
Chris@0: 	SND_SEQ_EVENT_INSTR_FINFO,
Chris@0: 	/** result of instrument format info */
Chris@0: 	SND_SEQ_EVENT_INSTR_FINFO_RESULT,
Chris@0: 	/** reset instrument instrument memory */
Chris@0: 	SND_SEQ_EVENT_INSTR_RESET,
Chris@0: 	/** get instrument interface status */
Chris@0: 	SND_SEQ_EVENT_INSTR_STATUS,
Chris@0: 	/** result of instrument interface status */
Chris@0: 	SND_SEQ_EVENT_INSTR_STATUS_RESULT,
Chris@0: 	/** put an instrument to port */
Chris@0: 	SND_SEQ_EVENT_INSTR_PUT,
Chris@0: 	/** get an instrument from port */
Chris@0: 	SND_SEQ_EVENT_INSTR_GET,
Chris@0: 	/** result of instrument query */
Chris@0: 	SND_SEQ_EVENT_INSTR_GET_RESULT,
Chris@0: 	/** free instrument(s) */
Chris@0: 	SND_SEQ_EVENT_INSTR_FREE,
Chris@0: 	/** get instrument list */
Chris@0: 	SND_SEQ_EVENT_INSTR_LIST,
Chris@0: 	/** result of instrument list */
Chris@0: 	SND_SEQ_EVENT_INSTR_LIST_RESULT,
Chris@0: 	/** set cluster parameters */
Chris@0: 	SND_SEQ_EVENT_INSTR_CLUSTER,
Chris@0: 	/** get cluster parameters */
Chris@0: 	SND_SEQ_EVENT_INSTR_CLUSTER_GET,
Chris@0: 	/** result of cluster parameters */
Chris@0: 	SND_SEQ_EVENT_INSTR_CLUSTER_RESULT,
Chris@0: 	/** instrument change */
Chris@0: 	SND_SEQ_EVENT_INSTR_CHANGE,
Chris@0: 
Chris@0: 	/** system exclusive data (variable length);  event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_SYSEX = 130,
Chris@0: 	/** error event;  event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_BOUNCE,
Chris@0: 	/** reserved for user apps;  event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_USR_VAR0 = 135,
Chris@0: 	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_USR_VAR1,
Chris@0: 	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_USR_VAR2,
Chris@0: 	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_USR_VAR3,
Chris@0: 	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
Chris@0: 	SND_SEQ_EVENT_USR_VAR4,
Chris@0: 
Chris@0: 	/** NOP; ignored in any case */
Chris@0: 	SND_SEQ_EVENT_NONE = 255
Chris@0: };
Chris@0: 
Chris@0: 
Chris@0: /** Sequencer event address */
Chris@0: typedef struct snd_seq_addr {
Chris@0: 	unsigned char client;	/**< Client id */
Chris@0: 	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@0: 	snd_seq_addr_t sender;	/**< sender address */
Chris@0: 	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@0: 	unsigned int tv_sec;		/**< seconds */
Chris@0: 	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@0: 	snd_seq_tick_time_t tick;	/**< tick-time */
Chris@0: 	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@0: #define SND_SEQ_TIME_STAMP_TICK		(0<<0)	/**< timestamp in clock ticks */
Chris@0: #define SND_SEQ_TIME_STAMP_REAL		(1<<0)	/**< timestamp in real time */
Chris@0: #define SND_SEQ_TIME_STAMP_MASK		(1<<0)	/**< mask for timestamp bits */
Chris@0: 
Chris@0: #define SND_SEQ_TIME_MODE_ABS		(0<<1)	/**< absolute timestamp */
Chris@0: #define SND_SEQ_TIME_MODE_REL		(1<<1)	/**< relative to current time */
Chris@0: #define SND_SEQ_TIME_MODE_MASK		(1<<1)	/**< mask for time mode bits */
Chris@0: 
Chris@0: #define SND_SEQ_EVENT_LENGTH_FIXED	(0<<2)	/**< fixed event size */
Chris@0: #define SND_SEQ_EVENT_LENGTH_VARIABLE	(1<<2)	/**< variable event size */
Chris@0: #define SND_SEQ_EVENT_LENGTH_VARUSR	(2<<2)	/**< variable event size - user memory space */
Chris@0: #define SND_SEQ_EVENT_LENGTH_MASK	(3<<2)	/**< mask for event length bits */
Chris@0: 
Chris@0: #define SND_SEQ_PRIORITY_NORMAL		(0<<4)	/**< normal priority */
Chris@0: #define SND_SEQ_PRIORITY_HIGH		(1<<4)	/**< event should be processed before others */
Chris@0: #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@0: 	unsigned char channel;		/**< channel number */
Chris@0: 	unsigned char note;		/**< note */
Chris@0: 	unsigned char velocity;		/**< velocity */
Chris@0: 	unsigned char off_velocity;	/**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
Chris@0: 	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@0: 	unsigned char channel;		/**< channel number */
Chris@0: 	unsigned char unused[3];	/**< reserved */
Chris@0: 	unsigned int param;		/**< control parameter */
Chris@0: 	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@0: 	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@0: 	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@0: 	unsigned int len;		/**< length of data */
Chris@0: 	void *ptr;			/**< pointer to data (note: can be 64-bit) */
Chris@0: } __attribute__((packed)) 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@0: 	snd_seq_instr_cluster_t cluster;	/**< cluster id */
Chris@0: 	unsigned int std;	/**< instrument standard id; the upper byte means a private instrument (owner - client id) */
Chris@0: 	unsigned short bank;	/**< instrument bank id */
Chris@0: 	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@0: 	unsigned int std;	/**< sample standard id */
Chris@0: 	unsigned short bank;	/**< sample bank id */
Chris@0: 	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@0: 	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@0: 	SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0,	/**< terminate playing immediately */
Chris@0: 	SND_SEQ_SAMPLE_STOP_VENVELOPE = 1,	/**< finish volume envelope */
Chris@0: 	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@0: 	signed short volume;	/**< range: 0-16383 */
Chris@0: 	signed short lr;	/**< left-right balance; range: 0-16383 */
Chris@0: 	signed short fr;	/**< front-rear balance; range: 0-16383 */
Chris@0: 	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@0: 	unsigned int start;	/**< loop start (in samples) * 16 */
Chris@0: 	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@0: 	unsigned char channel;		/**< channel */
Chris@0: 	unsigned char unused[3];	/**< reserved */
Chris@0: 	union {
Chris@0: 		snd_seq_ev_sample_t sample;	/**< sample number */
Chris@0: 		snd_seq_ev_cluster_t cluster;	/**< cluster number */
Chris@0: 		snd_seq_position_t position;	/**< position */
Chris@0: 		snd_seq_stop_mode_t stop_mode;	/**< stop mode */
Chris@0: 		snd_seq_frequency_t frequency;	/**< frequency */
Chris@0: 		snd_seq_ev_volume_t volume;	/**< volume */
Chris@0: 		snd_seq_ev_loop_t loop;		/**< loop control */
Chris@0: 		unsigned char raw8[8];		/**< raw 8-bit */
Chris@0: 	} 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@0: 	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@0: 	int event;		/**< processed event type */
Chris@0: 	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@0: 	unsigned int value;	/**< skew value */
Chris@0: 	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@0: 	unsigned char queue;			/**< affected queue */
Chris@0: 	unsigned char unused[3];		/**< reserved */
Chris@0: 	union {
Chris@0: 		signed int value;		/**< affected value (e.g. tempo) */
Chris@0: 		snd_seq_timestamp_t time;	/**< time */
Chris@0: 		unsigned int position;		/**< sync position */
Chris@0: 		snd_seq_queue_skew_t skew;	/**< queue skew */
Chris@0: 		unsigned int d32[2];		/**< any data */
Chris@0: 		unsigned char d8[8];		/**< any data */
Chris@0: 	} 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@0: 	snd_seq_event_type_t type;	/**< event type */
Chris@0: 	unsigned char flags;		/**< event flags */
Chris@0: 	unsigned char tag;		/**< tag */
Chris@0: 	
Chris@0: 	unsigned char queue;		/**< schedule queue */
Chris@0: 	snd_seq_timestamp_t time;	/**< schedule time */
Chris@0: 
Chris@0: 	snd_seq_addr_t source;		/**< source address */
Chris@0: 	snd_seq_addr_t dest;		/**< destination address */
Chris@0: 
Chris@0: 	union {
Chris@0: 		snd_seq_ev_note_t note;		/**< note information */
Chris@0: 		snd_seq_ev_ctrl_t control;	/**< MIDI control information */
Chris@0: 		snd_seq_ev_raw8_t raw8;		/**< raw8 data */
Chris@0: 		snd_seq_ev_raw32_t raw32;	/**< raw32 data */
Chris@0: 		snd_seq_ev_ext_t ext;		/**< external data */
Chris@0: 		snd_seq_ev_queue_control_t queue; /**< queue control */
Chris@0: 		snd_seq_timestamp_t time;	/**< timestamp */
Chris@0: 		snd_seq_addr_t addr;		/**< address */
Chris@0: 		snd_seq_connect_t connect;	/**< connect information */
Chris@0: 		snd_seq_result_t result;	/**< operation result code */
Chris@0: 		snd_seq_ev_instr_begin_t instr_begin; /**< instrument */
Chris@0: 		snd_seq_ev_sample_control_t sample; /**< sample control */
Chris@0: 	} 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: