blob: a3826a5853e876bc45467f483217377bfde58edf [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI__SOUND_ASEQUENCER_H
8#define _UAPI__SOUND_ASEQUENCER_H
Christopher Ferris05d08e92016-02-04 13:16:38 -08009#include <sound/asound.h>
Christopher Ferris63fcca42024-09-26 01:12:10 +000010#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
Christopher Ferris05d08e92016-02-04 13:16:38 -080011#define SNDRV_SEQ_EVENT_SYSTEM 0
Ben Cheng655a7c02013-10-16 16:09:24 -070012#define SNDRV_SEQ_EVENT_RESULT 1
13#define SNDRV_SEQ_EVENT_NOTE 5
14#define SNDRV_SEQ_EVENT_NOTEON 6
Christopher Ferris05d08e92016-02-04 13:16:38 -080015#define SNDRV_SEQ_EVENT_NOTEOFF 7
Ben Cheng655a7c02013-10-16 16:09:24 -070016#define SNDRV_SEQ_EVENT_KEYPRESS 8
17#define SNDRV_SEQ_EVENT_CONTROLLER 10
18#define SNDRV_SEQ_EVENT_PGMCHANGE 11
Christopher Ferris05d08e92016-02-04 13:16:38 -080019#define SNDRV_SEQ_EVENT_CHANPRESS 12
Ben Cheng655a7c02013-10-16 16:09:24 -070020#define SNDRV_SEQ_EVENT_PITCHBEND 13
21#define SNDRV_SEQ_EVENT_CONTROL14 14
22#define SNDRV_SEQ_EVENT_NONREGPARAM 15
Christopher Ferris05d08e92016-02-04 13:16:38 -080023#define SNDRV_SEQ_EVENT_REGPARAM 16
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define SNDRV_SEQ_EVENT_SONGPOS 20
25#define SNDRV_SEQ_EVENT_SONGSEL 21
26#define SNDRV_SEQ_EVENT_QFRAME 22
Christopher Ferris05d08e92016-02-04 13:16:38 -080027#define SNDRV_SEQ_EVENT_TIMESIGN 23
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define SNDRV_SEQ_EVENT_KEYSIGN 24
29#define SNDRV_SEQ_EVENT_START 30
30#define SNDRV_SEQ_EVENT_CONTINUE 31
Christopher Ferris05d08e92016-02-04 13:16:38 -080031#define SNDRV_SEQ_EVENT_STOP 32
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define SNDRV_SEQ_EVENT_SETPOS_TICK 33
33#define SNDRV_SEQ_EVENT_SETPOS_TIME 34
34#define SNDRV_SEQ_EVENT_TEMPO 35
Christopher Ferris05d08e92016-02-04 13:16:38 -080035#define SNDRV_SEQ_EVENT_CLOCK 36
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define SNDRV_SEQ_EVENT_TICK 37
37#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38
38#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40
Christopher Ferris05d08e92016-02-04 13:16:38 -080039#define SNDRV_SEQ_EVENT_RESET 41
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define SNDRV_SEQ_EVENT_SENSING 42
41#define SNDRV_SEQ_EVENT_ECHO 50
42#define SNDRV_SEQ_EVENT_OSS 51
Christopher Ferris05d08e92016-02-04 13:16:38 -080043#define SNDRV_SEQ_EVENT_CLIENT_START 60
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61
45#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62
46#define SNDRV_SEQ_EVENT_PORT_START 63
Christopher Ferris05d08e92016-02-04 13:16:38 -080047#define SNDRV_SEQ_EVENT_PORT_EXIT 64
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define SNDRV_SEQ_EVENT_PORT_CHANGE 65
49#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66
50#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67
Christopher Ferris05d08e92016-02-04 13:16:38 -080051#define SNDRV_SEQ_EVENT_USR0 90
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define SNDRV_SEQ_EVENT_USR1 91
53#define SNDRV_SEQ_EVENT_USR2 92
54#define SNDRV_SEQ_EVENT_USR3 93
Christopher Ferris05d08e92016-02-04 13:16:38 -080055#define SNDRV_SEQ_EVENT_USR4 94
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define SNDRV_SEQ_EVENT_USR5 95
57#define SNDRV_SEQ_EVENT_USR6 96
58#define SNDRV_SEQ_EVENT_USR7 97
Christopher Ferris05d08e92016-02-04 13:16:38 -080059#define SNDRV_SEQ_EVENT_USR8 98
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define SNDRV_SEQ_EVENT_USR9 99
61#define SNDRV_SEQ_EVENT_SYSEX 130
62#define SNDRV_SEQ_EVENT_BOUNCE 131
Christopher Ferris05d08e92016-02-04 13:16:38 -080063#define SNDRV_SEQ_EVENT_USR_VAR0 135
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define SNDRV_SEQ_EVENT_USR_VAR1 136
65#define SNDRV_SEQ_EVENT_USR_VAR2 137
66#define SNDRV_SEQ_EVENT_USR_VAR3 138
Christopher Ferris05d08e92016-02-04 13:16:38 -080067#define SNDRV_SEQ_EVENT_USR_VAR4 139
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
69#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151
70#define SNDRV_SEQ_EVENT_NONE 255
Christopher Ferris05d08e92016-02-04 13:16:38 -080071typedef unsigned char snd_seq_event_type_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070072struct snd_seq_addr {
Tao Baod7db5942015-01-28 10:07:51 -080073 unsigned char client;
74 unsigned char port;
Christopher Ferris05d08e92016-02-04 13:16:38 -080075};
Ben Cheng655a7c02013-10-16 16:09:24 -070076struct snd_seq_connect {
Tao Baod7db5942015-01-28 10:07:51 -080077 struct snd_seq_addr sender;
78 struct snd_seq_addr dest;
Christopher Ferris05d08e92016-02-04 13:16:38 -080079};
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define SNDRV_SEQ_ADDRESS_UNKNOWN 253
81#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254
82#define SNDRV_SEQ_ADDRESS_BROADCAST 255
Christopher Ferris05d08e92016-02-04 13:16:38 -080083#define SNDRV_SEQ_QUEUE_DIRECT 253
Tao Baod7db5942015-01-28 10:07:51 -080084#define SNDRV_SEQ_TIME_STAMP_TICK (0 << 0)
85#define SNDRV_SEQ_TIME_STAMP_REAL (1 << 0)
86#define SNDRV_SEQ_TIME_STAMP_MASK (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080087#define SNDRV_SEQ_TIME_MODE_ABS (0 << 1)
Tao Baod7db5942015-01-28 10:07:51 -080088#define SNDRV_SEQ_TIME_MODE_REL (1 << 1)
89#define SNDRV_SEQ_TIME_MODE_MASK (1 << 1)
90#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -080091#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1 << 2)
Tao Baod7db5942015-01-28 10:07:51 -080092#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2 << 2)
93#define SNDRV_SEQ_EVENT_LENGTH_MASK (3 << 2)
94#define SNDRV_SEQ_PRIORITY_NORMAL (0 << 4)
Christopher Ferris05d08e92016-02-04 13:16:38 -080095#define SNDRV_SEQ_PRIORITY_HIGH (1 << 4)
Tao Baod7db5942015-01-28 10:07:51 -080096#define SNDRV_SEQ_PRIORITY_MASK (1 << 4)
Christopher Ferris8666d042023-09-06 14:55:31 -070097#define SNDRV_SEQ_EVENT_UMP (1 << 5)
Ben Cheng655a7c02013-10-16 16:09:24 -070098struct snd_seq_ev_note {
Tao Baod7db5942015-01-28 10:07:51 -080099 unsigned char channel;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800100 unsigned char note;
Tao Baod7db5942015-01-28 10:07:51 -0800101 unsigned char velocity;
102 unsigned char off_velocity;
103 unsigned int duration;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800104};
Ben Cheng655a7c02013-10-16 16:09:24 -0700105struct snd_seq_ev_ctrl {
Tao Baod7db5942015-01-28 10:07:51 -0800106 unsigned char channel;
107 unsigned char unused1, unused2, unused3;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800108 unsigned int param;
Tao Baod7db5942015-01-28 10:07:51 -0800109 signed int value;
Ben Cheng655a7c02013-10-16 16:09:24 -0700110};
111struct snd_seq_ev_raw8 {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800112 unsigned char d[12];
Ben Cheng655a7c02013-10-16 16:09:24 -0700113};
114struct snd_seq_ev_raw32 {
Tao Baod7db5942015-01-28 10:07:51 -0800115 unsigned int d[3];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800116};
Ben Cheng655a7c02013-10-16 16:09:24 -0700117struct snd_seq_ev_ext {
Tao Baod7db5942015-01-28 10:07:51 -0800118 unsigned int len;
119 void * ptr;
Christopher Ferris0f795212024-01-17 14:17:28 -0800120} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700121struct snd_seq_result {
Tao Baod7db5942015-01-28 10:07:51 -0800122 int event;
123 int result;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800124};
Ben Cheng655a7c02013-10-16 16:09:24 -0700125struct snd_seq_real_time {
Tao Baod7db5942015-01-28 10:07:51 -0800126 unsigned int tv_sec;
127 unsigned int tv_nsec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128};
Ben Cheng655a7c02013-10-16 16:09:24 -0700129typedef unsigned int snd_seq_tick_time_t;
130union snd_seq_timestamp {
Tao Baod7db5942015-01-28 10:07:51 -0800131 snd_seq_tick_time_t tick;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800132 struct snd_seq_real_time time;
Ben Cheng655a7c02013-10-16 16:09:24 -0700133};
134struct snd_seq_queue_skew {
Tao Baod7db5942015-01-28 10:07:51 -0800135 unsigned int value;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800136 unsigned int base;
Ben Cheng655a7c02013-10-16 16:09:24 -0700137};
138struct snd_seq_ev_queue_control {
Tao Baod7db5942015-01-28 10:07:51 -0800139 unsigned char queue;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800140 unsigned char pad[3];
Tao Baod7db5942015-01-28 10:07:51 -0800141 union {
142 signed int value;
143 union snd_seq_timestamp time;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800144 unsigned int position;
Tao Baod7db5942015-01-28 10:07:51 -0800145 struct snd_seq_queue_skew skew;
146 unsigned int d32[2];
147 unsigned char d8[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148 } param;
Ben Cheng655a7c02013-10-16 16:09:24 -0700149};
150struct snd_seq_ev_quote {
Tao Baod7db5942015-01-28 10:07:51 -0800151 struct snd_seq_addr origin;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800152 unsigned short value;
Tao Baod7db5942015-01-28 10:07:51 -0800153 struct snd_seq_event * event;
Christopher Ferris0f795212024-01-17 14:17:28 -0800154} __attribute__((__packed__));
Christopher Ferris8666d042023-09-06 14:55:31 -0700155union snd_seq_event_data {
156 struct snd_seq_ev_note note;
157 struct snd_seq_ev_ctrl control;
158 struct snd_seq_ev_raw8 raw8;
159 struct snd_seq_ev_raw32 raw32;
160 struct snd_seq_ev_ext ext;
161 struct snd_seq_ev_queue_control queue;
162 union snd_seq_timestamp time;
163 struct snd_seq_addr addr;
164 struct snd_seq_connect connect;
165 struct snd_seq_result result;
166 struct snd_seq_ev_quote quote;
167};
Ben Cheng655a7c02013-10-16 16:09:24 -0700168struct snd_seq_event {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800169 snd_seq_event_type_t type;
Tao Baod7db5942015-01-28 10:07:51 -0800170 unsigned char flags;
171 char tag;
172 unsigned char queue;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800173 union snd_seq_timestamp time;
Tao Baod7db5942015-01-28 10:07:51 -0800174 struct snd_seq_addr source;
175 struct snd_seq_addr dest;
Christopher Ferris8666d042023-09-06 14:55:31 -0700176 union snd_seq_event_data data;
177};
178struct snd_seq_ump_event {
179 snd_seq_event_type_t type;
180 unsigned char flags;
181 char tag;
182 unsigned char queue;
183 union snd_seq_timestamp time;
184 struct snd_seq_addr source;
185 struct snd_seq_addr dest;
Tao Baod7db5942015-01-28 10:07:51 -0800186 union {
Christopher Ferris8666d042023-09-06 14:55:31 -0700187 union snd_seq_event_data data;
188 unsigned int ump[4];
189 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800190};
Ben Cheng655a7c02013-10-16 16:09:24 -0700191struct snd_seq_event_bounce {
Tao Baod7db5942015-01-28 10:07:51 -0800192 int err;
193 struct snd_seq_event event;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800194};
Ben Cheng655a7c02013-10-16 16:09:24 -0700195struct snd_seq_system_info {
Tao Baod7db5942015-01-28 10:07:51 -0800196 int queues;
197 int clients;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800198 int ports;
Tao Baod7db5942015-01-28 10:07:51 -0800199 int channels;
200 int cur_clients;
201 int cur_queues;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800202 char reserved[24];
Ben Cheng655a7c02013-10-16 16:09:24 -0700203};
204struct snd_seq_running_info {
Tao Baod7db5942015-01-28 10:07:51 -0800205 unsigned char client;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800206 unsigned char big_endian;
Tao Baod7db5942015-01-28 10:07:51 -0800207 unsigned char cpu_mode;
208 unsigned char pad;
209 unsigned char reserved[12];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800210};
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define SNDRV_SEQ_CLIENT_SYSTEM 0
212#define SNDRV_SEQ_CLIENT_DUMMY 14
213#define SNDRV_SEQ_CLIENT_OSS 15
Christopher Ferris05d08e92016-02-04 13:16:38 -0800214typedef int __bitwise snd_seq_client_type_t;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -0700215#define NO_CLIENT (( snd_seq_client_type_t) 0)
216#define USER_CLIENT (( snd_seq_client_type_t) 1)
217#define KERNEL_CLIENT (( snd_seq_client_type_t) 2)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800218#define SNDRV_SEQ_FILTER_BROADCAST (1U << 0)
219#define SNDRV_SEQ_FILTER_MULTICAST (1U << 1)
220#define SNDRV_SEQ_FILTER_BOUNCE (1U << 2)
Christopher Ferris8666d042023-09-06 14:55:31 -0700221#define SNDRV_SEQ_FILTER_NO_CONVERT (1U << 30)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800222#define SNDRV_SEQ_FILTER_USE_EVENT (1U << 31)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800223struct snd_seq_client_info {
Tao Baod7db5942015-01-28 10:07:51 -0800224 int client;
225 snd_seq_client_type_t type;
226 char name[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800227 unsigned int filter;
Tao Baod7db5942015-01-28 10:07:51 -0800228 unsigned char multicast_filter[8];
229 unsigned char event_filter[32];
230 int num_ports;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800231 int event_lost;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700232 int card;
233 int pid;
Christopher Ferris8666d042023-09-06 14:55:31 -0700234 unsigned int midi_version;
235 unsigned int group_filter;
236 char reserved[48];
Ben Cheng655a7c02013-10-16 16:09:24 -0700237};
Christopher Ferris8666d042023-09-06 14:55:31 -0700238#define SNDRV_SEQ_CLIENT_LEGACY_MIDI 0
239#define SNDRV_SEQ_CLIENT_UMP_MIDI_1_0 1
240#define SNDRV_SEQ_CLIENT_UMP_MIDI_2_0 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700241struct snd_seq_client_pool {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800242 int client;
Tao Baod7db5942015-01-28 10:07:51 -0800243 int output_pool;
244 int input_pool;
245 int output_room;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800246 int output_free;
Tao Baod7db5942015-01-28 10:07:51 -0800247 int input_free;
248 char reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700249};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800250#define SNDRV_SEQ_REMOVE_INPUT (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800251#define SNDRV_SEQ_REMOVE_OUTPUT (1 << 1)
252#define SNDRV_SEQ_REMOVE_DEST (1 << 2)
253#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1 << 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800254#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1 << 4)
Tao Baod7db5942015-01-28 10:07:51 -0800255#define SNDRV_SEQ_REMOVE_TIME_AFTER (1 << 5)
256#define SNDRV_SEQ_REMOVE_TIME_TICK (1 << 6)
257#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1 << 7)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800258#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1 << 8)
Tao Baod7db5942015-01-28 10:07:51 -0800259#define SNDRV_SEQ_REMOVE_TAG_MATCH (1 << 9)
Ben Cheng655a7c02013-10-16 16:09:24 -0700260struct snd_seq_remove_events {
Tao Baod7db5942015-01-28 10:07:51 -0800261 unsigned int remove_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800262 union snd_seq_timestamp time;
Tao Baod7db5942015-01-28 10:07:51 -0800263 unsigned char queue;
264 struct snd_seq_addr dest;
265 unsigned char channel;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800266 int type;
Tao Baod7db5942015-01-28 10:07:51 -0800267 char tag;
268 int reserved[10];
Ben Cheng655a7c02013-10-16 16:09:24 -0700269};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800270#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700271#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
Tao Baod7db5942015-01-28 10:07:51 -0800272#define SNDRV_SEQ_PORT_CAP_READ (1 << 0)
273#define SNDRV_SEQ_PORT_CAP_WRITE (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800274#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1 << 2)
Tao Baod7db5942015-01-28 10:07:51 -0800275#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1 << 3)
276#define SNDRV_SEQ_PORT_CAP_DUPLEX (1 << 4)
277#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1 << 5)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800278#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1 << 6)
Tao Baod7db5942015-01-28 10:07:51 -0800279#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1 << 7)
Christopher Ferris8666d042023-09-06 14:55:31 -0700280#define SNDRV_SEQ_PORT_CAP_INACTIVE (1 << 8)
281#define SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT (1 << 9)
Tao Baod7db5942015-01-28 10:07:51 -0800282#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1 << 0)
283#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800284#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1 << 2)
Tao Baod7db5942015-01-28 10:07:51 -0800285#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1 << 3)
286#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1 << 4)
287#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1 << 5)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800288#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1 << 6)
Christopher Ferris8666d042023-09-06 14:55:31 -0700289#define SNDRV_SEQ_PORT_TYPE_MIDI_UMP (1 << 7)
Tao Baod7db5942015-01-28 10:07:51 -0800290#define SNDRV_SEQ_PORT_TYPE_SYNTH (1 << 10)
291#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1 << 11)
292#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1 << 12)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800293#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1 << 16)
Tao Baod7db5942015-01-28 10:07:51 -0800294#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1 << 17)
295#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1 << 18)
296#define SNDRV_SEQ_PORT_TYPE_PORT (1 << 19)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800297#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1 << 20)
Tao Baod7db5942015-01-28 10:07:51 -0800298#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1 << 0)
299#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1 << 1)
300#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1 << 2)
Christopher Ferris8666d042023-09-06 14:55:31 -0700301#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
302#define SNDRV_SEQ_PORT_DIR_INPUT 1
303#define SNDRV_SEQ_PORT_DIR_OUTPUT 2
304#define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800305struct snd_seq_port_info {
Tao Baod7db5942015-01-28 10:07:51 -0800306 struct snd_seq_addr addr;
307 char name[64];
308 unsigned int capability;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800309 unsigned int type;
Tao Baod7db5942015-01-28 10:07:51 -0800310 int midi_channels;
311 int midi_voices;
312 int synth_voices;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800313 int read_use;
Tao Baod7db5942015-01-28 10:07:51 -0800314 int write_use;
315 void * kernel;
316 unsigned int flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800317 unsigned char time_queue;
Christopher Ferris8666d042023-09-06 14:55:31 -0700318 unsigned char direction;
319 unsigned char ump_group;
320 char reserved[57];
Ben Cheng655a7c02013-10-16 16:09:24 -0700321};
Tao Baod7db5942015-01-28 10:07:51 -0800322#define SNDRV_SEQ_QUEUE_FLG_SYNC (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800323struct snd_seq_queue_info {
Tao Baod7db5942015-01-28 10:07:51 -0800324 int queue;
325 int owner;
326 unsigned locked : 1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800327 char name[64];
Tao Baod7db5942015-01-28 10:07:51 -0800328 unsigned int flags;
329 char reserved[60];
Ben Cheng655a7c02013-10-16 16:09:24 -0700330};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800331struct snd_seq_queue_status {
Tao Baod7db5942015-01-28 10:07:51 -0800332 int queue;
333 int events;
334 snd_seq_tick_time_t tick;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800335 struct snd_seq_real_time time;
Tao Baod7db5942015-01-28 10:07:51 -0800336 int running;
337 int flags;
338 char reserved[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800339};
Ben Cheng655a7c02013-10-16 16:09:24 -0700340struct snd_seq_queue_tempo {
Tao Baod7db5942015-01-28 10:07:51 -0800341 int queue;
342 unsigned int tempo;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800343 int ppq;
Tao Baod7db5942015-01-28 10:07:51 -0800344 unsigned int skew_value;
345 unsigned int skew_base;
Christopher Ferris63fcca42024-09-26 01:12:10 +0000346 unsigned short tempo_base;
347 char reserved[22];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800348};
Ben Cheng655a7c02013-10-16 16:09:24 -0700349#define SNDRV_SEQ_TIMER_ALSA 0
350#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1
351#define SNDRV_SEQ_TIMER_MIDI_TICK 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800352struct snd_seq_queue_timer {
Tao Baod7db5942015-01-28 10:07:51 -0800353 int queue;
354 int type;
355 union {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800356 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800357 struct snd_timer_id id;
358 unsigned int resolution;
359 } alsa;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800360 } u;
Tao Baod7db5942015-01-28 10:07:51 -0800361 char reserved[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700362};
363struct snd_seq_queue_client {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800364 int queue;
Tao Baod7db5942015-01-28 10:07:51 -0800365 int client;
366 int used;
367 char reserved[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800368};
Tao Baod7db5942015-01-28 10:07:51 -0800369#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1 << 0)
370#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1 << 1)
371#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800372struct snd_seq_port_subscribe {
Tao Baod7db5942015-01-28 10:07:51 -0800373 struct snd_seq_addr sender;
374 struct snd_seq_addr dest;
375 unsigned int voices;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800376 unsigned int flags;
Tao Baod7db5942015-01-28 10:07:51 -0800377 unsigned char queue;
378 unsigned char pad[3];
379 char reserved[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800380};
Ben Cheng655a7c02013-10-16 16:09:24 -0700381#define SNDRV_SEQ_QUERY_SUBS_READ 0
382#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
383struct snd_seq_query_subs {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800384 struct snd_seq_addr root;
Tao Baod7db5942015-01-28 10:07:51 -0800385 int type;
386 int index;
387 int num_subs;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800388 struct snd_seq_addr addr;
Tao Baod7db5942015-01-28 10:07:51 -0800389 unsigned char queue;
390 unsigned int flags;
391 char reserved[64];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800392};
Christopher Ferris8666d042023-09-06 14:55:31 -0700393#define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT 0
394#define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK 1
395struct snd_seq_client_ump_info {
396 int client;
397 int type;
398 unsigned char info[512];
399} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800400#define SNDRV_SEQ_IOCTL_PVERSION _IOR('S', 0x00, int)
401#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR('S', 0x01, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700402#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800403#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
Christopher Ferris8666d042023-09-06 14:55:31 -0700404#define SNDRV_SEQ_IOCTL_USER_PVERSION _IOW('S', 0x04, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700405#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
Tao Baod7db5942015-01-28 10:07:51 -0800406#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW('S', 0x11, struct snd_seq_client_info)
Christopher Ferris8666d042023-09-06 14:55:31 -0700407#define SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO _IOWR('S', 0x12, struct snd_seq_client_ump_info)
408#define SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO _IOWR('S', 0x13, struct snd_seq_client_ump_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700409#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800410#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW('S', 0x21, struct snd_seq_port_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700411#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
Tao Baod7db5942015-01-28 10:07:51 -0800412#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW('S', 0x23, struct snd_seq_port_info)
413#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW('S', 0x30, struct snd_seq_port_subscribe)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800414#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW('S', 0x31, struct snd_seq_port_subscribe)
Ben Cheng655a7c02013-10-16 16:09:24 -0700415#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
Tao Baod7db5942015-01-28 10:07:51 -0800416#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW('S', 0x33, struct snd_seq_queue_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700417#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800418#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700419#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
420#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
421#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800422#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW('S', 0x42, struct snd_seq_queue_tempo)
Ben Cheng655a7c02013-10-16 16:09:24 -0700423#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800424#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW('S', 0x46, struct snd_seq_queue_timer)
Ben Cheng655a7c02013-10-16 16:09:24 -0700425#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
Tao Baod7db5942015-01-28 10:07:51 -0800426#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW('S', 0x4a, struct snd_seq_queue_client)
Ben Cheng655a7c02013-10-16 16:09:24 -0700427#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800428#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW('S', 0x4c, struct snd_seq_client_pool)
Tao Baod7db5942015-01-28 10:07:51 -0800429#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW('S', 0x4e, struct snd_seq_remove_events)
Ben Cheng655a7c02013-10-16 16:09:24 -0700430#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
431#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800432#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
Ben Cheng655a7c02013-10-16 16:09:24 -0700433#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
434#endif