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