1d5ac70f0Sopenharmony_ci/**
2d5ac70f0Sopenharmony_ci * \file include/seq_event.h
3d5ac70f0Sopenharmony_ci * \brief Application interface library for the ALSA driver
4d5ac70f0Sopenharmony_ci * \author Jaroslav Kysela <perex@perex.cz>
5d5ac70f0Sopenharmony_ci * \author Abramo Bagnara <abramo@alsa-project.org>
6d5ac70f0Sopenharmony_ci * \author Takashi Iwai <tiwai@suse.de>
7d5ac70f0Sopenharmony_ci * \date 1998-2001
8d5ac70f0Sopenharmony_ci *
9d5ac70f0Sopenharmony_ci * Application interface library for the ALSA driver
10d5ac70f0Sopenharmony_ci */
11d5ac70f0Sopenharmony_ci/*
12d5ac70f0Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
13d5ac70f0Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as
14d5ac70f0Sopenharmony_ci *   published by the Free Software Foundation; either version 2.1 of
15d5ac70f0Sopenharmony_ci *   the License, or (at your option) any later version.
16d5ac70f0Sopenharmony_ci *
17d5ac70f0Sopenharmony_ci *   This program is distributed in the hope that it will be useful,
18d5ac70f0Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
19d5ac70f0Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20d5ac70f0Sopenharmony_ci *   GNU Lesser General Public License for more details.
21d5ac70f0Sopenharmony_ci *
22d5ac70f0Sopenharmony_ci *   You should have received a copy of the GNU Lesser General Public
23d5ac70f0Sopenharmony_ci *   License along with this library; if not, write to the Free Software
24d5ac70f0Sopenharmony_ci *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
25d5ac70f0Sopenharmony_ci *
26d5ac70f0Sopenharmony_ci */
27d5ac70f0Sopenharmony_ci
28d5ac70f0Sopenharmony_ci#ifndef __ALSA_SEQ_EVENT_H
29d5ac70f0Sopenharmony_ci#define __ALSA_SEQ_EVENT_H
30d5ac70f0Sopenharmony_ci
31d5ac70f0Sopenharmony_ci/**
32d5ac70f0Sopenharmony_ci *  \defgroup SeqEvents Sequencer Event Definitions
33d5ac70f0Sopenharmony_ci *  Sequencer Event Definitions
34d5ac70f0Sopenharmony_ci *  \ingroup Sequencer
35d5ac70f0Sopenharmony_ci *  \{
36d5ac70f0Sopenharmony_ci */
37d5ac70f0Sopenharmony_ci
38d5ac70f0Sopenharmony_ci/**
39d5ac70f0Sopenharmony_ci * Sequencer event data type
40d5ac70f0Sopenharmony_ci */
41d5ac70f0Sopenharmony_citypedef unsigned char snd_seq_event_type_t;
42d5ac70f0Sopenharmony_ci
43d5ac70f0Sopenharmony_ci/** Sequencer event type */
44d5ac70f0Sopenharmony_cienum snd_seq_event_type {
45d5ac70f0Sopenharmony_ci	/** system status; event data type = #snd_seq_result_t */
46d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SYSTEM = 0,
47d5ac70f0Sopenharmony_ci	/** returned result status; event data type = #snd_seq_result_t */
48d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_RESULT,
49d5ac70f0Sopenharmony_ci
50d5ac70f0Sopenharmony_ci	/** note on and off with duration; event data type = #snd_seq_ev_note_t */
51d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_NOTE = 5,
52d5ac70f0Sopenharmony_ci	/** note on; event data type = #snd_seq_ev_note_t */
53d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_NOTEON,
54d5ac70f0Sopenharmony_ci	/** note off; event data type = #snd_seq_ev_note_t */
55d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_NOTEOFF,
56d5ac70f0Sopenharmony_ci	/** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
57d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_KEYPRESS,
58d5ac70f0Sopenharmony_ci
59d5ac70f0Sopenharmony_ci	/** controller; event data type = #snd_seq_ev_ctrl_t */
60d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CONTROLLER = 10,
61d5ac70f0Sopenharmony_ci	/** program change; event data type = #snd_seq_ev_ctrl_t */
62d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PGMCHANGE,
63d5ac70f0Sopenharmony_ci	/** channel pressure; event data type = #snd_seq_ev_ctrl_t */
64d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CHANPRESS,
65d5ac70f0Sopenharmony_ci	/** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
66d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PITCHBEND,
67d5ac70f0Sopenharmony_ci	/** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
68d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CONTROL14,
69d5ac70f0Sopenharmony_ci	/** 14 bit NRPN;  event data type = #snd_seq_ev_ctrl_t */
70d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_NONREGPARAM,
71d5ac70f0Sopenharmony_ci	/** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
72d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_REGPARAM,
73d5ac70f0Sopenharmony_ci
74d5ac70f0Sopenharmony_ci	/** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
75d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SONGPOS = 20,
76d5ac70f0Sopenharmony_ci	/** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
77d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SONGSEL,
78d5ac70f0Sopenharmony_ci	/** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
79d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_QFRAME,
80d5ac70f0Sopenharmony_ci	/** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
81d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_TIMESIGN,
82d5ac70f0Sopenharmony_ci	/** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
83d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_KEYSIGN,
84d5ac70f0Sopenharmony_ci
85d5ac70f0Sopenharmony_ci	/** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
86d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_START = 30,
87d5ac70f0Sopenharmony_ci	/** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
88d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CONTINUE,
89d5ac70f0Sopenharmony_ci	/** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
90d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_STOP,
91d5ac70f0Sopenharmony_ci	/** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
92d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SETPOS_TICK,
93d5ac70f0Sopenharmony_ci	/** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
94d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SETPOS_TIME,
95d5ac70f0Sopenharmony_ci	/** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
96d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_TEMPO,
97d5ac70f0Sopenharmony_ci	/** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
98d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CLOCK,
99d5ac70f0Sopenharmony_ci	/** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
100d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_TICK,
101d5ac70f0Sopenharmony_ci	/** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
102d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_QUEUE_SKEW,
103d5ac70f0Sopenharmony_ci	/** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
104d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SYNC_POS,
105d5ac70f0Sopenharmony_ci
106d5ac70f0Sopenharmony_ci	/** Tune request; event data type = none */
107d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_TUNE_REQUEST = 40,
108d5ac70f0Sopenharmony_ci	/** Reset to power-on state; event data type = none */
109d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_RESET,
110d5ac70f0Sopenharmony_ci	/** Active sensing event; event data type = none */
111d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SENSING,
112d5ac70f0Sopenharmony_ci
113d5ac70f0Sopenharmony_ci	/** Echo-back event; event data type = any type */
114d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_ECHO = 50,
115d5ac70f0Sopenharmony_ci	/** OSS emulation raw event; event data type = any type */
116d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_OSS,
117d5ac70f0Sopenharmony_ci
118d5ac70f0Sopenharmony_ci	/** New client has connected; event data type = #snd_seq_addr_t */
119d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CLIENT_START = 60,
120d5ac70f0Sopenharmony_ci	/** Client has left the system; event data type = #snd_seq_addr_t */
121d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CLIENT_EXIT,
122d5ac70f0Sopenharmony_ci	/** Client status/info has changed; event data type = #snd_seq_addr_t */
123d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_CLIENT_CHANGE,
124d5ac70f0Sopenharmony_ci	/** New port was created; event data type = #snd_seq_addr_t */
125d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PORT_START,
126d5ac70f0Sopenharmony_ci	/** Port was deleted from system; event data type = #snd_seq_addr_t */
127d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PORT_EXIT,
128d5ac70f0Sopenharmony_ci	/** Port status/info has changed; event data type = #snd_seq_addr_t */
129d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PORT_CHANGE,
130d5ac70f0Sopenharmony_ci
131d5ac70f0Sopenharmony_ci	/** Ports connected; event data type = #snd_seq_connect_t */
132d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PORT_SUBSCRIBED,
133d5ac70f0Sopenharmony_ci	/** Ports disconnected; event data type = #snd_seq_connect_t */
134d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
135d5ac70f0Sopenharmony_ci
136d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
137d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR0 = 90,
138d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
139d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR1,
140d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
141d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR2,
142d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
143d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR3,
144d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
145d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR4,
146d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
147d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR5,
148d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
149d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR6,
150d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
151d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR7,
152d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
153d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR8,
154d5ac70f0Sopenharmony_ci	/** user-defined event; event data type = any (fixed size) */
155d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR9,
156d5ac70f0Sopenharmony_ci
157d5ac70f0Sopenharmony_ci	/** system exclusive data (variable length);  event data type = #snd_seq_ev_ext_t */
158d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_SYSEX = 130,
159d5ac70f0Sopenharmony_ci	/** error event;  event data type = #snd_seq_ev_ext_t */
160d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_BOUNCE,
161d5ac70f0Sopenharmony_ci	/** reserved for user apps;  event data type = #snd_seq_ev_ext_t */
162d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR_VAR0 = 135,
163d5ac70f0Sopenharmony_ci	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
164d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR_VAR1,
165d5ac70f0Sopenharmony_ci	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
166d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR_VAR2,
167d5ac70f0Sopenharmony_ci	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
168d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR_VAR3,
169d5ac70f0Sopenharmony_ci	/** reserved for user apps; event data type = #snd_seq_ev_ext_t */
170d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_USR_VAR4,
171d5ac70f0Sopenharmony_ci
172d5ac70f0Sopenharmony_ci	/** NOP; ignored in any case */
173d5ac70f0Sopenharmony_ci	SND_SEQ_EVENT_NONE = 255
174d5ac70f0Sopenharmony_ci};
175d5ac70f0Sopenharmony_ci
176d5ac70f0Sopenharmony_ci
177d5ac70f0Sopenharmony_ci/** Sequencer event address */
178d5ac70f0Sopenharmony_citypedef struct snd_seq_addr {
179d5ac70f0Sopenharmony_ci	unsigned char client;	/**< Client id */
180d5ac70f0Sopenharmony_ci	unsigned char port;	/**< Port id */
181d5ac70f0Sopenharmony_ci} snd_seq_addr_t;
182d5ac70f0Sopenharmony_ci
183d5ac70f0Sopenharmony_ci/** Connection (subscription) between ports */
184d5ac70f0Sopenharmony_citypedef struct snd_seq_connect {
185d5ac70f0Sopenharmony_ci	snd_seq_addr_t sender;	/**< sender address */
186d5ac70f0Sopenharmony_ci	snd_seq_addr_t dest;	/**< destination address */
187d5ac70f0Sopenharmony_ci} snd_seq_connect_t;
188d5ac70f0Sopenharmony_ci
189d5ac70f0Sopenharmony_ci
190d5ac70f0Sopenharmony_ci/** Real-time data record */
191d5ac70f0Sopenharmony_citypedef struct snd_seq_real_time {
192d5ac70f0Sopenharmony_ci	unsigned int tv_sec;		/**< seconds */
193d5ac70f0Sopenharmony_ci	unsigned int tv_nsec;		/**< nanoseconds */
194d5ac70f0Sopenharmony_ci} snd_seq_real_time_t;
195d5ac70f0Sopenharmony_ci
196d5ac70f0Sopenharmony_ci/** (MIDI) Tick-time data record */
197d5ac70f0Sopenharmony_citypedef unsigned int snd_seq_tick_time_t;
198d5ac70f0Sopenharmony_ci
199d5ac70f0Sopenharmony_ci/** unioned time stamp */
200d5ac70f0Sopenharmony_citypedef union snd_seq_timestamp {
201d5ac70f0Sopenharmony_ci	snd_seq_tick_time_t tick;	/**< tick-time */
202d5ac70f0Sopenharmony_ci	struct snd_seq_real_time time;	/**< real-time */
203d5ac70f0Sopenharmony_ci} snd_seq_timestamp_t;
204d5ac70f0Sopenharmony_ci
205d5ac70f0Sopenharmony_ci
206d5ac70f0Sopenharmony_ci/**
207d5ac70f0Sopenharmony_ci * Event mode flags
208d5ac70f0Sopenharmony_ci *
209d5ac70f0Sopenharmony_ci * NOTE: only 8 bits available!
210d5ac70f0Sopenharmony_ci */
211d5ac70f0Sopenharmony_ci#define SND_SEQ_TIME_STAMP_TICK		(0<<0)	/**< timestamp in clock ticks */
212d5ac70f0Sopenharmony_ci#define SND_SEQ_TIME_STAMP_REAL		(1<<0)	/**< timestamp in real time */
213d5ac70f0Sopenharmony_ci#define SND_SEQ_TIME_STAMP_MASK		(1<<0)	/**< mask for timestamp bits */
214d5ac70f0Sopenharmony_ci
215d5ac70f0Sopenharmony_ci#define SND_SEQ_TIME_MODE_ABS		(0<<1)	/**< absolute timestamp */
216d5ac70f0Sopenharmony_ci#define SND_SEQ_TIME_MODE_REL		(1<<1)	/**< relative to current time */
217d5ac70f0Sopenharmony_ci#define SND_SEQ_TIME_MODE_MASK		(1<<1)	/**< mask for time mode bits */
218d5ac70f0Sopenharmony_ci
219d5ac70f0Sopenharmony_ci#define SND_SEQ_EVENT_LENGTH_FIXED	(0<<2)	/**< fixed event size */
220d5ac70f0Sopenharmony_ci#define SND_SEQ_EVENT_LENGTH_VARIABLE	(1<<2)	/**< variable event size */
221d5ac70f0Sopenharmony_ci#define SND_SEQ_EVENT_LENGTH_VARUSR	(2<<2)	/**< variable event size - user memory space */
222d5ac70f0Sopenharmony_ci#define SND_SEQ_EVENT_LENGTH_MASK	(3<<2)	/**< mask for event length bits */
223d5ac70f0Sopenharmony_ci
224d5ac70f0Sopenharmony_ci#define SND_SEQ_PRIORITY_NORMAL		(0<<4)	/**< normal priority */
225d5ac70f0Sopenharmony_ci#define SND_SEQ_PRIORITY_HIGH		(1<<4)	/**< event should be processed before others */
226d5ac70f0Sopenharmony_ci#define SND_SEQ_PRIORITY_MASK		(1<<4)	/**< mask for priority bits */
227d5ac70f0Sopenharmony_ci
228d5ac70f0Sopenharmony_ci#define SND_SEQ_EVENT_UMP		(1<<5)	/**< UMP packet event */
229d5ac70f0Sopenharmony_ci
230d5ac70f0Sopenharmony_ci/** Note event */
231d5ac70f0Sopenharmony_citypedef struct snd_seq_ev_note {
232d5ac70f0Sopenharmony_ci	unsigned char channel;		/**< channel number */
233d5ac70f0Sopenharmony_ci	unsigned char note;		/**< note */
234d5ac70f0Sopenharmony_ci	unsigned char velocity;		/**< velocity */
235d5ac70f0Sopenharmony_ci	unsigned char off_velocity;	/**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
236d5ac70f0Sopenharmony_ci	unsigned int duration;		/**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */
237d5ac70f0Sopenharmony_ci} snd_seq_ev_note_t;
238d5ac70f0Sopenharmony_ci
239d5ac70f0Sopenharmony_ci/** Controller event */
240d5ac70f0Sopenharmony_citypedef struct snd_seq_ev_ctrl {
241d5ac70f0Sopenharmony_ci	unsigned char channel;		/**< channel number */
242d5ac70f0Sopenharmony_ci	unsigned char unused[3];	/**< reserved */
243d5ac70f0Sopenharmony_ci	unsigned int param;		/**< control parameter */
244d5ac70f0Sopenharmony_ci	signed int value;		/**< control value */
245d5ac70f0Sopenharmony_ci} snd_seq_ev_ctrl_t;
246d5ac70f0Sopenharmony_ci
247d5ac70f0Sopenharmony_ci/** generic set of bytes (12x8 bit) */
248d5ac70f0Sopenharmony_citypedef struct snd_seq_ev_raw8 {
249d5ac70f0Sopenharmony_ci	unsigned char d[12];		/**< 8 bit value */
250d5ac70f0Sopenharmony_ci} snd_seq_ev_raw8_t;
251d5ac70f0Sopenharmony_ci
252d5ac70f0Sopenharmony_ci/** generic set of integers (3x32 bit) */
253d5ac70f0Sopenharmony_citypedef struct snd_seq_ev_raw32 {
254d5ac70f0Sopenharmony_ci	unsigned int d[3];		/**< 32 bit value */
255d5ac70f0Sopenharmony_ci} snd_seq_ev_raw32_t;
256d5ac70f0Sopenharmony_ci
257d5ac70f0Sopenharmony_ci/** external stored data */
258d5ac70f0Sopenharmony_cistruct snd_seq_ev_ext {
259d5ac70f0Sopenharmony_ci	unsigned int len;		/**< length of data */
260d5ac70f0Sopenharmony_ci	void *ptr;			/**< pointer to data (note: can be 64-bit) */
261d5ac70f0Sopenharmony_ci} __attribute__((packed));
262d5ac70f0Sopenharmony_ci/** external stored data */
263d5ac70f0Sopenharmony_citypedef struct snd_seq_ev_ext snd_seq_ev_ext_t;
264d5ac70f0Sopenharmony_ci#ifdef DOC_HIDDEN
265d5ac70f0Sopenharmony_ci/* redefine typedef for stupid doxygen */
266d5ac70f0Sopenharmony_citypedef snd_seq_ev_ext snd_seq_ev_ext_t;
267d5ac70f0Sopenharmony_ci#endif
268d5ac70f0Sopenharmony_ci
269d5ac70f0Sopenharmony_ci/** Result events */
270d5ac70f0Sopenharmony_citypedef struct snd_seq_result {
271d5ac70f0Sopenharmony_ci	int event;		/**< processed event type */
272d5ac70f0Sopenharmony_ci	int result;		/**< status */
273d5ac70f0Sopenharmony_ci} snd_seq_result_t;
274d5ac70f0Sopenharmony_ci
275d5ac70f0Sopenharmony_ci/** Queue skew values */
276d5ac70f0Sopenharmony_citypedef struct snd_seq_queue_skew {
277d5ac70f0Sopenharmony_ci	unsigned int value;	/**< skew value */
278d5ac70f0Sopenharmony_ci	unsigned int base;	/**< skew base */
279d5ac70f0Sopenharmony_ci} snd_seq_queue_skew_t;
280d5ac70f0Sopenharmony_ci
281d5ac70f0Sopenharmony_ci/** queue timer control */
282d5ac70f0Sopenharmony_citypedef struct snd_seq_ev_queue_control {
283d5ac70f0Sopenharmony_ci	unsigned char queue;			/**< affected queue */
284d5ac70f0Sopenharmony_ci	unsigned char unused[3];		/**< reserved */
285d5ac70f0Sopenharmony_ci	union {
286d5ac70f0Sopenharmony_ci		signed int value;		/**< affected value (e.g. tempo) */
287d5ac70f0Sopenharmony_ci		snd_seq_timestamp_t time;	/**< time */
288d5ac70f0Sopenharmony_ci		unsigned int position;		/**< sync position */
289d5ac70f0Sopenharmony_ci		snd_seq_queue_skew_t skew;	/**< queue skew */
290d5ac70f0Sopenharmony_ci		unsigned int d32[2];		/**< any data */
291d5ac70f0Sopenharmony_ci		unsigned char d8[8];		/**< any data */
292d5ac70f0Sopenharmony_ci	} param;				/**< data value union */
293d5ac70f0Sopenharmony_ci} snd_seq_ev_queue_control_t;
294d5ac70f0Sopenharmony_ci
295d5ac70f0Sopenharmony_ci/** Sequencer event data */
296d5ac70f0Sopenharmony_citypedef union snd_seq_event_data {
297d5ac70f0Sopenharmony_ci	snd_seq_ev_note_t note;		/**< note information */
298d5ac70f0Sopenharmony_ci	snd_seq_ev_ctrl_t control;	/**< MIDI control information */
299d5ac70f0Sopenharmony_ci	snd_seq_ev_raw8_t raw8;		/**< raw8 data */
300d5ac70f0Sopenharmony_ci	snd_seq_ev_raw32_t raw32;	/**< raw32 data */
301d5ac70f0Sopenharmony_ci	snd_seq_ev_ext_t ext;		/**< external data */
302d5ac70f0Sopenharmony_ci	snd_seq_ev_queue_control_t queue; /**< queue control */
303d5ac70f0Sopenharmony_ci	snd_seq_timestamp_t time;	/**< timestamp */
304d5ac70f0Sopenharmony_ci	snd_seq_addr_t addr;		/**< address */
305d5ac70f0Sopenharmony_ci	snd_seq_connect_t connect;	/**< connect information */
306d5ac70f0Sopenharmony_ci	snd_seq_result_t result;	/**< operation result code */
307d5ac70f0Sopenharmony_ci} snd_seq_event_data_t;
308d5ac70f0Sopenharmony_ci
309d5ac70f0Sopenharmony_ci/** Sequencer event */
310d5ac70f0Sopenharmony_citypedef struct snd_seq_event {
311d5ac70f0Sopenharmony_ci	snd_seq_event_type_t type;	/**< event type */
312d5ac70f0Sopenharmony_ci	unsigned char flags;		/**< event flags */
313d5ac70f0Sopenharmony_ci	unsigned char tag;		/**< tag */
314d5ac70f0Sopenharmony_ci
315d5ac70f0Sopenharmony_ci	unsigned char queue;		/**< schedule queue */
316d5ac70f0Sopenharmony_ci	snd_seq_timestamp_t time;	/**< schedule time */
317d5ac70f0Sopenharmony_ci
318d5ac70f0Sopenharmony_ci	snd_seq_addr_t source;		/**< source address */
319d5ac70f0Sopenharmony_ci	snd_seq_addr_t dest;		/**< destination address */
320d5ac70f0Sopenharmony_ci
321d5ac70f0Sopenharmony_ci	snd_seq_event_data_t data;	/**< event data... */
322d5ac70f0Sopenharmony_ci} snd_seq_event_t;
323d5ac70f0Sopenharmony_ci
324d5ac70f0Sopenharmony_ci/** UMP sequencer event; compatible with legacy sequencer event */
325d5ac70f0Sopenharmony_citypedef struct snd_seq_ump_event {
326d5ac70f0Sopenharmony_ci	snd_seq_event_type_t type;	/**< event type */
327d5ac70f0Sopenharmony_ci	unsigned char flags;		/**< event flags */
328d5ac70f0Sopenharmony_ci	unsigned char tag;		/**< tag */
329d5ac70f0Sopenharmony_ci	unsigned char queue;		/**< schedule queue */
330d5ac70f0Sopenharmony_ci	snd_seq_timestamp_t time;	/**< schedule time */
331d5ac70f0Sopenharmony_ci	snd_seq_addr_t source;		/**< source address */
332d5ac70f0Sopenharmony_ci	snd_seq_addr_t dest;		/**< destination address */
333d5ac70f0Sopenharmony_ci
334d5ac70f0Sopenharmony_ci	union {
335d5ac70f0Sopenharmony_ci		snd_seq_event_data_t data;	/**< (shared) legacy data */
336d5ac70f0Sopenharmony_ci		unsigned int ump[4];		/**< UMP data bytes */
337d5ac70f0Sopenharmony_ci	};
338d5ac70f0Sopenharmony_ci} snd_seq_ump_event_t;
339d5ac70f0Sopenharmony_ci
340d5ac70f0Sopenharmony_ci/** \} */
341d5ac70f0Sopenharmony_ci
342d5ac70f0Sopenharmony_ci#endif /* __ALSA_SEQ_EVENT_H */
343d5ac70f0Sopenharmony_ci
344