| 1 | /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
|
|---|
| 2 | /*
|
|---|
| 3 | * Main header file for the ALSA sequencer
|
|---|
| 4 | * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
|
|---|
| 5 | * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
|
|---|
| 6 | */
|
|---|
| 7 | #ifndef _UAPI__SOUND_ASEQUENCER_H
|
|---|
| 8 | #define _UAPI__SOUND_ASEQUENCER_H
|
|---|
| 9 |
|
|---|
| 10 | #include <sound/asound.h>
|
|---|
| 11 |
|
|---|
| 12 | /** version of the sequencer */
|
|---|
| 13 | #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
|
|---|
| 14 |
|
|---|
| 15 | /**
|
|---|
| 16 | * definition of sequencer event types
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | /** system messages
|
|---|
| 20 | * event data type = #snd_seq_result
|
|---|
| 21 | */
|
|---|
| 22 | #define SNDRV_SEQ_EVENT_SYSTEM 0
|
|---|
| 23 | #define SNDRV_SEQ_EVENT_RESULT 1
|
|---|
| 24 |
|
|---|
| 25 | /** note messages (channel specific)
|
|---|
| 26 | * event data type = #snd_seq_ev_note
|
|---|
| 27 | */
|
|---|
| 28 | #define SNDRV_SEQ_EVENT_NOTE 5
|
|---|
| 29 | #define SNDRV_SEQ_EVENT_NOTEON 6
|
|---|
| 30 | #define SNDRV_SEQ_EVENT_NOTEOFF 7
|
|---|
| 31 | #define SNDRV_SEQ_EVENT_KEYPRESS 8
|
|---|
| 32 |
|
|---|
| 33 | /** control messages (channel specific)
|
|---|
| 34 | * event data type = #snd_seq_ev_ctrl
|
|---|
| 35 | */
|
|---|
| 36 | #define SNDRV_SEQ_EVENT_CONTROLLER 10
|
|---|
| 37 | #define SNDRV_SEQ_EVENT_PGMCHANGE 11
|
|---|
| 38 | #define SNDRV_SEQ_EVENT_CHANPRESS 12
|
|---|
| 39 | #define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
|
|---|
| 40 | #define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
|
|---|
| 41 | #define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
|
|---|
| 42 | #define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
|
|---|
| 43 |
|
|---|
| 44 | /** synchronisation messages
|
|---|
| 45 | * event data type = #snd_seq_ev_ctrl
|
|---|
| 46 | */
|
|---|
| 47 | #define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
|
|---|
| 48 | #define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
|
|---|
| 49 | #define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
|
|---|
| 50 | #define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
|
|---|
| 51 | #define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
|
|---|
| 52 |
|
|---|
| 53 | /** timer messages
|
|---|
| 54 | * event data type = snd_seq_ev_queue_control
|
|---|
| 55 | */
|
|---|
| 56 | #define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
|
|---|
| 57 | #define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
|
|---|
| 58 | #define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
|
|---|
| 59 | #define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
|
|---|
| 60 | #define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
|
|---|
| 61 | #define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
|
|---|
| 62 | #define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
|
|---|
| 63 | #define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
|
|---|
| 64 | #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
|
|---|
| 65 |
|
|---|
| 66 | /** others
|
|---|
| 67 | * event data type = none
|
|---|
| 68 | */
|
|---|
| 69 | #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
|
|---|
| 70 | #define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
|
|---|
| 71 | #define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
|
|---|
| 72 |
|
|---|
| 73 | /** echo back, kernel private messages
|
|---|
| 74 | * event data type = any type
|
|---|
| 75 | */
|
|---|
| 76 | #define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
|
|---|
| 77 | #define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
|
|---|
| 78 |
|
|---|
| 79 | /** system status messages (broadcast for subscribers)
|
|---|
| 80 | * event data type = snd_seq_addr
|
|---|
| 81 | */
|
|---|
| 82 | #define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
|
|---|
| 83 | #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
|
|---|
| 84 | #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
|
|---|
| 85 | #define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
|
|---|
| 86 | #define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
|
|---|
| 87 | #define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
|
|---|
| 88 |
|
|---|
| 89 | /** port connection changes
|
|---|
| 90 | * event data type = snd_seq_connect
|
|---|
| 91 | */
|
|---|
| 92 | #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
|
|---|
| 93 | #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
|
|---|
| 94 |
|
|---|
| 95 | /* 70-89: synthesizer events - obsoleted */
|
|---|
| 96 |
|
|---|
| 97 | /** user-defined events with fixed length
|
|---|
| 98 | * event data type = any
|
|---|
| 99 | */
|
|---|
| 100 | #define SNDRV_SEQ_EVENT_USR0 90
|
|---|
| 101 | #define SNDRV_SEQ_EVENT_USR1 91
|
|---|
| 102 | #define SNDRV_SEQ_EVENT_USR2 92
|
|---|
| 103 | #define SNDRV_SEQ_EVENT_USR3 93
|
|---|
| 104 | #define SNDRV_SEQ_EVENT_USR4 94
|
|---|
| 105 | #define SNDRV_SEQ_EVENT_USR5 95
|
|---|
| 106 | #define SNDRV_SEQ_EVENT_USR6 96
|
|---|
| 107 | #define SNDRV_SEQ_EVENT_USR7 97
|
|---|
| 108 | #define SNDRV_SEQ_EVENT_USR8 98
|
|---|
| 109 | #define SNDRV_SEQ_EVENT_USR9 99
|
|---|
| 110 |
|
|---|
| 111 | /* 100-118: instrument layer - obsoleted */
|
|---|
| 112 | /* 119-129: reserved */
|
|---|
| 113 |
|
|---|
| 114 | /* 130-139: variable length events
|
|---|
| 115 | * event data type = snd_seq_ev_ext
|
|---|
| 116 | * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
|
|---|
| 117 | */
|
|---|
| 118 | #define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
|
|---|
| 119 | #define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
|
|---|
| 120 | /* 132-134: reserved */
|
|---|
| 121 | #define SNDRV_SEQ_EVENT_USR_VAR0 135
|
|---|
| 122 | #define SNDRV_SEQ_EVENT_USR_VAR1 136
|
|---|
| 123 | #define SNDRV_SEQ_EVENT_USR_VAR2 137
|
|---|
| 124 | #define SNDRV_SEQ_EVENT_USR_VAR3 138
|
|---|
| 125 | #define SNDRV_SEQ_EVENT_USR_VAR4 139
|
|---|
| 126 |
|
|---|
| 127 | /* 150-151: kernel events with quote - DO NOT use in user clients */
|
|---|
| 128 | #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
|
|---|
| 129 | #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
|
|---|
| 130 |
|
|---|
| 131 | /* 152-191: reserved */
|
|---|
| 132 |
|
|---|
| 133 | /* 192-254: hardware specific events */
|
|---|
| 134 |
|
|---|
| 135 | /* 255: special event */
|
|---|
| 136 | #define SNDRV_SEQ_EVENT_NONE 255
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 | typedef unsigned char snd_seq_event_type_t;
|
|---|
| 140 |
|
|---|
| 141 | /** event address */
|
|---|
| 142 | struct snd_seq_addr {
|
|---|
| 143 | unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
|
|---|
| 144 | unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
|
|---|
| 145 | };
|
|---|
| 146 |
|
|---|
| 147 | /** port connection */
|
|---|
| 148 | struct snd_seq_connect {
|
|---|
| 149 | struct snd_seq_addr sender;
|
|---|
| 150 | struct snd_seq_addr dest;
|
|---|
| 151 | };
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 | #define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
|
|---|
| 155 | #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
|
|---|
| 156 | #define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
|
|---|
| 157 | #define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
|
|---|
| 158 |
|
|---|
| 159 | /* event mode flag - NOTE: only 8 bits available! */
|
|---|
| 160 | #define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
|
|---|
| 161 | #define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
|
|---|
| 162 | #define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
|
|---|
| 163 |
|
|---|
| 164 | #define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
|
|---|
| 165 | #define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
|
|---|
| 166 | #define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
|
|---|
| 167 |
|
|---|
| 168 | #define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
|
|---|
| 169 | #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
|
|---|
| 170 | #define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
|
|---|
| 171 | #define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
|
|---|
| 172 |
|
|---|
| 173 | #define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
|
|---|
| 174 | #define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
|
|---|
| 175 | #define SNDRV_SEQ_PRIORITY_MASK (1<<4)
|
|---|
| 176 |
|
|---|
| 177 | #define SNDRV_SEQ_EVENT_UMP (1<<5) /* event holds a UMP packet */
|
|---|
| 178 |
|
|---|
| 179 | /* note event */
|
|---|
| 180 | struct snd_seq_ev_note {
|
|---|
| 181 | unsigned char channel;
|
|---|
| 182 | unsigned char note;
|
|---|
| 183 | unsigned char velocity;
|
|---|
| 184 | unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
|
|---|
| 185 | unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
|
|---|
| 186 | };
|
|---|
| 187 |
|
|---|
| 188 | /* controller event */
|
|---|
| 189 | struct snd_seq_ev_ctrl {
|
|---|
| 190 | unsigned char channel;
|
|---|
| 191 | unsigned char unused1, unused2, unused3; /* pad */
|
|---|
| 192 | unsigned int param;
|
|---|
| 193 | signed int value;
|
|---|
| 194 | };
|
|---|
| 195 |
|
|---|
| 196 | /* generic set of bytes (12x8 bit) */
|
|---|
| 197 | struct snd_seq_ev_raw8 {
|
|---|
| 198 | unsigned char d[12]; /* 8 bit value */
|
|---|
| 199 | };
|
|---|
| 200 |
|
|---|
| 201 | /* generic set of integers (3x32 bit) */
|
|---|
| 202 | struct snd_seq_ev_raw32 {
|
|---|
| 203 | unsigned int d[3]; /* 32 bit value */
|
|---|
| 204 | };
|
|---|
| 205 |
|
|---|
| 206 | /* external stored data */
|
|---|
| 207 | #ifndef TARGET_OS2
|
|---|
| 208 | struct snd_seq_ev_ext {
|
|---|
| 209 | unsigned int len; /* length of data */
|
|---|
| 210 | void *ptr; /* pointer to data (note: maybe 64-bit) */
|
|---|
| 211 | } __packed;
|
|---|
| 212 | #else
|
|---|
| 213 | #pragma pack(1)
|
|---|
| 214 | struct snd_seq_ev_ext {
|
|---|
| 215 | unsigned int len; /* length of data */
|
|---|
| 216 | void *ptr; /* pointer to data (note: maybe 64-bit) */
|
|---|
| 217 | };
|
|---|
| 218 | #pragma pack()
|
|---|
| 219 | #endif
|
|---|
| 220 |
|
|---|
| 221 | struct snd_seq_result {
|
|---|
| 222 | int event; /* processed event type */
|
|---|
| 223 | int result;
|
|---|
| 224 | };
|
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 | struct snd_seq_real_time {
|
|---|
| 228 | unsigned int tv_sec; /* seconds */
|
|---|
| 229 | unsigned int tv_nsec; /* nanoseconds */
|
|---|
| 230 | };
|
|---|
| 231 |
|
|---|
| 232 | typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
|
|---|
| 233 |
|
|---|
| 234 | union snd_seq_timestamp {
|
|---|
| 235 | snd_seq_tick_time_t tick;
|
|---|
| 236 | struct snd_seq_real_time time;
|
|---|
| 237 | };
|
|---|
| 238 |
|
|---|
| 239 | struct snd_seq_queue_skew {
|
|---|
| 240 | unsigned int value;
|
|---|
| 241 | unsigned int base;
|
|---|
| 242 | };
|
|---|
| 243 |
|
|---|
| 244 | /* queue timer control */
|
|---|
| 245 | struct snd_seq_ev_queue_control {
|
|---|
| 246 | unsigned char queue; /* affected queue */
|
|---|
| 247 | unsigned char pad[3]; /* reserved */
|
|---|
| 248 | union {
|
|---|
| 249 | signed int value; /* affected value (e.g. tempo) */
|
|---|
| 250 | union snd_seq_timestamp time; /* time */
|
|---|
| 251 | unsigned int position; /* sync position */
|
|---|
| 252 | struct snd_seq_queue_skew skew;
|
|---|
| 253 | unsigned int d32[2];
|
|---|
| 254 | unsigned char d8[8];
|
|---|
| 255 | } param;
|
|---|
| 256 | };
|
|---|
| 257 |
|
|---|
| 258 | /* quoted event - inside the kernel only */
|
|---|
| 259 | #ifndef TARGET_OS2
|
|---|
| 260 | struct snd_seq_ev_quote {
|
|---|
| 261 | struct snd_seq_addr origin; /* original sender */
|
|---|
| 262 | unsigned short value; /* optional data */
|
|---|
| 263 | struct snd_seq_event *event; /* quoted event */
|
|---|
| 264 | } __packed;
|
|---|
| 265 | #else
|
|---|
| 266 | #pragma pack(1)
|
|---|
| 267 | struct snd_seq_ev_quote {
|
|---|
| 268 | struct snd_seq_addr origin; /* original sender */
|
|---|
| 269 | unsigned short value; /* optional data */
|
|---|
| 270 | struct snd_seq_event *event; /* quoted event */
|
|---|
| 271 | };
|
|---|
| 272 | #pragma pack()
|
|---|
| 273 | #endif
|
|---|
| 274 |
|
|---|
| 275 | union snd_seq_event_data { /* event data... */
|
|---|
| 276 | struct snd_seq_ev_note note;
|
|---|
| 277 | struct snd_seq_ev_ctrl control;
|
|---|
| 278 | struct snd_seq_ev_raw8 raw8;
|
|---|
| 279 | struct snd_seq_ev_raw32 raw32;
|
|---|
| 280 | struct snd_seq_ev_ext ext;
|
|---|
| 281 | struct snd_seq_ev_queue_control queue;
|
|---|
| 282 | union snd_seq_timestamp time;
|
|---|
| 283 | struct snd_seq_addr addr;
|
|---|
| 284 | struct snd_seq_connect connect;
|
|---|
| 285 | struct snd_seq_result result;
|
|---|
| 286 | struct snd_seq_ev_quote quote;
|
|---|
| 287 | };
|
|---|
| 288 |
|
|---|
| 289 | /* sequencer event */
|
|---|
| 290 | struct snd_seq_event {
|
|---|
| 291 | snd_seq_event_type_t type; /* event type */
|
|---|
| 292 | unsigned char flags; /* event flags */
|
|---|
| 293 | char tag;
|
|---|
| 294 |
|
|---|
| 295 | unsigned char queue; /* schedule queue */
|
|---|
| 296 | union snd_seq_timestamp time; /* schedule time */
|
|---|
| 297 |
|
|---|
| 298 | struct snd_seq_addr source; /* source address */
|
|---|
| 299 | struct snd_seq_addr dest; /* destination address */
|
|---|
| 300 |
|
|---|
| 301 | union snd_seq_event_data data;
|
|---|
| 302 | };
|
|---|
| 303 |
|
|---|
| 304 | /* (compatible) event for UMP-capable clients */
|
|---|
| 305 | struct snd_seq_ump_event {
|
|---|
| 306 | snd_seq_event_type_t type; /* event type */
|
|---|
| 307 | unsigned char flags; /* event flags */
|
|---|
| 308 | char tag;
|
|---|
| 309 | unsigned char queue; /* schedule queue */
|
|---|
| 310 | union snd_seq_timestamp time; /* schedule time */
|
|---|
| 311 | struct snd_seq_addr source; /* source address */
|
|---|
| 312 | struct snd_seq_addr dest; /* destination address */
|
|---|
| 313 |
|
|---|
| 314 | union {
|
|---|
| 315 | union snd_seq_event_data data;
|
|---|
| 316 | unsigned int ump[4];
|
|---|
| 317 | };
|
|---|
| 318 | };
|
|---|
| 319 |
|
|---|
| 320 | /*
|
|---|
| 321 | * bounce event - stored as variable size data
|
|---|
| 322 | */
|
|---|
| 323 | struct snd_seq_event_bounce {
|
|---|
| 324 | int err;
|
|---|
| 325 | struct snd_seq_event event;
|
|---|
| 326 | /* external data follows here. */
|
|---|
| 327 | };
|
|---|
| 328 |
|
|---|
| 329 |
|
|---|
| 330 | /* system information */
|
|---|
| 331 | struct snd_seq_system_info {
|
|---|
| 332 | int queues; /* maximum queues count */
|
|---|
| 333 | int clients; /* maximum clients count */
|
|---|
| 334 | int ports; /* maximum ports per client */
|
|---|
| 335 | int channels; /* maximum channels per port */
|
|---|
| 336 | int cur_clients; /* current clients */
|
|---|
| 337 | int cur_queues; /* current queues */
|
|---|
| 338 | char reserved[24];
|
|---|
| 339 | };
|
|---|
| 340 |
|
|---|
| 341 |
|
|---|
| 342 | /* system running information */
|
|---|
| 343 | struct snd_seq_running_info {
|
|---|
| 344 | unsigned char client; /* client id */
|
|---|
| 345 | unsigned char big_endian; /* 1 = big-endian */
|
|---|
| 346 | unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
|
|---|
| 347 | unsigned char pad; /* reserved */
|
|---|
| 348 | unsigned char reserved[12];
|
|---|
| 349 | };
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 | /* known client numbers */
|
|---|
| 353 | #define SNDRV_SEQ_CLIENT_SYSTEM 0
|
|---|
| 354 | /* internal client numbers */
|
|---|
| 355 | #define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
|
|---|
| 356 | #define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 | /* client types */
|
|---|
| 360 | typedef int __bitwise snd_seq_client_type_t;
|
|---|
| 361 | #define NO_CLIENT ((__force snd_seq_client_type_t) 0)
|
|---|
| 362 | #define USER_CLIENT ((__force snd_seq_client_type_t) 1)
|
|---|
| 363 | #define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
|
|---|
| 364 |
|
|---|
| 365 | /* event filter flags */
|
|---|
| 366 | #define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */
|
|---|
| 367 | #define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */
|
|---|
| 368 | #define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */
|
|---|
| 369 | #define SNDRV_SEQ_FILTER_NO_CONVERT (1U<<30) /* don't convert UMP events */
|
|---|
| 370 | #define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */
|
|---|
| 371 |
|
|---|
| 372 | struct snd_seq_client_info {
|
|---|
| 373 | int client; /* client number to inquire */
|
|---|
| 374 | snd_seq_client_type_t type; /* client type */
|
|---|
| 375 | char name[64]; /* client name */
|
|---|
| 376 | unsigned int filter; /* filter flags */
|
|---|
| 377 | unsigned char multicast_filter[8]; /* multicast filter bitmap */
|
|---|
| 378 | unsigned char event_filter[32]; /* event filter bitmap */
|
|---|
| 379 | int num_ports; /* RO: number of ports */
|
|---|
| 380 | int event_lost; /* number of lost events */
|
|---|
| 381 | int card; /* RO: card number[kernel] */
|
|---|
| 382 | int pid; /* RO: pid[user] */
|
|---|
| 383 | unsigned int midi_version; /* MIDI version */
|
|---|
| 384 | unsigned int group_filter; /* UMP group filter bitmap
|
|---|
| 385 | * (bit 0 = groupless messages,
|
|---|
| 386 | * bit 1-16 = messages for groups 1-16)
|
|---|
| 387 | */
|
|---|
| 388 | char reserved[48]; /* for future use */
|
|---|
| 389 | };
|
|---|
| 390 |
|
|---|
| 391 | /* MIDI version numbers in client info */
|
|---|
| 392 | #define SNDRV_SEQ_CLIENT_LEGACY_MIDI 0 /* Legacy client */
|
|---|
| 393 | #define SNDRV_SEQ_CLIENT_UMP_MIDI_1_0 1 /* UMP MIDI 1.0 */
|
|---|
| 394 | #define SNDRV_SEQ_CLIENT_UMP_MIDI_2_0 2 /* UMP MIDI 2.0 */
|
|---|
| 395 |
|
|---|
| 396 | /* client pool size */
|
|---|
| 397 | struct snd_seq_client_pool {
|
|---|
| 398 | int client; /* client number to inquire */
|
|---|
| 399 | int output_pool; /* outgoing (write) pool size */
|
|---|
| 400 | int input_pool; /* incoming (read) pool size */
|
|---|
| 401 | int output_room; /* minimum free pool size for select/blocking mode */
|
|---|
| 402 | int output_free; /* unused size */
|
|---|
| 403 | int input_free; /* unused size */
|
|---|
| 404 | char reserved[64];
|
|---|
| 405 | };
|
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 | /* Remove events by specified criteria */
|
|---|
| 409 |
|
|---|
| 410 | #define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
|
|---|
| 411 | #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
|
|---|
| 412 | #define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
|
|---|
| 413 | #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
|
|---|
| 414 | #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
|
|---|
| 415 | #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
|
|---|
| 416 | #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
|
|---|
| 417 | #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
|
|---|
| 418 | #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
|
|---|
| 419 | #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
|
|---|
| 420 |
|
|---|
| 421 | struct snd_seq_remove_events {
|
|---|
| 422 | unsigned int remove_mode; /* Flags that determine what gets removed */
|
|---|
| 423 |
|
|---|
| 424 | union snd_seq_timestamp time;
|
|---|
| 425 |
|
|---|
| 426 | unsigned char queue; /* Queue for REMOVE_DEST */
|
|---|
| 427 | struct snd_seq_addr dest; /* Address for REMOVE_DEST */
|
|---|
| 428 | unsigned char channel; /* Channel for REMOVE_DEST */
|
|---|
| 429 |
|
|---|
| 430 | int type; /* For REMOVE_EVENT_TYPE */
|
|---|
| 431 | char tag; /* Tag for REMOVE_TAG */
|
|---|
| 432 |
|
|---|
| 433 | int reserved[10]; /* To allow for future binary compatibility */
|
|---|
| 434 |
|
|---|
| 435 | };
|
|---|
| 436 |
|
|---|
| 437 |
|
|---|
| 438 | /* known port numbers */
|
|---|
| 439 | #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
|
|---|
| 440 | #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
|
|---|
| 441 |
|
|---|
| 442 | /* port capabilities (32 bits) */
|
|---|
| 443 | #define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
|
|---|
| 444 | #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
|
|---|
| 445 |
|
|---|
| 446 | #define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
|
|---|
| 447 | #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
|
|---|
| 448 |
|
|---|
| 449 | #define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
|
|---|
| 450 |
|
|---|
| 451 | #define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
|
|---|
| 452 | #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
|
|---|
| 453 | #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
|
|---|
| 454 | #define SNDRV_SEQ_PORT_CAP_INACTIVE (1<<8) /* inactive port */
|
|---|
| 455 | #define SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT (1<<9) /* MIDI 2.0 UMP Endpoint port */
|
|---|
| 456 |
|
|---|
| 457 | /* port type */
|
|---|
| 458 | #define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
|
|---|
| 459 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
|
|---|
| 460 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
|
|---|
| 461 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
|
|---|
| 462 | #define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
|
|---|
| 463 | #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
|
|---|
| 464 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
|
|---|
| 465 | #define SNDRV_SEQ_PORT_TYPE_MIDI_UMP (1<<7) /* UMP */
|
|---|
| 466 |
|
|---|
| 467 | /* other standards...*/
|
|---|
| 468 | #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
|
|---|
| 469 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
|
|---|
| 470 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
|
|---|
| 471 | /*...*/
|
|---|
| 472 | #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
|
|---|
| 473 | #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
|
|---|
| 474 | #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
|
|---|
| 475 | #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
|
|---|
| 476 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
|
|---|
| 477 |
|
|---|
| 478 | /* misc. conditioning flags */
|
|---|
| 479 | #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
|
|---|
| 480 | #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
|
|---|
| 481 | #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
|
|---|
| 482 |
|
|---|
| 483 | #define SNDRV_SEQ_PORT_FLG_IS_MIDI1 (1<<3) /* Keep MIDI 1.0 protocol */
|
|---|
| 484 |
|
|---|
| 485 | /* port direction */
|
|---|
| 486 | #define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
|
|---|
| 487 | #define SNDRV_SEQ_PORT_DIR_INPUT 1
|
|---|
| 488 | #define SNDRV_SEQ_PORT_DIR_OUTPUT 2
|
|---|
| 489 | #define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3
|
|---|
| 490 |
|
|---|
| 491 | struct snd_seq_port_info {
|
|---|
| 492 | struct snd_seq_addr addr; /* client/port numbers */
|
|---|
| 493 | char name[64]; /* port name */
|
|---|
| 494 |
|
|---|
| 495 | unsigned int capability; /* port capability bits */
|
|---|
| 496 | unsigned int type; /* port type bits */
|
|---|
| 497 | int midi_channels; /* channels per MIDI port */
|
|---|
| 498 | int midi_voices; /* voices per MIDI port */
|
|---|
| 499 | int synth_voices; /* voices per SYNTH port */
|
|---|
| 500 |
|
|---|
| 501 | int read_use; /* R/O: subscribers for output (from this port) */
|
|---|
| 502 | int write_use; /* R/O: subscribers for input (to this port) */
|
|---|
| 503 |
|
|---|
| 504 | void *kernel; /* reserved for kernel use (must be NULL) */
|
|---|
| 505 | unsigned int flags; /* misc. conditioning */
|
|---|
| 506 | unsigned char time_queue; /* queue # for timestamping */
|
|---|
| 507 | unsigned char direction; /* port usage direction (r/w/bidir) */
|
|---|
| 508 | unsigned char ump_group; /* 0 = UMP EP (no conversion), 1-16 = UMP group number */
|
|---|
| 509 | char reserved[57]; /* for future use */
|
|---|
| 510 | };
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 | /* queue flags */
|
|---|
| 514 | #define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
|
|---|
| 515 |
|
|---|
| 516 | /* queue information */
|
|---|
| 517 | struct snd_seq_queue_info {
|
|---|
| 518 | int queue; /* queue id */
|
|---|
| 519 |
|
|---|
| 520 | /*
|
|---|
| 521 | * security settings, only owner of this queue can start/stop timer
|
|---|
| 522 | * etc. if the queue is locked for other clients
|
|---|
| 523 | */
|
|---|
| 524 | int owner; /* client id for owner of the queue */
|
|---|
| 525 | unsigned locked:1; /* timing queue locked for other queues */
|
|---|
| 526 | char name[64]; /* name of this queue */
|
|---|
| 527 | unsigned int flags; /* flags */
|
|---|
| 528 | char reserved[60]; /* for future use */
|
|---|
| 529 |
|
|---|
| 530 | };
|
|---|
| 531 |
|
|---|
| 532 | /* queue info/status */
|
|---|
| 533 | struct snd_seq_queue_status {
|
|---|
| 534 | int queue; /* queue id */
|
|---|
| 535 | int events; /* read-only - queue size */
|
|---|
| 536 | snd_seq_tick_time_t tick; /* current tick */
|
|---|
| 537 | struct snd_seq_real_time time; /* current time */
|
|---|
| 538 | int running; /* running state of queue */
|
|---|
| 539 | int flags; /* various flags */
|
|---|
| 540 | char reserved[64]; /* for the future */
|
|---|
| 541 | };
|
|---|
| 542 |
|
|---|
| 543 |
|
|---|
| 544 | /* queue tempo */
|
|---|
| 545 | struct snd_seq_queue_tempo {
|
|---|
| 546 | int queue; /* sequencer queue */
|
|---|
| 547 | unsigned int tempo; /* current tempo, us/tick (or different time-base below) */
|
|---|
| 548 | int ppq; /* time resolution, ticks/quarter */
|
|---|
| 549 | unsigned int skew_value; /* queue skew */
|
|---|
| 550 | unsigned int skew_base; /* queue skew base */
|
|---|
| 551 | unsigned short tempo_base; /* tempo base in nsec unit; either 10 or 1000 */
|
|---|
| 552 | char reserved[22]; /* for the future */
|
|---|
| 553 | };
|
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 | /* sequencer timer sources */
|
|---|
| 557 | #define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
|
|---|
| 558 | #define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
|
|---|
| 559 | #define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
|
|---|
| 560 |
|
|---|
| 561 | /* queue timer info */
|
|---|
| 562 | struct snd_seq_queue_timer {
|
|---|
| 563 | int queue; /* sequencer queue */
|
|---|
| 564 | int type; /* source timer type */
|
|---|
| 565 | union {
|
|---|
| 566 | struct {
|
|---|
| 567 | struct snd_timer_id id; /* ALSA's timer ID */
|
|---|
| 568 | unsigned int resolution; /* resolution in Hz */
|
|---|
| 569 | } alsa;
|
|---|
| 570 | } u;
|
|---|
| 571 | char reserved[64]; /* for the future use */
|
|---|
| 572 | };
|
|---|
| 573 |
|
|---|
| 574 |
|
|---|
| 575 | struct snd_seq_queue_client {
|
|---|
| 576 | int queue; /* sequencer queue */
|
|---|
| 577 | int client; /* sequencer client */
|
|---|
| 578 | int used; /* queue is used with this client
|
|---|
| 579 | (must be set for accepting events) */
|
|---|
| 580 | /* per client watermarks */
|
|---|
| 581 | char reserved[64]; /* for future use */
|
|---|
| 582 | };
|
|---|
| 583 |
|
|---|
| 584 |
|
|---|
| 585 | #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
|
|---|
| 586 | #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
|
|---|
| 587 | #define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
|
|---|
| 588 |
|
|---|
| 589 | struct snd_seq_port_subscribe {
|
|---|
| 590 | struct snd_seq_addr sender; /* sender address */
|
|---|
| 591 | struct snd_seq_addr dest; /* destination address */
|
|---|
| 592 | unsigned int voices; /* number of voices to be allocated (0 = don't care) */
|
|---|
| 593 | unsigned int flags; /* modes */
|
|---|
| 594 | unsigned char queue; /* input time-stamp queue (optional) */
|
|---|
| 595 | unsigned char pad[3]; /* reserved */
|
|---|
| 596 | char reserved[64];
|
|---|
| 597 | };
|
|---|
| 598 |
|
|---|
| 599 | /* type of query subscription */
|
|---|
| 600 | #define SNDRV_SEQ_QUERY_SUBS_READ 0
|
|---|
| 601 | #define SNDRV_SEQ_QUERY_SUBS_WRITE 1
|
|---|
| 602 |
|
|---|
| 603 | struct snd_seq_query_subs {
|
|---|
| 604 | struct snd_seq_addr root; /* client/port id to be searched */
|
|---|
| 605 | int type; /* READ or WRITE */
|
|---|
| 606 | int index; /* 0..N-1 */
|
|---|
| 607 | int num_subs; /* R/O: number of subscriptions on this port */
|
|---|
| 608 | struct snd_seq_addr addr; /* R/O: result */
|
|---|
| 609 | unsigned char queue; /* R/O: result */
|
|---|
| 610 | unsigned int flags; /* R/O: result */
|
|---|
| 611 | char reserved[64]; /* for future use */
|
|---|
| 612 | };
|
|---|
| 613 |
|
|---|
| 614 | /*
|
|---|
| 615 | * UMP-specific information
|
|---|
| 616 | */
|
|---|
| 617 | /* type of UMP info query */
|
|---|
| 618 | #define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT 0
|
|---|
| 619 | #define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK 1
|
|---|
| 620 |
|
|---|
| 621 | struct snd_seq_client_ump_info {
|
|---|
| 622 | int client; /* client number to inquire/set */
|
|---|
| 623 | int type; /* type to inquire/set */
|
|---|
| 624 | unsigned char info[512]; /* info (either UMP ep or block info) */
|
|---|
| 625 | } __packed;
|
|---|
| 626 |
|
|---|
| 627 | /*
|
|---|
| 628 | * IOCTL commands
|
|---|
| 629 | */
|
|---|
| 630 |
|
|---|
| 631 | #define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
|
|---|
| 632 | #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
|
|---|
| 633 | #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
|
|---|
| 634 | #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
|
|---|
| 635 | #define SNDRV_SEQ_IOCTL_USER_PVERSION _IOW('S', 0x04, int)
|
|---|
| 636 |
|
|---|
| 637 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
|
|---|
| 638 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
|
|---|
| 639 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO _IOWR('S', 0x12, struct snd_seq_client_ump_info)
|
|---|
| 640 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO _IOWR('S', 0x13, struct snd_seq_client_ump_info)
|
|---|
| 641 |
|
|---|
| 642 | #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
|
|---|
| 643 | #define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
|
|---|
| 644 | #define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
|
|---|
| 645 | #define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
|
|---|
| 646 |
|
|---|
| 647 | #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
|
|---|
| 648 | #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
|
|---|
| 649 |
|
|---|
| 650 | #define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
|
|---|
| 651 | #define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
|
|---|
| 652 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
|
|---|
| 653 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
|
|---|
| 654 | #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
|
|---|
| 655 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
|
|---|
| 656 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
|
|---|
| 657 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
|
|---|
| 658 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
|
|---|
| 659 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
|
|---|
| 660 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
|
|---|
| 661 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
|
|---|
| 662 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
|
|---|
| 663 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
|
|---|
| 664 | #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
|
|---|
| 665 | #define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
|
|---|
| 666 | #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
|
|---|
| 667 | #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
|
|---|
| 668 | #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
|
|---|
| 669 |
|
|---|
| 670 | #endif /* _UAPI__SOUND_ASEQUENCER_H */
|
|---|