2 * This library is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU Lesser General Public License as
4 * published by the Free Software Foundation; either version 2.1 of
5 * the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef __ALSA_SEQ_EVENT_COMPAT_H
19 #define __ALSA_SEQ_EVENT_COMPAT_H
22 * Sequencer event data type
24 typedef unsigned char snd_seq_event_type_t
;
26 /** Sequencer event type */
27 enum snd_seq_event_type
{
28 /** system status; event data type = #snd_seq_result_t */
29 SND_SEQ_EVENT_SYSTEM
= 0,
30 /** returned result status; event data type = #snd_seq_result_t */
33 /** note on and off with duration; event data type = #snd_seq_ev_note_t */
34 SND_SEQ_EVENT_NOTE
= 5,
35 /** note on; event data type = #snd_seq_ev_note_t */
37 /** note off; event data type = #snd_seq_ev_note_t */
38 SND_SEQ_EVENT_NOTEOFF
,
39 /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
40 SND_SEQ_EVENT_KEYPRESS
,
42 /** controller; event data type = #snd_seq_ev_ctrl_t */
43 SND_SEQ_EVENT_CONTROLLER
= 10,
44 /** program change; event data type = #snd_seq_ev_ctrl_t */
45 SND_SEQ_EVENT_PGMCHANGE
,
46 /** channel pressure; event data type = #snd_seq_ev_ctrl_t */
47 SND_SEQ_EVENT_CHANPRESS
,
48 /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
49 SND_SEQ_EVENT_PITCHBEND
,
50 /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
51 SND_SEQ_EVENT_CONTROL14
,
52 /** 14 bit NRPN; event data type = #snd_seq_ev_ctrl_t */
53 SND_SEQ_EVENT_NONREGPARAM
,
54 /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
55 SND_SEQ_EVENT_REGPARAM
,
57 /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
58 SND_SEQ_EVENT_SONGPOS
= 20,
59 /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
60 SND_SEQ_EVENT_SONGSEL
,
61 /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
63 /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
64 SND_SEQ_EVENT_TIMESIGN
,
65 /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
66 SND_SEQ_EVENT_KEYSIGN
,
68 /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
69 SND_SEQ_EVENT_START
= 30,
70 /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
71 SND_SEQ_EVENT_CONTINUE
,
72 /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
74 /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
75 SND_SEQ_EVENT_SETPOS_TICK
,
76 /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
77 SND_SEQ_EVENT_SETPOS_TIME
,
78 /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
80 /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
82 /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
84 /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
85 SND_SEQ_EVENT_QUEUE_SKEW
,
86 /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
87 SND_SEQ_EVENT_SYNC_POS
,
89 /** Tune request; event data type = none */
90 SND_SEQ_EVENT_TUNE_REQUEST
= 40,
91 /** Reset to power-on state; event data type = none */
93 /** Active sensing event; event data type = none */
94 SND_SEQ_EVENT_SENSING
,
96 /** Echo-back event; event data type = any type */
97 SND_SEQ_EVENT_ECHO
= 50,
98 /** OSS emulation raw event; event data type = any type */
101 /** New client has connected; event data type = #snd_seq_addr_t */
102 SND_SEQ_EVENT_CLIENT_START
= 60,
103 /** Client has left the system; event data type = #snd_seq_addr_t */
104 SND_SEQ_EVENT_CLIENT_EXIT
,
105 /** Client status/info has changed; event data type = #snd_seq_addr_t */
106 SND_SEQ_EVENT_CLIENT_CHANGE
,
107 /** New port was created; event data type = #snd_seq_addr_t */
108 SND_SEQ_EVENT_PORT_START
,
109 /** Port was deleted from system; event data type = #snd_seq_addr_t */
110 SND_SEQ_EVENT_PORT_EXIT
,
111 /** Port status/info has changed; event data type = #snd_seq_addr_t */
112 SND_SEQ_EVENT_PORT_CHANGE
,
114 /** Ports connected; event data type = #snd_seq_connect_t */
115 SND_SEQ_EVENT_PORT_SUBSCRIBED
,
116 /** Ports disconnected; event data type = #snd_seq_connect_t */
117 SND_SEQ_EVENT_PORT_UNSUBSCRIBED
,
119 /** user-defined event; event data type = any (fixed size) */
120 SND_SEQ_EVENT_USR0
= 90,
121 /** user-defined event; event data type = any (fixed size) */
123 /** user-defined event; event data type = any (fixed size) */
125 /** user-defined event; event data type = any (fixed size) */
127 /** user-defined event; event data type = any (fixed size) */
129 /** user-defined event; event data type = any (fixed size) */
131 /** user-defined event; event data type = any (fixed size) */
133 /** user-defined event; event data type = any (fixed size) */
135 /** user-defined event; event data type = any (fixed size) */
137 /** user-defined event; event data type = any (fixed size) */
140 /** NOP; ignored in any case */
141 SND_SEQ_EVENT_NONE
= 255
144 /** Sequencer event address */
145 typedef struct snd_seq_addr
{
146 unsigned char client
; /**< Client id */
147 unsigned char port
; /**< Port id */
150 /** Connection (subscription) between ports */
151 typedef struct snd_seq_connect
{
152 snd_seq_addr_t sender
; /**< sender address */
153 snd_seq_addr_t dest
; /**< destination address */
156 /** Real-time data record */
157 typedef struct snd_seq_real_time
{
158 unsigned int tv_sec
; /**< seconds */
159 unsigned int tv_nsec
; /**< nanoseconds */
160 } snd_seq_real_time_t
;
162 /** (MIDI) Tick-time data record */
163 typedef unsigned int snd_seq_tick_time_t
;
165 /** unioned time stamp */
166 typedef union snd_seq_timestamp
{
167 snd_seq_tick_time_t tick
; /**< tick-time */
168 struct snd_seq_real_time time
; /**< real-time */
169 } snd_seq_timestamp_t
;
172 typedef struct snd_seq_ev_note
{
173 unsigned char channel
; /**< channel number */
174 unsigned char note
; /**< note */
175 unsigned char velocity
; /**< velocity */
176 unsigned char off_velocity
; /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
177 unsigned int duration
; /**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */
180 /** Controller event */
181 typedef struct snd_seq_ev_ctrl
{
182 unsigned char channel
; /**< channel number */
183 unsigned char unused
[3]; /**< reserved */
184 unsigned int param
; /**< control parameter */
185 signed int value
; /**< control value */
188 /** generic set of bytes (12x8 bit) */
189 typedef struct snd_seq_ev_raw8
{
190 unsigned char d
[12]; /**< 8 bit value */
193 /** generic set of integers (3x32 bit) */
194 typedef struct snd_seq_ev_raw32
{
195 unsigned int d
[3]; /**< 32 bit value */
196 } snd_seq_ev_raw32_t
;
199 typedef struct snd_seq_result
{
200 int event
; /**< processed event type */
201 int result
; /**< status */
204 /** Queue skew values */
205 typedef struct snd_seq_queue_skew
{
206 unsigned int value
; /**< skew value */
207 unsigned int base
; /**< skew base */
208 } snd_seq_queue_skew_t
;
210 /** queue timer control */
211 typedef struct snd_seq_ev_queue_control
{
212 unsigned char queue
; /**< affected queue */
213 unsigned char unused
[3]; /**< reserved */
215 signed int value
; /**< affected value (e.g. tempo) */
216 snd_seq_timestamp_t time
; /**< time */
217 unsigned int position
; /**< sync position */
218 snd_seq_queue_skew_t skew
; /**< queue skew */
219 unsigned int d32
[2]; /**< any data */
220 unsigned char d8
[8]; /**< any data */
221 } param
; /**< data value union */
222 } snd_seq_ev_queue_control_t
;
224 /** Sequencer event */
225 typedef struct snd_seq_event
{
226 snd_seq_event_type_t type
; /**< event type */
227 unsigned char flags
; /**< event flags */
228 unsigned char tag
; /**< tag */
230 unsigned char queue
; /**< schedule queue */
231 snd_seq_timestamp_t time
; /**< schedule time */
233 snd_seq_addr_t source
; /**< source address */
234 snd_seq_addr_t dest
; /**< destination address */
237 snd_seq_ev_note_t note
; /**< note information */
238 snd_seq_ev_ctrl_t control
; /**< MIDI control information */
239 snd_seq_ev_raw8_t raw8
; /**< raw8 data */
240 snd_seq_ev_raw32_t raw32
; /**< raw32 data */
241 snd_seq_ev_queue_control_t queue
; /**< queue control */
242 snd_seq_timestamp_t time
; /**< timestamp */
243 snd_seq_addr_t addr
; /**< address */
244 snd_seq_connect_t connect
; /**< connect information */
245 snd_seq_result_t result
; /**< operation result code */
246 } data
; /**< event data... */
249 #endif /* __ALSA_SEQ_EVENT_COMPAT_H */