asequencer.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. /*
  2. * Main header file for the ALSA sequencer
  3. * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  4. * (c) 1998-1999 by Jaroslav Kysela <perex@suse.cz>
  5. *
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. */
  22. #ifndef __SOUND_ASEQUENCER_H
  23. #define __SOUND_ASEQUENCER_H
  24. #ifdef __KERNEL__
  25. #include <linux/ioctl.h>
  26. #include <sound/asound.h>
  27. #endif
  28. /** version of the sequencer */
  29. #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
  30. /**
  31. * definition of sequencer event types
  32. */
  33. /** system messages
  34. * event data type = #snd_seq_result
  35. */
  36. #define SNDRV_SEQ_EVENT_SYSTEM 0
  37. #define SNDRV_SEQ_EVENT_RESULT 1
  38. /** note messages (channel specific)
  39. * event data type = #snd_seq_ev_note
  40. */
  41. #define SNDRV_SEQ_EVENT_NOTE 5
  42. #define SNDRV_SEQ_EVENT_NOTEON 6
  43. #define SNDRV_SEQ_EVENT_NOTEOFF 7
  44. #define SNDRV_SEQ_EVENT_KEYPRESS 8
  45. /** control messages (channel specific)
  46. * event data type = #snd_seq_ev_ctrl
  47. */
  48. #define SNDRV_SEQ_EVENT_CONTROLLER 10
  49. #define SNDRV_SEQ_EVENT_PGMCHANGE 11
  50. #define SNDRV_SEQ_EVENT_CHANPRESS 12
  51. #define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
  52. #define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
  53. #define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
  54. #define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
  55. /** synchronisation messages
  56. * event data type = #snd_seq_ev_ctrl
  57. */
  58. #define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
  59. #define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
  60. #define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
  61. #define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
  62. #define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
  63. /** timer messages
  64. * event data type = snd_seq_ev_queue_control
  65. */
  66. #define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
  67. #define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
  68. #define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
  69. #define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
  70. #define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
  71. #define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
  72. #define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
  73. #define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
  74. #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
  75. /** others
  76. * event data type = none
  77. */
  78. #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
  79. #define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
  80. #define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
  81. /** echo back, kernel private messages
  82. * event data type = any type
  83. */
  84. #define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
  85. #define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
  86. /** system status messages (broadcast for subscribers)
  87. * event data type = snd_seq_addr
  88. */
  89. #define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
  90. #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
  91. #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
  92. #define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
  93. #define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
  94. #define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
  95. /** port connection changes
  96. * event data type = snd_seq_connect
  97. */
  98. #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
  99. #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
  100. /** synthesizer events
  101. * event data type = snd_seq_eve_sample_control
  102. */
  103. #define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */
  104. #define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */
  105. #define SNDRV_SEQ_EVENT_SAMPLE_START 72 /* voice start */
  106. #define SNDRV_SEQ_EVENT_SAMPLE_STOP 73 /* voice stop */
  107. #define SNDRV_SEQ_EVENT_SAMPLE_FREQ 74 /* playback frequency */
  108. #define SNDRV_SEQ_EVENT_SAMPLE_VOLUME 75 /* volume and balance */
  109. #define SNDRV_SEQ_EVENT_SAMPLE_LOOP 76 /* sample loop */
  110. #define SNDRV_SEQ_EVENT_SAMPLE_POSITION 77 /* sample position */
  111. #define SNDRV_SEQ_EVENT_SAMPLE_PRIVATE1 78 /* private (hardware dependent) event */
  112. /** user-defined events with fixed length
  113. * event data type = any
  114. */
  115. #define SNDRV_SEQ_EVENT_USR0 90
  116. #define SNDRV_SEQ_EVENT_USR1 91
  117. #define SNDRV_SEQ_EVENT_USR2 92
  118. #define SNDRV_SEQ_EVENT_USR3 93
  119. #define SNDRV_SEQ_EVENT_USR4 94
  120. #define SNDRV_SEQ_EVENT_USR5 95
  121. #define SNDRV_SEQ_EVENT_USR6 96
  122. #define SNDRV_SEQ_EVENT_USR7 97
  123. #define SNDRV_SEQ_EVENT_USR8 98
  124. #define SNDRV_SEQ_EVENT_USR9 99
  125. /** instrument layer
  126. * variable length data can be passed directly to the driver
  127. */
  128. #define SNDRV_SEQ_EVENT_INSTR_BEGIN 100 /* begin of instrument management */
  129. #define SNDRV_SEQ_EVENT_INSTR_END 101 /* end of instrument management */
  130. #define SNDRV_SEQ_EVENT_INSTR_INFO 102 /* instrument interface info */
  131. #define SNDRV_SEQ_EVENT_INSTR_INFO_RESULT 103 /* result */
  132. #define SNDRV_SEQ_EVENT_INSTR_FINFO 104 /* get format info */
  133. #define SNDRV_SEQ_EVENT_INSTR_FINFO_RESULT 105 /* get format info */
  134. #define SNDRV_SEQ_EVENT_INSTR_RESET 106 /* reset instrument memory */
  135. #define SNDRV_SEQ_EVENT_INSTR_STATUS 107 /* instrument interface status */
  136. #define SNDRV_SEQ_EVENT_INSTR_STATUS_RESULT 108 /* result */
  137. #define SNDRV_SEQ_EVENT_INSTR_PUT 109 /* put instrument to port */
  138. #define SNDRV_SEQ_EVENT_INSTR_GET 110 /* get instrument from port */
  139. #define SNDRV_SEQ_EVENT_INSTR_GET_RESULT 111 /* result */
  140. #define SNDRV_SEQ_EVENT_INSTR_FREE 112 /* free instrument(s) */
  141. #define SNDRV_SEQ_EVENT_INSTR_LIST 113 /* instrument list */
  142. #define SNDRV_SEQ_EVENT_INSTR_LIST_RESULT 114 /* result */
  143. #define SNDRV_SEQ_EVENT_INSTR_CLUSTER 115 /* cluster parameters */
  144. #define SNDRV_SEQ_EVENT_INSTR_CLUSTER_GET 116 /* get cluster parameters */
  145. #define SNDRV_SEQ_EVENT_INSTR_CLUSTER_RESULT 117 /* result */
  146. #define SNDRV_SEQ_EVENT_INSTR_CHANGE 118 /* instrument change */
  147. /* 119-129: reserved */
  148. /* 130-139: variable length events
  149. * event data type = snd_seq_ev_ext
  150. * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
  151. */
  152. #define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
  153. #define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
  154. /* 132-134: reserved */
  155. #define SNDRV_SEQ_EVENT_USR_VAR0 135
  156. #define SNDRV_SEQ_EVENT_USR_VAR1 136
  157. #define SNDRV_SEQ_EVENT_USR_VAR2 137
  158. #define SNDRV_SEQ_EVENT_USR_VAR3 138
  159. #define SNDRV_SEQ_EVENT_USR_VAR4 139
  160. /* 150-151: kernel events with quote - DO NOT use in user clients */
  161. #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
  162. #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
  163. /* 152-191: reserved */
  164. /* 192-254: hardware specific events */
  165. /* 255: special event */
  166. #define SNDRV_SEQ_EVENT_NONE 255
  167. typedef unsigned char snd_seq_event_type_t;
  168. /** event address */
  169. struct snd_seq_addr {
  170. unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
  171. unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
  172. };
  173. /** port connection */
  174. struct snd_seq_connect {
  175. struct snd_seq_addr sender;
  176. struct snd_seq_addr dest;
  177. };
  178. #define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
  179. #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
  180. #define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
  181. #define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
  182. /* event mode flag - NOTE: only 8 bits available! */
  183. #define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
  184. #define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
  185. #define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
  186. #define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
  187. #define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
  188. #define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
  189. #define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
  190. #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
  191. #define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
  192. #define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
  193. #define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
  194. #define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
  195. #define SNDRV_SEQ_PRIORITY_MASK (1<<4)
  196. /* note event */
  197. struct snd_seq_ev_note {
  198. unsigned char channel;
  199. unsigned char note;
  200. unsigned char velocity;
  201. unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
  202. unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
  203. };
  204. /* controller event */
  205. struct snd_seq_ev_ctrl {
  206. unsigned char channel;
  207. unsigned char unused1, unused2, unused3; /* pad */
  208. unsigned int param;
  209. signed int value;
  210. };
  211. /* generic set of bytes (12x8 bit) */
  212. struct snd_seq_ev_raw8 {
  213. unsigned char d[12]; /* 8 bit value */
  214. };
  215. /* generic set of integers (3x32 bit) */
  216. struct snd_seq_ev_raw32 {
  217. unsigned int d[3]; /* 32 bit value */
  218. };
  219. /* external stored data */
  220. struct snd_seq_ev_ext {
  221. unsigned int len; /* length of data */
  222. void *ptr; /* pointer to data (note: maybe 64-bit) */
  223. } __attribute__((packed));
  224. /* Instrument cluster type */
  225. typedef unsigned int snd_seq_instr_cluster_t;
  226. /* Instrument type */
  227. struct snd_seq_instr {
  228. snd_seq_instr_cluster_t cluster;
  229. unsigned int std; /* the upper byte means a private instrument (owner - client #) */
  230. unsigned short bank;
  231. unsigned short prg;
  232. };
  233. /* sample number */
  234. struct snd_seq_ev_sample {
  235. unsigned int std;
  236. unsigned short bank;
  237. unsigned short prg;
  238. };
  239. /* sample cluster */
  240. struct snd_seq_ev_cluster {
  241. snd_seq_instr_cluster_t cluster;
  242. };
  243. /* sample position */
  244. typedef unsigned int snd_seq_position_t; /* playback position (in samples) * 16 */
  245. /* sample stop mode */
  246. enum {
  247. SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */
  248. SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */
  249. SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */
  250. };
  251. /* sample frequency */
  252. typedef int snd_seq_frequency_t; /* playback frequency in HZ * 16 */
  253. /* sample volume control; if any value is set to -1 == do not change */
  254. struct snd_seq_ev_volume {
  255. signed short volume; /* range: 0-16383 */
  256. signed short lr; /* left-right balance; range: 0-16383 */
  257. signed short fr; /* front-rear balance; range: 0-16383 */
  258. signed short du; /* down-up balance; range: 0-16383 */
  259. };
  260. /* simple loop redefinition */
  261. struct snd_seq_ev_loop {
  262. unsigned int start; /* loop start (in samples) * 16 */
  263. unsigned int end; /* loop end (in samples) * 16 */
  264. };
  265. struct snd_seq_ev_sample_control {
  266. unsigned char channel;
  267. unsigned char unused1, unused2, unused3; /* pad */
  268. union {
  269. struct snd_seq_ev_sample sample;
  270. struct snd_seq_ev_cluster cluster;
  271. snd_seq_position_t position;
  272. int stop_mode;
  273. snd_seq_frequency_t frequency;
  274. struct snd_seq_ev_volume volume;
  275. struct snd_seq_ev_loop loop;
  276. unsigned char raw8[8];
  277. } param;
  278. };
  279. /* INSTR_BEGIN event */
  280. struct snd_seq_ev_instr_begin {
  281. int timeout; /* zero = forever, otherwise timeout in ms */
  282. };
  283. struct snd_seq_result {
  284. int event; /* processed event type */
  285. int result;
  286. };
  287. struct snd_seq_real_time {
  288. unsigned int tv_sec; /* seconds */
  289. unsigned int tv_nsec; /* nanoseconds */
  290. };
  291. typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
  292. union snd_seq_timestamp {
  293. snd_seq_tick_time_t tick;
  294. struct snd_seq_real_time time;
  295. };
  296. struct snd_seq_queue_skew {
  297. unsigned int value;
  298. unsigned int base;
  299. };
  300. /* queue timer control */
  301. struct snd_seq_ev_queue_control {
  302. unsigned char queue; /* affected queue */
  303. unsigned char pad[3]; /* reserved */
  304. union {
  305. signed int value; /* affected value (e.g. tempo) */
  306. union snd_seq_timestamp time; /* time */
  307. unsigned int position; /* sync position */
  308. struct snd_seq_queue_skew skew;
  309. unsigned int d32[2];
  310. unsigned char d8[8];
  311. } param;
  312. };
  313. /* quoted event - inside the kernel only */
  314. struct snd_seq_ev_quote {
  315. struct snd_seq_addr origin; /* original sender */
  316. unsigned short value; /* optional data */
  317. struct snd_seq_event *event; /* quoted event */
  318. } __attribute__((packed));
  319. /* sequencer event */
  320. struct snd_seq_event {
  321. snd_seq_event_type_t type; /* event type */
  322. unsigned char flags; /* event flags */
  323. char tag;
  324. unsigned char queue; /* schedule queue */
  325. union snd_seq_timestamp time; /* schedule time */
  326. struct snd_seq_addr source; /* source address */
  327. struct snd_seq_addr dest; /* destination address */
  328. union { /* event data... */
  329. struct snd_seq_ev_note note;
  330. struct snd_seq_ev_ctrl control;
  331. struct snd_seq_ev_raw8 raw8;
  332. struct snd_seq_ev_raw32 raw32;
  333. struct snd_seq_ev_ext ext;
  334. struct snd_seq_ev_queue_control queue;
  335. union snd_seq_timestamp time;
  336. struct snd_seq_addr addr;
  337. struct snd_seq_connect connect;
  338. struct snd_seq_result result;
  339. struct snd_seq_ev_instr_begin instr_begin;
  340. struct snd_seq_ev_sample_control sample;
  341. struct snd_seq_ev_quote quote;
  342. } data;
  343. };
  344. /*
  345. * bounce event - stored as variable size data
  346. */
  347. struct snd_seq_event_bounce {
  348. int err;
  349. struct snd_seq_event event;
  350. /* external data follows here. */
  351. };
  352. #ifdef __KERNEL__
  353. /* helper macro */
  354. #define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
  355. /*
  356. * type check macros
  357. */
  358. /* result events: 0-4 */
  359. #define snd_seq_ev_is_result_type(ev) ((ev)->type < 5)
  360. /* channel specific events: 5-19 */
  361. #define snd_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)
  362. /* note events: 5-9 */
  363. #define snd_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)
  364. /* control events: 10-19 */
  365. #define snd_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)
  366. /* queue control events: 30-39 */
  367. #define snd_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)
  368. /* system status messages */
  369. #define snd_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)
  370. /* sample messages */
  371. #define snd_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)
  372. /* user-defined messages */
  373. #define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
  374. /* fixed length events: 0-99 */
  375. #define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
  376. /* instrument layer events: 100-129 */
  377. #define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)
  378. /* variable length events: 130-139 */
  379. #define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
  380. /* reserved for kernel */
  381. #define snd_seq_ev_is_reserved(ev) ((ev)->type >= 150)
  382. /* direct dispatched events */
  383. #define snd_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)
  384. /*
  385. * macros to check event flags
  386. */
  387. /* prior events */
  388. #define snd_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)
  389. /* event length type */
  390. #define snd_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)
  391. #define snd_seq_ev_is_fixed(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)
  392. #define snd_seq_ev_is_variable(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
  393. #define snd_seq_ev_is_varusr(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)
  394. /* time-stamp type */
  395. #define snd_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)
  396. #define snd_seq_ev_is_tick(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)
  397. #define snd_seq_ev_is_real(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)
  398. /* time-mode type */
  399. #define snd_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)
  400. #define snd_seq_ev_is_abstime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)
  401. #define snd_seq_ev_is_reltime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)
  402. /* queue sync port */
  403. #define snd_seq_queue_sync_port(q) ((q) + 16)
  404. #endif /* __KERNEL__ */
  405. /* system information */
  406. struct snd_seq_system_info {
  407. int queues; /* maximum queues count */
  408. int clients; /* maximum clients count */
  409. int ports; /* maximum ports per client */
  410. int channels; /* maximum channels per port */
  411. int cur_clients; /* current clients */
  412. int cur_queues; /* current queues */
  413. char reserved[24];
  414. };
  415. /* system running information */
  416. struct snd_seq_running_info {
  417. unsigned char client; /* client id */
  418. unsigned char big_endian; /* 1 = big-endian */
  419. unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
  420. unsigned char pad; /* reserved */
  421. unsigned char reserved[12];
  422. };
  423. /* known client numbers */
  424. #define SNDRV_SEQ_CLIENT_SYSTEM 0
  425. /* internal client numbers */
  426. #define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
  427. #define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
  428. /* client types */
  429. typedef int __bitwise snd_seq_client_type_t;
  430. #define NO_CLIENT ((__force snd_seq_client_type_t) 0)
  431. #define USER_CLIENT ((__force snd_seq_client_type_t) 1)
  432. #define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
  433. /* event filter flags */
  434. #define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
  435. #define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
  436. #define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
  437. #define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
  438. struct snd_seq_client_info {
  439. int client; /* client number to inquire */
  440. snd_seq_client_type_t type; /* client type */
  441. char name[64]; /* client name */
  442. unsigned int filter; /* filter flags */
  443. unsigned char multicast_filter[8]; /* multicast filter bitmap */
  444. unsigned char event_filter[32]; /* event filter bitmap */
  445. int num_ports; /* RO: number of ports */
  446. int event_lost; /* number of lost events */
  447. char reserved[64]; /* for future use */
  448. };
  449. /* client pool size */
  450. struct snd_seq_client_pool {
  451. int client; /* client number to inquire */
  452. int output_pool; /* outgoing (write) pool size */
  453. int input_pool; /* incoming (read) pool size */
  454. int output_room; /* minimum free pool size for select/blocking mode */
  455. int output_free; /* unused size */
  456. int input_free; /* unused size */
  457. char reserved[64];
  458. };
  459. /* Remove events by specified criteria */
  460. #define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
  461. #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
  462. #define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
  463. #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
  464. #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
  465. #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
  466. #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
  467. #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
  468. #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
  469. #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
  470. struct snd_seq_remove_events {
  471. unsigned int remove_mode; /* Flags that determine what gets removed */
  472. union snd_seq_timestamp time;
  473. unsigned char queue; /* Queue for REMOVE_DEST */
  474. struct snd_seq_addr dest; /* Address for REMOVE_DEST */
  475. unsigned char channel; /* Channel for REMOVE_DEST */
  476. int type; /* For REMOVE_EVENT_TYPE */
  477. char tag; /* Tag for REMOVE_TAG */
  478. int reserved[10]; /* To allow for future binary compatibility */
  479. };
  480. /* known port numbers */
  481. #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
  482. #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
  483. /* port capabilities (32 bits) */
  484. #define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
  485. #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
  486. #define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
  487. #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
  488. #define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
  489. #define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
  490. #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
  491. #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
  492. /* port type */
  493. #define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
  494. #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
  495. #define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
  496. #define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
  497. #define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
  498. #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
  499. #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
  500. /* other standards...*/
  501. #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
  502. #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
  503. #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
  504. /*...*/
  505. #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
  506. #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
  507. #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
  508. #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
  509. #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
  510. /* misc. conditioning flags */
  511. #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
  512. #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
  513. #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
  514. struct snd_seq_port_info {
  515. struct snd_seq_addr addr; /* client/port numbers */
  516. char name[64]; /* port name */
  517. unsigned int capability; /* port capability bits */
  518. unsigned int type; /* port type bits */
  519. int midi_channels; /* channels per MIDI port */
  520. int midi_voices; /* voices per MIDI port */
  521. int synth_voices; /* voices per SYNTH port */
  522. int read_use; /* R/O: subscribers for output (from this port) */
  523. int write_use; /* R/O: subscribers for input (to this port) */
  524. void *kernel; /* reserved for kernel use (must be NULL) */
  525. unsigned int flags; /* misc. conditioning */
  526. unsigned char time_queue; /* queue # for timestamping */
  527. char reserved[59]; /* for future use */
  528. };
  529. /* queue flags */
  530. #define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
  531. /* queue information */
  532. struct snd_seq_queue_info {
  533. int queue; /* queue id */
  534. /*
  535. * security settings, only owner of this queue can start/stop timer
  536. * etc. if the queue is locked for other clients
  537. */
  538. int owner; /* client id for owner of the queue */
  539. unsigned locked:1; /* timing queue locked for other queues */
  540. char name[64]; /* name of this queue */
  541. unsigned int flags; /* flags */
  542. char reserved[60]; /* for future use */
  543. };
  544. /* queue info/status */
  545. struct snd_seq_queue_status {
  546. int queue; /* queue id */
  547. int events; /* read-only - queue size */
  548. snd_seq_tick_time_t tick; /* current tick */
  549. struct snd_seq_real_time time; /* current time */
  550. int running; /* running state of queue */
  551. int flags; /* various flags */
  552. char reserved[64]; /* for the future */
  553. };
  554. /* queue tempo */
  555. struct snd_seq_queue_tempo {
  556. int queue; /* sequencer queue */
  557. unsigned int tempo; /* current tempo, us/tick */
  558. int ppq; /* time resolution, ticks/quarter */
  559. unsigned int skew_value; /* queue skew */
  560. unsigned int skew_base; /* queue skew base */
  561. char reserved[24]; /* for the future */
  562. };
  563. /* sequencer timer sources */
  564. #define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
  565. #define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
  566. #define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
  567. /* queue timer info */
  568. struct snd_seq_queue_timer {
  569. int queue; /* sequencer queue */
  570. int type; /* source timer type */
  571. union {
  572. struct {
  573. struct snd_timer_id id; /* ALSA's timer ID */
  574. unsigned int resolution; /* resolution in Hz */
  575. } alsa;
  576. } u;
  577. char reserved[64]; /* for the future use */
  578. };
  579. struct snd_seq_queue_client {
  580. int queue; /* sequencer queue */
  581. int client; /* sequencer client */
  582. int used; /* queue is used with this client
  583. (must be set for accepting events) */
  584. /* per client watermarks */
  585. char reserved[64]; /* for future use */
  586. };
  587. #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
  588. #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
  589. #define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
  590. struct snd_seq_port_subscribe {
  591. struct snd_seq_addr sender; /* sender address */
  592. struct snd_seq_addr dest; /* destination address */
  593. unsigned int voices; /* number of voices to be allocated (0 = don't care) */
  594. unsigned int flags; /* modes */
  595. unsigned char queue; /* input time-stamp queue (optional) */
  596. unsigned char pad[3]; /* reserved */
  597. char reserved[64];
  598. };
  599. /* type of query subscription */
  600. #define SNDRV_SEQ_QUERY_SUBS_READ 0
  601. #define SNDRV_SEQ_QUERY_SUBS_WRITE 1
  602. struct snd_seq_query_subs {
  603. struct snd_seq_addr root; /* client/port id to be searched */
  604. int type; /* READ or WRITE */
  605. int index; /* 0..N-1 */
  606. int num_subs; /* R/O: number of subscriptions on this port */
  607. struct snd_seq_addr addr; /* R/O: result */
  608. unsigned char queue; /* R/O: result */
  609. unsigned int flags; /* R/O: result */
  610. char reserved[64]; /* for future use */
  611. };
  612. /*
  613. * Instrument abstraction layer
  614. * - based on events
  615. */
  616. /* instrument types */
  617. #define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */
  618. #define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias */
  619. /* instrument ASCII identifiers */
  620. #define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1"
  621. #define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2"
  622. #define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave"
  623. #define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont"
  624. #define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch"
  625. #define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF"
  626. #define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM"
  627. #define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4"
  628. /* instrument types */
  629. #define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */
  630. #define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */
  631. #define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */
  632. #define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */
  633. #define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */
  634. #define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */
  635. #define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */
  636. #define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 */
  637. /* put commands */
  638. #define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0
  639. #define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1
  640. #define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2
  641. #define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3
  642. #define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4
  643. /* get commands */
  644. #define SNDRV_SEQ_INSTR_GET_CMD_FULL 0
  645. #define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1
  646. /* query flags */
  647. #define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0)
  648. /* free commands */
  649. #define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0
  650. #define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1
  651. #define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2
  652. #define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3
  653. /* size of ROM/RAM */
  654. typedef unsigned int snd_seq_instr_size_t;
  655. /* INSTR_INFO */
  656. struct snd_seq_instr_info {
  657. int result; /* operation result */
  658. unsigned int formats[8]; /* bitmap of supported formats */
  659. int ram_count; /* count of RAM banks */
  660. snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */
  661. int rom_count; /* count of ROM banks */
  662. snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */
  663. char reserved[128];
  664. };
  665. /* INSTR_STATUS */
  666. struct snd_seq_instr_status {
  667. int result; /* operation result */
  668. snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */
  669. int instrument_count; /* count of downloaded instruments */
  670. char reserved[128];
  671. };
  672. /* INSTR_FORMAT_INFO */
  673. struct snd_seq_instr_format_info {
  674. char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */
  675. unsigned int len; /* max data length (without this structure) */
  676. };
  677. struct snd_seq_instr_format_info_result {
  678. int result; /* operation result */
  679. char format[16]; /* format identifier */
  680. unsigned int len; /* filled data length (without this structure) */
  681. };
  682. /* instrument data */
  683. struct snd_seq_instr_data {
  684. char name[32]; /* instrument name */
  685. char reserved[16]; /* for the future use */
  686. int type; /* instrument type */
  687. union {
  688. char format[16]; /* format identifier */
  689. struct snd_seq_instr alias;
  690. } data;
  691. };
  692. /* INSTR_PUT/GET, data are stored in one block (extended), header + data */
  693. struct snd_seq_instr_header {
  694. union {
  695. struct snd_seq_instr instr;
  696. snd_seq_instr_cluster_t cluster;
  697. } id; /* instrument identifier */
  698. unsigned int cmd; /* get/put/free command */
  699. unsigned int flags; /* query flags (only for get) */
  700. unsigned int len; /* real instrument data length (without header) */
  701. int result; /* operation result */
  702. char reserved[16]; /* for the future */
  703. struct snd_seq_instr_data data; /* instrument data (for put/get result) */
  704. };
  705. /* INSTR_CLUSTER_SET */
  706. struct snd_seq_instr_cluster_set {
  707. snd_seq_instr_cluster_t cluster; /* cluster identifier */
  708. char name[32]; /* cluster name */
  709. int priority; /* cluster priority */
  710. char reserved[64]; /* for the future use */
  711. };
  712. /* INSTR_CLUSTER_GET */
  713. struct snd_seq_instr_cluster_get {
  714. snd_seq_instr_cluster_t cluster; /* cluster identifier */
  715. char name[32]; /* cluster name */
  716. int priority; /* cluster priority */
  717. char reserved[64]; /* for the future use */
  718. };
  719. /*
  720. * IOCTL commands
  721. */
  722. #define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
  723. #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
  724. #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
  725. #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
  726. #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
  727. #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
  728. #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
  729. #define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
  730. #define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
  731. #define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
  732. #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
  733. #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
  734. #define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
  735. #define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
  736. #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
  737. #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
  738. #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
  739. #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
  740. #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
  741. #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
  742. #define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
  743. #define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
  744. #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
  745. #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
  746. /* XXX
  747. #define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
  748. #define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
  749. */
  750. #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
  751. #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
  752. #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
  753. #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
  754. #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
  755. #define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
  756. #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
  757. #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
  758. #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
  759. #endif /* __SOUND_ASEQUENCER_H */