asequencer.h
001:
002:
003: <fvdpol@coil.demon.nl>
004: <perex@perex.cz>
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022: #ifndef __SOUND_ASEQUENCER_H
023: #define __SOUND_ASEQUENCER_H
024:
025:
026:
027: #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
028:
029:
030:
031:
032:
033:
034:
035:
036: #define SNDRV_SEQ_EVENT_SYSTEM 0
037: #define SNDRV_SEQ_EVENT_RESULT 1
038:
039:
040:
041:
042: #define SNDRV_SEQ_EVENT_NOTE 5
043: #define SNDRV_SEQ_EVENT_NOTEON 6
044: #define SNDRV_SEQ_EVENT_NOTEOFF 7
045: #define SNDRV_SEQ_EVENT_KEYPRESS 8
046:
047:
048:
049:
050: #define SNDRV_SEQ_EVENT_CONTROLLER 10
051: #define SNDRV_SEQ_EVENT_PGMCHANGE 11
052: #define SNDRV_SEQ_EVENT_CHANPRESS 12
053: #define SNDRV_SEQ_EVENT_PITCHBEND 13
054: #define SNDRV_SEQ_EVENT_CONTROL14 14
055: #define SNDRV_SEQ_EVENT_NONREGPARAM 15
056: #define SNDRV_SEQ_EVENT_REGPARAM 16
057:
058:
059:
060:
061: #define SNDRV_SEQ_EVENT_SONGPOS 20
062: #define SNDRV_SEQ_EVENT_SONGSEL 21
063: #define SNDRV_SEQ_EVENT_QFRAME 22
064: #define SNDRV_SEQ_EVENT_TIMESIGN 23
065: #define SNDRV_SEQ_EVENT_KEYSIGN 24
066:
067:
068:
069:
070: #define SNDRV_SEQ_EVENT_START 30
071: #define SNDRV_SEQ_EVENT_CONTINUE 31
072: #define SNDRV_SEQ_EVENT_STOP 32
073: #define SNDRV_SEQ_EVENT_SETPOS_TICK 33
074: #define SNDRV_SEQ_EVENT_SETPOS_TIME 34
075: #define SNDRV_SEQ_EVENT_TEMPO 35
076: #define SNDRV_SEQ_EVENT_CLOCK 36
077: #define SNDRV_SEQ_EVENT_TICK 37
078: #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38
079:
080:
081:
082:
083: #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40
084: #define SNDRV_SEQ_EVENT_RESET 41
085: #define SNDRV_SEQ_EVENT_SENSING 42
086:
087:
088:
089:
090: #define SNDRV_SEQ_EVENT_ECHO 50
091: #define SNDRV_SEQ_EVENT_OSS 51
092:
093:
094:
095:
096: #define SNDRV_SEQ_EVENT_CLIENT_START 60
097: #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61
098: #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62
099: #define SNDRV_SEQ_EVENT_PORT_START 63
100: #define SNDRV_SEQ_EVENT_PORT_EXIT 64
101: #define SNDRV_SEQ_EVENT_PORT_CHANGE 65
102:
103:
104:
105:
106: #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66
107: #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67
108:
109:
110:
111:
112:
113:
114: #define SNDRV_SEQ_EVENT_USR0 90
115: #define SNDRV_SEQ_EVENT_USR1 91
116: #define SNDRV_SEQ_EVENT_USR2 92
117: #define SNDRV_SEQ_EVENT_USR3 93
118: #define SNDRV_SEQ_EVENT_USR4 94
119: #define SNDRV_SEQ_EVENT_USR5 95
120: #define SNDRV_SEQ_EVENT_USR6 96
121: #define SNDRV_SEQ_EVENT_USR7 97
122: #define SNDRV_SEQ_EVENT_USR8 98
123: #define SNDRV_SEQ_EVENT_USR9 99
124:
125:
126:
127:
128:
129:
130:
131:
132: #define SNDRV_SEQ_EVENT_SYSEX 130
133: #define SNDRV_SEQ_EVENT_BOUNCE 131
134:
135: #define SNDRV_SEQ_EVENT_USR_VAR0 135
136: #define SNDRV_SEQ_EVENT_USR_VAR1 136
137: #define SNDRV_SEQ_EVENT_USR_VAR2 137
138: #define SNDRV_SEQ_EVENT_USR_VAR3 138
139: #define SNDRV_SEQ_EVENT_USR_VAR4 139
140:
141:
142: #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
143: #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151
144:
145:
146:
147:
148:
149:
150: #define SNDRV_SEQ_EVENT_NONE 255
151:
152:
153: typedef unsigned char snd_seq_event_type_t;
154:
155:
156: struct snd_seq_addr {
157: unsigned char client;
158: unsigned char port;
159: };
160:
161:
162: struct snd_seq_connect {
163: struct snd_seq_addr sender;
164: struct snd_seq_addr dest;
165: };
166:
167:
168: #define SNDRV_SEQ_ADDRESS_UNKNOWN 253
169: #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254
170: #define SNDRV_SEQ_ADDRESS_BROADCAST 255
171: #define SNDRV_SEQ_QUEUE_DIRECT 253
172:
173:
174: #define SNDRV_SEQ_TIME_STAMP_TICK (0<<0)
175: #define SNDRV_SEQ_TIME_STAMP_REAL (1<<0)
176: #define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
177:
178: #define SNDRV_SEQ_TIME_MODE_ABS (0<<1)
179: #define SNDRV_SEQ_TIME_MODE_REL (1<<1)
180: #define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
181:
182: #define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2)
183: #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2)
184: #define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2)
185: #define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
186:
187: #define SNDRV_SEQ_PRIORITY_NORMAL (0<<4)
188: #define SNDRV_SEQ_PRIORITY_HIGH (1<<4)
189: #define SNDRV_SEQ_PRIORITY_MASK (1<<4)
190:
191:
192:
193: struct snd_seq_ev_note {
194: unsigned char channel;
195: unsigned char note;
196: unsigned char velocity;
197: unsigned char off_velocity;
198: unsigned int duration;
199: };
200:
201:
202: struct snd_seq_ev_ctrl {
203: unsigned char channel;
204: unsigned char unused1, unused2, unused3;
205: unsigned int param;
206: signed int value;
207: };
208:
209:
210: struct snd_seq_ev_raw8 {
211: unsigned char d[12];
212: };
213:
214:
215: struct snd_seq_ev_raw32 {
216: unsigned int d[3];
217: };
218:
219:
220: struct snd_seq_ev_ext {
221: unsigned int len;
222: void *ptr;
223: } __attribute__((packed));
224:
225: struct snd_seq_result {
226: int event;
227: int result;
228: };
229:
230:
231: struct snd_seq_real_time {
232: unsigned int tv_sec;
233: unsigned int tv_nsec;
234: };
235:
236: typedef unsigned int snd_seq_tick_time_t;
237:
238: union snd_seq_timestamp {
239: snd_seq_tick_time_t tick;
240: struct snd_seq_real_time time;
241: };
242:
243: struct snd_seq_queue_skew {
244: unsigned int value;
245: unsigned int base;
246: };
247:
248:
249: struct snd_seq_ev_queue_control {
250: unsigned char queue;
251: unsigned char pad[3];
252: union {
253: signed int value;
254: union snd_seq_timestamp time;
255: unsigned int position;
256: struct snd_seq_queue_skew skew;
257: unsigned int d32[2];
258: unsigned char d8[8];
259: } param;
260: };
261:
262:
263: struct snd_seq_ev_quote {
264: struct snd_seq_addr origin;
265: unsigned short value;
266: struct snd_seq_event *event;
267: } __attribute__((packed));
268:
269:
270:
271: struct snd_seq_event {
272: snd_seq_event_type_t type;
273: unsigned char flags;
274: char tag;
275:
276: unsigned char queue;
277: union snd_seq_timestamp time;
278:
279:
280: struct snd_seq_addr source;
281: struct snd_seq_addr dest;
282:
283: union {
284: struct snd_seq_ev_note note;
285: struct snd_seq_ev_ctrl control;
286: struct snd_seq_ev_raw8 raw8;
287: struct snd_seq_ev_raw32 raw32;
288: struct snd_seq_ev_ext ext;
289: struct snd_seq_ev_queue_control queue;
290: union snd_seq_timestamp time;
291: struct snd_seq_addr addr;
292: struct snd_seq_connect connect;
293: struct snd_seq_result result;
294: struct snd_seq_ev_quote quote;
295: } data;
296: };
297:
298:
299:
300:
301:
302: struct snd_seq_event_bounce {
303: int err;
304: struct snd_seq_event event;
305:
306: };
307:
308:
309:
310: struct snd_seq_system_info {
311: int queues;
312: int clients;
313: int ports;
314: int channels;
315: int cur_clients;
316: int cur_queues;
317: char reserved[24];
318: };
319:
320:
321:
322: struct snd_seq_running_info {
323: unsigned char client;
324: unsigned char big_endian;
325: unsigned char cpu_mode;
326: unsigned char pad;
327: unsigned char reserved[12];
328: };
329:
330:
331:
332: #define SNDRV_SEQ_CLIENT_SYSTEM 0
333:
334: #define SNDRV_SEQ_CLIENT_DUMMY 14
335: #define SNDRV_SEQ_CLIENT_OSS 15
336:
337:
338:
339: typedef int __bitwise snd_seq_client_type_t;
340: #define NO_CLIENT ((snd_seq_client_type_t) 0)
341: #define USER_CLIENT ((snd_seq_client_type_t) 1)
342: #define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
343:
344:
345: #define SNDRV_SEQ_FILTER_BROADCAST (1<<0)
346: #define SNDRV_SEQ_FILTER_MULTICAST (1<<1)
347: #define SNDRV_SEQ_FILTER_BOUNCE (1<<2)
348: #define SNDRV_SEQ_FILTER_USE_EVENT (1<<31)
349:
350: struct snd_seq_client_info {
351: int client;
352: snd_seq_client_type_t type;
353: char name[64];
354: unsigned int filter;
355: unsigned char multicast_filter[8];
356: unsigned char event_filter[32];
357: int num_ports;
358: int event_lost;
359: char reserved[64];
360: };
361:
362:
363:
364: struct snd_seq_client_pool {
365: int client;
366: int output_pool;
367: int input_pool;
368: int output_room;
369: int output_free;
370: int input_free;
371: char reserved[64];
372: };
373:
374:
375:
376:
377: #define SNDRV_SEQ_REMOVE_INPUT (1<<0)
378: #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1)
379: #define SNDRV_SEQ_REMOVE_DEST (1<<2)
380: #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3)
381: #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4)
382: #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5)
383: #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6)
384: #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7)
385: #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8)
386: #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9)
387:
388: struct snd_seq_remove_events {
389: unsigned int remove_mode;
390:
391: union snd_seq_timestamp time;
392:
393: unsigned char queue;
394: struct snd_seq_addr dest;
395: unsigned char channel;
396:
397: int type;
398: char tag;
399:
400: int reserved[10];
401:
402: };
403:
404:
405:
406: #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
407: #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
408:
409:
410: #define SNDRV_SEQ_PORT_CAP_READ (1<<0)
411: #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1)
412:
413: #define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
414: #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
415:
416: #define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
417:
418: #define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5)
419: #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6)
420: #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7)
421:
422:
423: #define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0)
424: #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1)
425: #define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2)
426: #define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3)
427: #define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4)
428: #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5)
429: #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6)
430:
431:
432: #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10)
433: #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)
434: #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12)
435:
436: #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16)
437: #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17)
438: #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18)
439: #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19)
440: #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20)
441:
442:
443: #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
444: #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
445: #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
446:
447: struct snd_seq_port_info {
448: struct snd_seq_addr addr;
449: char name[64];
450:
451: unsigned int capability;
452: unsigned int type;
453: int midi_channels;
454: int midi_voices;
455: int synth_voices;
456:
457: int read_use;
458: int write_use;
459:
460: void *kernel;
461: unsigned int flags;
462: unsigned char time_queue;
463: char reserved[59];
464: };
465:
466:
467:
468: #define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0)
469:
470:
471: struct snd_seq_queue_info {
472: int queue;
473:
474:
475:
476:
477:
478: int owner;
479: unsigned locked:1;
480: char name[64];
481: unsigned int flags;
482: char reserved[60];
483:
484: };
485:
486:
487: struct snd_seq_queue_status {
488: int queue;
489: int events;
490: snd_seq_tick_time_t tick;
491: struct snd_seq_real_time time;
492: int running;
493: int flags;
494: char reserved[64];
495: };
496:
497:
498:
499: struct snd_seq_queue_tempo {
500: int queue;
501: unsigned int tempo;
502: int ppq;
503: unsigned int skew_value;
504: unsigned int skew_base;
505: char reserved[24];
506: };
507:
508:
509:
510: #define SNDRV_SEQ_TIMER_ALSA 0
511: #define SNDRV_SEQ_TIMER_MIDI_CLOCK 1
512: #define SNDRV_SEQ_TIMER_MIDI_TICK 2
513:
514:
515: struct snd_seq_queue_timer {
516: int queue;
517: int type;
518: union {
519: struct {
520: struct snd_timer_id id;
521: unsigned int resolution;
522: } alsa;
523: } u;
524: char reserved[64];
525: };
526:
527:
528: struct snd_seq_queue_client {
529: int queue;
530: int client;
531: int used;
532:
533:
534: char reserved[64];
535: };
536:
537:
538: #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0)
539: #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
540: #define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
541:
542: struct snd_seq_port_subscribe {
543: struct snd_seq_addr sender;
544: struct snd_seq_addr dest;
545: unsigned int voices;
546: unsigned int flags;
547: unsigned char queue;
548: unsigned char pad[3];
549: char reserved[64];
550: };
551:
552:
553: #define SNDRV_SEQ_QUERY_SUBS_READ 0
554: #define SNDRV_SEQ_QUERY_SUBS_WRITE 1
555:
556: struct snd_seq_query_subs {
557: struct snd_seq_addr root;
558: int type;
559: int index;
560: int num_subs;
561: struct snd_seq_addr addr;
562: unsigned char queue;
563: unsigned int flags;
564: char reserved[64];
565: };
566:
567:
568:
569:
570:
571:
572: #define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
573: #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
574: #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
575: #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
576:
577: #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
578: #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
579:
580: #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
581: #define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
582: #define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
583: #define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
584:
585: #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
586: #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
587:
588: #define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
589: #define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
590: #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
591: #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
592: #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
593: #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
594: #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
595: #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
596: #define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
597: #define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
598: #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
599: #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
600:
601:
602:
603:
604: #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
605: #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
606: #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
607: #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
608: #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
609: #define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
610: #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
611: #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
612: #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
613:
614: #endif
615:
© Andrew Scott 2006 -
2025,
All Rights Reserved