ALSA project - the C library reference

Loading...
Searching...
No Matches
seq_event.h
Go to the documentation of this file.
1
11/*
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation; either version 2.1 of
15 * the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 */
27
28#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
29/* don't use ALSA_LIBRARY_BUILD define in sources outside alsa-lib */
30#warning "use #include <alsa/asoundlib.h>, <alsa/seq_event.h> should not be used directly"
31#include <alsa/asoundlib.h>
32#endif
33
34#ifndef __ALSA_SEQ_EVENT_H
35#define __ALSA_SEQ_EVENT_H
47 typedef unsigned char snd_seq_event_type_t;
48
50 enum snd_seq_event_type {
52 SND_SEQ_EVENT_SYSTEM = 0,
54 SND_SEQ_EVENT_RESULT,
55
57 SND_SEQ_EVENT_NOTE = 5,
59 SND_SEQ_EVENT_NOTEON,
61 SND_SEQ_EVENT_NOTEOFF,
63 SND_SEQ_EVENT_KEYPRESS,
64
66 SND_SEQ_EVENT_CONTROLLER = 10,
68 SND_SEQ_EVENT_PGMCHANGE,
70 SND_SEQ_EVENT_CHANPRESS,
72 SND_SEQ_EVENT_PITCHBEND,
74 SND_SEQ_EVENT_CONTROL14,
76 SND_SEQ_EVENT_NONREGPARAM,
78 SND_SEQ_EVENT_REGPARAM,
79
81 SND_SEQ_EVENT_SONGPOS = 20,
83 SND_SEQ_EVENT_SONGSEL,
85 SND_SEQ_EVENT_QFRAME,
87 SND_SEQ_EVENT_TIMESIGN,
89 SND_SEQ_EVENT_KEYSIGN,
90
92 SND_SEQ_EVENT_START = 30,
94 SND_SEQ_EVENT_CONTINUE,
96 SND_SEQ_EVENT_STOP,
98 SND_SEQ_EVENT_SETPOS_TICK,
100 SND_SEQ_EVENT_SETPOS_TIME,
102 SND_SEQ_EVENT_TEMPO,
104 SND_SEQ_EVENT_CLOCK,
106 SND_SEQ_EVENT_TICK,
108 SND_SEQ_EVENT_QUEUE_SKEW,
110 SND_SEQ_EVENT_SYNC_POS,
111
113 SND_SEQ_EVENT_TUNE_REQUEST = 40,
115 SND_SEQ_EVENT_RESET,
117 SND_SEQ_EVENT_SENSING,
118
120 SND_SEQ_EVENT_ECHO = 50,
122 SND_SEQ_EVENT_OSS,
123
125 SND_SEQ_EVENT_CLIENT_START = 60,
127 SND_SEQ_EVENT_CLIENT_EXIT,
129 SND_SEQ_EVENT_CLIENT_CHANGE,
131 SND_SEQ_EVENT_PORT_START,
133 SND_SEQ_EVENT_PORT_EXIT,
135 SND_SEQ_EVENT_PORT_CHANGE,
136
138 SND_SEQ_EVENT_PORT_SUBSCRIBED,
140 SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
141
143 SND_SEQ_EVENT_UMP_EP_CHANGE,
145 SND_SEQ_EVENT_UMP_BLOCK_CHANGE,
146
148 SND_SEQ_EVENT_USR0 = 90,
150 SND_SEQ_EVENT_USR1,
152 SND_SEQ_EVENT_USR2,
154 SND_SEQ_EVENT_USR3,
156 SND_SEQ_EVENT_USR4,
158 SND_SEQ_EVENT_USR5,
160 SND_SEQ_EVENT_USR6,
162 SND_SEQ_EVENT_USR7,
164 SND_SEQ_EVENT_USR8,
166 SND_SEQ_EVENT_USR9,
167
169 SND_SEQ_EVENT_SYSEX = 130,
171 SND_SEQ_EVENT_BOUNCE,
173 SND_SEQ_EVENT_USR_VAR0 = 135,
175 SND_SEQ_EVENT_USR_VAR1,
177 SND_SEQ_EVENT_USR_VAR2,
179 SND_SEQ_EVENT_USR_VAR3,
181 SND_SEQ_EVENT_USR_VAR4,
182
184 SND_SEQ_EVENT_NONE = 255
185};
186
187
189 typedef struct snd_seq_addr {
190 unsigned char client;
191 unsigned char port;
192} snd_seq_addr_t;
193
195 typedef struct snd_seq_connect {
196 snd_seq_addr_t sender;
197 snd_seq_addr_t dest;
198} snd_seq_connect_t;
199
200
202 typedef struct snd_seq_real_time {
203 unsigned int tv_sec;
204 unsigned int tv_nsec;
205} snd_seq_real_time_t;
206
208 typedef unsigned int snd_seq_tick_time_t;
209
211 typedef union snd_seq_timestamp {
212 snd_seq_tick_time_t tick;
213 struct snd_seq_real_time time;
214} snd_seq_timestamp_t;
215
216
222#define SND_SEQ_TIME_STAMP_TICK (0<<0)
223#define SND_SEQ_TIME_STAMP_REAL (1<<0)
224#define SND_SEQ_TIME_STAMP_MASK (1<<0)
226#define SND_SEQ_TIME_MODE_ABS (0<<1)
227#define SND_SEQ_TIME_MODE_REL (1<<1)
228#define SND_SEQ_TIME_MODE_MASK (1<<1)
230#define SND_SEQ_EVENT_LENGTH_FIXED (0<<2)
231#define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2)
232#define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2)
233#define SND_SEQ_EVENT_LENGTH_MASK (3<<2)
235#define SND_SEQ_PRIORITY_NORMAL (0<<4)
236#define SND_SEQ_PRIORITY_HIGH (1<<4)
237#define SND_SEQ_PRIORITY_MASK (1<<4)
239#define SND_SEQ_EVENT_UMP (1<<5)
242 typedef struct snd_seq_ev_note {
243 unsigned char channel;
244 unsigned char note;
245 unsigned char velocity;
246 unsigned char off_velocity;
247 unsigned int duration;
248} snd_seq_ev_note_t;
249
251 typedef struct snd_seq_ev_ctrl {
252 unsigned char channel;
253 unsigned char unused[3];
254 unsigned int param;
255 signed int value;
256} snd_seq_ev_ctrl_t;
257
259 typedef struct snd_seq_ev_raw8 {
260 unsigned char d[12];
261} snd_seq_ev_raw8_t;
262
264 typedef struct snd_seq_ev_raw32 {
265 unsigned int d[3];
266} snd_seq_ev_raw32_t;
267
269 struct snd_seq_ev_ext {
270 unsigned int len;
271 void *ptr;
272} __attribute__((packed));
274 typedef struct snd_seq_ev_ext snd_seq_ev_ext_t;
275#ifdef DOC_HIDDEN
276/* redefine typedef for stupid doxygen */
277 typedef snd_seq_ev_ext snd_seq_ev_ext_t;
278#endif
279
281 typedef struct snd_seq_result {
282 int event;
283 int result;
284} snd_seq_result_t;
285
287 typedef struct snd_seq_queue_skew {
288 unsigned int value;
289 unsigned int base;
290} snd_seq_queue_skew_t;
291
293 typedef struct snd_seq_ev_queue_control {
294 unsigned char queue;
295 unsigned char unused[3];
296 union {
297 signed int value;
298 snd_seq_timestamp_t time;
299 unsigned int position;
300 snd_seq_queue_skew_t skew;
301 unsigned int d32[2];
302 unsigned char d8[8];
303 } param;
304} snd_seq_ev_queue_control_t;
305
307 typedef struct snd_seq_ev_ump_notify {
308 unsigned char client;
309 unsigned char block;
310} snd_seq_ev_ump_notify_t;
311
313 typedef union snd_seq_event_data {
314 snd_seq_ev_note_t note;
315 snd_seq_ev_ctrl_t control;
316 snd_seq_ev_raw8_t raw8;
317 snd_seq_ev_raw32_t raw32;
318 snd_seq_ev_ext_t ext;
319 snd_seq_ev_queue_control_t queue;
320 snd_seq_timestamp_t time;
321 snd_seq_addr_t addr;
322 snd_seq_connect_t connect;
323 snd_seq_result_t result;
324 snd_seq_ev_ump_notify_t ump_notify;
325} snd_seq_event_data_t;
326
328 typedef struct snd_seq_event {
329 snd_seq_event_type_t type;
330 unsigned char flags;
331 unsigned char tag;
333 unsigned char queue;
334 snd_seq_timestamp_t time;
336 snd_seq_addr_t source;
337 snd_seq_addr_t dest;
339 snd_seq_event_data_t data;
340} snd_seq_event_t;
341
343 typedef struct snd_seq_ump_event {
344 snd_seq_event_type_t type;
345 unsigned char flags;
346 unsigned char tag;
347 unsigned char queue;
348 snd_seq_timestamp_t time;
349 snd_seq_addr_t source;
350 snd_seq_addr_t dest;
352 union {
353 snd_seq_event_data_t data;
354 unsigned int ump[4];
355 };
356} snd_seq_ump_event_t;
357
360#endif /* __ALSA_SEQ_EVENT_H */
361
snd_seq_ev_ext_t
snd_seq_ev_ext snd_seq_ev_ext_t
Definition seq_event.h:277
snd_seq_event_type_t
unsigned char snd_seq_event_type_t
Definition seq_event.h:47
snd_seq_tick_time_t
unsigned int snd_seq_tick_time_t
Definition seq_event.h:208
snd_seq_event_type
snd_seq_event_type
Definition seq_event.h:50
SND_SEQ_EVENT_USR_VAR2
@ SND_SEQ_EVENT_USR_VAR2
Definition seq_event.h:177
SND_SEQ_EVENT_SONGPOS
@ SND_SEQ_EVENT_SONGPOS
Definition seq_event.h:81
SND_SEQ_EVENT_SYSEX
@ SND_SEQ_EVENT_SYSEX
Definition seq_event.h:169
SND_SEQ_EVENT_CLIENT_EXIT
@ SND_SEQ_EVENT_CLIENT_EXIT
Definition seq_event.h:127
SND_SEQ_EVENT_SETPOS_TIME
@ SND_SEQ_EVENT_SETPOS_TIME
Definition seq_event.h:100
SND_SEQ_EVENT_USR2
@ SND_SEQ_EVENT_USR2
Definition seq_event.h:152
SND_SEQ_EVENT_PORT_SUBSCRIBED
@ SND_SEQ_EVENT_PORT_SUBSCRIBED
Definition seq_event.h:138
SND_SEQ_EVENT_RESULT
@ SND_SEQ_EVENT_RESULT
Definition seq_event.h:54
SND_SEQ_EVENT_USR9
@ SND_SEQ_EVENT_USR9
Definition seq_event.h:166
SND_SEQ_EVENT_BOUNCE
@ SND_SEQ_EVENT_BOUNCE
Definition seq_event.h:171
SND_SEQ_EVENT_TIMESIGN
@ SND_SEQ_EVENT_TIMESIGN
Definition seq_event.h:87
SND_SEQ_EVENT_TICK
@ SND_SEQ_EVENT_TICK
Definition seq_event.h:106
SND_SEQ_EVENT_KEYSIGN
@ SND_SEQ_EVENT_KEYSIGN
Definition seq_event.h:89
SND_SEQ_EVENT_USR_VAR0
@ SND_SEQ_EVENT_USR_VAR0
Definition seq_event.h:173
SND_SEQ_EVENT_USR5
@ SND_SEQ_EVENT_USR5
Definition seq_event.h:158
SND_SEQ_EVENT_CLIENT_CHANGE
@ SND_SEQ_EVENT_CLIENT_CHANGE
Definition seq_event.h:129
SND_SEQ_EVENT_CLOCK
@ SND_SEQ_EVENT_CLOCK
Definition seq_event.h:104
SND_SEQ_EVENT_TUNE_REQUEST
@ SND_SEQ_EVENT_TUNE_REQUEST
Definition seq_event.h:113
SND_SEQ_EVENT_SYNC_POS
@ SND_SEQ_EVENT_SYNC_POS
Definition seq_event.h:110
SND_SEQ_EVENT_KEYPRESS
@ SND_SEQ_EVENT_KEYPRESS
Definition seq_event.h:63
SND_SEQ_EVENT_USR7
@ SND_SEQ_EVENT_USR7
Definition seq_event.h:162
SND_SEQ_EVENT_ECHO
@ SND_SEQ_EVENT_ECHO
Definition seq_event.h:120
SND_SEQ_EVENT_NOTE
@ SND_SEQ_EVENT_NOTE
Definition seq_event.h:57
SND_SEQ_EVENT_NONE
@ SND_SEQ_EVENT_NONE
Definition seq_event.h:184
SND_SEQ_EVENT_UMP_BLOCK_CHANGE
@ SND_SEQ_EVENT_UMP_BLOCK_CHANGE
Definition seq_event.h:145
SND_SEQ_EVENT_CLIENT_START
@ SND_SEQ_EVENT_CLIENT_START
Definition seq_event.h:125
SND_SEQ_EVENT_CHANPRESS
@ SND_SEQ_EVENT_CHANPRESS
Definition seq_event.h:70
SND_SEQ_EVENT_NONREGPARAM
@ SND_SEQ_EVENT_NONREGPARAM
Definition seq_event.h:76
SND_SEQ_EVENT_CONTINUE
@ SND_SEQ_EVENT_CONTINUE
Definition seq_event.h:94
SND_SEQ_EVENT_SYSTEM
@ SND_SEQ_EVENT_SYSTEM
Definition seq_event.h:52
SND_SEQ_EVENT_STOP
@ SND_SEQ_EVENT_STOP
Definition seq_event.h:96
SND_SEQ_EVENT_PORT_EXIT
@ SND_SEQ_EVENT_PORT_EXIT
Definition seq_event.h:133
SND_SEQ_EVENT_USR_VAR3
@ SND_SEQ_EVENT_USR_VAR3
Definition seq_event.h:179
SND_SEQ_EVENT_CONTROLLER
@ SND_SEQ_EVENT_CONTROLLER
Definition seq_event.h:66
SND_SEQ_EVENT_CONTROL14
@ SND_SEQ_EVENT_CONTROL14
Definition seq_event.h:74
SND_SEQ_EVENT_NOTEOFF
@ SND_SEQ_EVENT_NOTEOFF
Definition seq_event.h:61
SND_SEQ_EVENT_USR_VAR1
@ SND_SEQ_EVENT_USR_VAR1
Definition seq_event.h:175
SND_SEQ_EVENT_USR3
@ SND_SEQ_EVENT_USR3
Definition seq_event.h:154
SND_SEQ_EVENT_UMP_EP_CHANGE
@ SND_SEQ_EVENT_UMP_EP_CHANGE
Definition seq_event.h:143
SND_SEQ_EVENT_TEMPO
@ SND_SEQ_EVENT_TEMPO
Definition seq_event.h:102
SND_SEQ_EVENT_PITCHBEND
@ SND_SEQ_EVENT_PITCHBEND
Definition seq_event.h:72
SND_SEQ_EVENT_PORT_START
@ SND_SEQ_EVENT_PORT_START
Definition seq_event.h:131
SND_SEQ_EVENT_USR4
@ SND_SEQ_EVENT_USR4
Definition seq_event.h:156
SND_SEQ_EVENT_USR1
@ SND_SEQ_EVENT_USR1
Definition seq_event.h:150
SND_SEQ_EVENT_PORT_UNSUBSCRIBED
@ SND_SEQ_EVENT_PORT_UNSUBSCRIBED
Definition seq_event.h:140
SND_SEQ_EVENT_QUEUE_SKEW
@ SND_SEQ_EVENT_QUEUE_SKEW
Definition seq_event.h:108
SND_SEQ_EVENT_QFRAME
@ SND_SEQ_EVENT_QFRAME
Definition seq_event.h:85
SND_SEQ_EVENT_USR6
@ SND_SEQ_EVENT_USR6
Definition seq_event.h:160
SND_SEQ_EVENT_OSS
@ SND_SEQ_EVENT_OSS
Definition seq_event.h:122
SND_SEQ_EVENT_USR0
@ SND_SEQ_EVENT_USR0
Definition seq_event.h:148
SND_SEQ_EVENT_PORT_CHANGE
@ SND_SEQ_EVENT_PORT_CHANGE
Definition seq_event.h:135
SND_SEQ_EVENT_PGMCHANGE
@ SND_SEQ_EVENT_PGMCHANGE
Definition seq_event.h:68
SND_SEQ_EVENT_REGPARAM
@ SND_SEQ_EVENT_REGPARAM
Definition seq_event.h:78
SND_SEQ_EVENT_SETPOS_TICK
@ SND_SEQ_EVENT_SETPOS_TICK
Definition seq_event.h:98
SND_SEQ_EVENT_USR_VAR4
@ SND_SEQ_EVENT_USR_VAR4
Definition seq_event.h:181
SND_SEQ_EVENT_START
@ SND_SEQ_EVENT_START
Definition seq_event.h:92
SND_SEQ_EVENT_RESET
@ SND_SEQ_EVENT_RESET
Definition seq_event.h:115
SND_SEQ_EVENT_SENSING
@ SND_SEQ_EVENT_SENSING
Definition seq_event.h:117
SND_SEQ_EVENT_NOTEON
@ SND_SEQ_EVENT_NOTEON
Definition seq_event.h:59
SND_SEQ_EVENT_USR8
@ SND_SEQ_EVENT_USR8
Definition seq_event.h:164
SND_SEQ_EVENT_SONGSEL
@ SND_SEQ_EVENT_SONGSEL
Definition seq_event.h:83
snd_seq_addr_t
Definition seq_event.h:189
snd_seq_addr_t::port
unsigned char port
Definition seq_event.h:191
snd_seq_addr_t::client
unsigned char client
Definition seq_event.h:190
snd_seq_connect_t
Definition seq_event.h:195
snd_seq_connect_t::dest
snd_seq_addr_t dest
Definition seq_event.h:197
snd_seq_connect_t::sender
snd_seq_addr_t sender
Definition seq_event.h:196
snd_seq_ev_ctrl_t
Definition seq_event.h:251
snd_seq_ev_ctrl_t::channel
unsigned char channel
Definition seq_event.h:252
snd_seq_ev_ctrl_t::value
signed int value
Definition seq_event.h:255
snd_seq_ev_ctrl_t::param
unsigned int param
Definition seq_event.h:254
snd_seq_ev_ext
Definition seq_event.h:269
snd_seq_ev_ext::len
unsigned int len
Definition seq_event.h:270
snd_seq_ev_ext::ptr
void * ptr
Definition seq_event.h:271
snd_seq_ev_note_t
Definition seq_event.h:242
snd_seq_ev_note_t::velocity
unsigned char velocity
Definition seq_event.h:245
snd_seq_ev_note_t::off_velocity
unsigned char off_velocity
Definition seq_event.h:246
snd_seq_ev_note_t::note
unsigned char note
Definition seq_event.h:244
snd_seq_ev_note_t::duration
unsigned int duration
Definition seq_event.h:247
snd_seq_ev_note_t::channel
unsigned char channel
Definition seq_event.h:243
snd_seq_ev_queue_control_t
Definition seq_event.h:293
snd_seq_ev_queue_control_t::time
snd_seq_timestamp_t time
Definition seq_event.h:298
snd_seq_ev_queue_control_t::queue
unsigned char queue
Definition seq_event.h:294
snd_seq_ev_queue_control_t::value
signed int value
Definition seq_event.h:297
snd_seq_ev_queue_control_t::position
unsigned int position
Definition seq_event.h:299
snd_seq_ev_queue_control_t::skew
snd_seq_queue_skew_t skew
Definition seq_event.h:300
snd_seq_ev_raw32_t
Definition seq_event.h:264
snd_seq_ev_raw8_t
Definition seq_event.h:259
snd_seq_ev_ump_notify_t
Definition seq_event.h:307
snd_seq_ev_ump_notify_t::block
unsigned char block
Definition seq_event.h:309
snd_seq_ev_ump_notify_t::client
unsigned char client
Definition seq_event.h:308
snd_seq_event_t
Definition seq_event.h:328
snd_seq_event_t::queue
unsigned char queue
Definition seq_event.h:333
snd_seq_event_t::flags
unsigned char flags
Definition seq_event.h:330
snd_seq_event_t::time
snd_seq_timestamp_t time
Definition seq_event.h:334
snd_seq_event_t::tag
unsigned char tag
Definition seq_event.h:331
snd_seq_event_t::data
snd_seq_event_data_t data
Definition seq_event.h:339
snd_seq_event_t::source
snd_seq_addr_t source
Definition seq_event.h:336
snd_seq_event_t::type
snd_seq_event_type_t type
Definition seq_event.h:329
snd_seq_event_t::dest
snd_seq_addr_t dest
Definition seq_event.h:337
snd_seq_queue_skew_t
Definition seq_event.h:287
snd_seq_queue_skew_t::base
unsigned int base
Definition seq_event.h:289
snd_seq_queue_skew_t::value
unsigned int value
Definition seq_event.h:288
snd_seq_real_time_t
Definition seq_event.h:202
snd_seq_real_time_t::tv_nsec
unsigned int tv_nsec
Definition seq_event.h:204
snd_seq_real_time_t::tv_sec
unsigned int tv_sec
Definition seq_event.h:203
snd_seq_result_t
Definition seq_event.h:281
snd_seq_result_t::result
int result
Definition seq_event.h:283
snd_seq_result_t::event
int event
Definition seq_event.h:282
snd_seq_ump_event_t
Definition seq_event.h:343
snd_seq_ump_event_t::tag
unsigned char tag
Definition seq_event.h:346
snd_seq_ump_event_t::flags
unsigned char flags
Definition seq_event.h:345
snd_seq_ump_event_t::source
snd_seq_addr_t source
Definition seq_event.h:349
snd_seq_ump_event_t::queue
unsigned char queue
Definition seq_event.h:347
snd_seq_ump_event_t::data
snd_seq_event_data_t data
Definition seq_event.h:353
snd_seq_ump_event_t::type
snd_seq_event_type_t type
Definition seq_event.h:344
snd_seq_ump_event_t::dest
snd_seq_addr_t dest
Definition seq_event.h:350
snd_seq_ump_event_t::time
snd_seq_timestamp_t time
Definition seq_event.h:348
time
uint16_t time
Definition ump_msg.h:5
snd_seq_event_data_t
Definition seq_event.h:313
snd_seq_event_data_t::queue
snd_seq_ev_queue_control_t queue
Definition seq_event.h:319
snd_seq_event_data_t::time
snd_seq_timestamp_t time
Definition seq_event.h:320
snd_seq_event_data_t::raw8
snd_seq_ev_raw8_t raw8
Definition seq_event.h:316
snd_seq_event_data_t::note
snd_seq_ev_note_t note
Definition seq_event.h:314
snd_seq_event_data_t::raw32
snd_seq_ev_raw32_t raw32
Definition seq_event.h:317
snd_seq_event_data_t::addr
snd_seq_addr_t addr
Definition seq_event.h:321
snd_seq_event_data_t::result
snd_seq_result_t result
Definition seq_event.h:323
snd_seq_event_data_t::connect
snd_seq_connect_t connect
Definition seq_event.h:322
snd_seq_event_data_t::ump_notify
snd_seq_ev_ump_notify_t ump_notify
Definition seq_event.h:324
snd_seq_event_data_t::control
snd_seq_ev_ctrl_t control
Definition seq_event.h:315
snd_seq_event_data_t::ext
snd_seq_ev_ext_t ext
Definition seq_event.h:318
snd_seq_timestamp_t
Definition seq_event.h:211
snd_seq_timestamp_t::tick
snd_seq_tick_time_t tick
Definition seq_event.h:212