jpayne@69
|
1 /**
|
jpayne@69
|
2 * \file include/seq.h
|
jpayne@69
|
3 * \brief Application interface library for the ALSA driver
|
jpayne@69
|
4 * \author Jaroslav Kysela <perex@perex.cz>
|
jpayne@69
|
5 * \author Abramo Bagnara <abramo@alsa-project.org>
|
jpayne@69
|
6 * \author Takashi Iwai <tiwai@suse.de>
|
jpayne@69
|
7 * \date 1998-2001
|
jpayne@69
|
8 */
|
jpayne@69
|
9 /*
|
jpayne@69
|
10 * Application interface library for the ALSA driver
|
jpayne@69
|
11 *
|
jpayne@69
|
12 *
|
jpayne@69
|
13 * This library is free software; you can redistribute it and/or modify
|
jpayne@69
|
14 * it under the terms of the GNU Lesser General Public License as
|
jpayne@69
|
15 * published by the Free Software Foundation; either version 2.1 of
|
jpayne@69
|
16 * the License, or (at your option) any later version.
|
jpayne@69
|
17 *
|
jpayne@69
|
18 * This program is distributed in the hope that it will be useful,
|
jpayne@69
|
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jpayne@69
|
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jpayne@69
|
21 * GNU Lesser General Public License for more details.
|
jpayne@69
|
22 *
|
jpayne@69
|
23 * You should have received a copy of the GNU Lesser General Public
|
jpayne@69
|
24 * License along with this library; if not, write to the Free Software
|
jpayne@69
|
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
jpayne@69
|
26 *
|
jpayne@69
|
27 */
|
jpayne@69
|
28
|
jpayne@69
|
29 #ifndef __ALSA_SEQ_H
|
jpayne@69
|
30 #define __ALSA_SEQ_H
|
jpayne@69
|
31
|
jpayne@69
|
32 #ifdef __cplusplus
|
jpayne@69
|
33 extern "C" {
|
jpayne@69
|
34 #endif
|
jpayne@69
|
35
|
jpayne@69
|
36 /**
|
jpayne@69
|
37 * \defgroup Sequencer MIDI Sequencer
|
jpayne@69
|
38 * MIDI Sequencer Interface.
|
jpayne@69
|
39 * See \ref seq page for more details.
|
jpayne@69
|
40 * \{
|
jpayne@69
|
41 */
|
jpayne@69
|
42
|
jpayne@69
|
43 /** dlsym version for interface entry callback */
|
jpayne@69
|
44 #define SND_SEQ_DLSYM_VERSION _dlsym_seq_001
|
jpayne@69
|
45
|
jpayne@69
|
46 /** Sequencer handle */
|
jpayne@69
|
47 typedef struct _snd_seq snd_seq_t;
|
jpayne@69
|
48
|
jpayne@69
|
49 /**
|
jpayne@69
|
50 * sequencer opening stream types
|
jpayne@69
|
51 */
|
jpayne@69
|
52 #define SND_SEQ_OPEN_OUTPUT 1 /**< open for output (write) */
|
jpayne@69
|
53 #define SND_SEQ_OPEN_INPUT 2 /**< open for input (read) */
|
jpayne@69
|
54 #define SND_SEQ_OPEN_DUPLEX (SND_SEQ_OPEN_OUTPUT|SND_SEQ_OPEN_INPUT) /**< open for both input and output (read/write) */
|
jpayne@69
|
55
|
jpayne@69
|
56 /**
|
jpayne@69
|
57 * sequencer opening mode
|
jpayne@69
|
58 */
|
jpayne@69
|
59 #define SND_SEQ_NONBLOCK 0x0001 /**< non-blocking mode (flag to open mode) */
|
jpayne@69
|
60
|
jpayne@69
|
61 /** sequencer handle type */
|
jpayne@69
|
62 typedef enum _snd_seq_type {
|
jpayne@69
|
63 SND_SEQ_TYPE_HW, /**< hardware */
|
jpayne@69
|
64 SND_SEQ_TYPE_SHM, /**< shared memory (NYI) */
|
jpayne@69
|
65 SND_SEQ_TYPE_INET /**< network (NYI) */
|
jpayne@69
|
66 } snd_seq_type_t;
|
jpayne@69
|
67
|
jpayne@69
|
68 /** special client (port) ids */
|
jpayne@69
|
69 #define SND_SEQ_ADDRESS_UNKNOWN 253 /**< unknown source */
|
jpayne@69
|
70 #define SND_SEQ_ADDRESS_SUBSCRIBERS 254 /**< send event to all subscribed ports */
|
jpayne@69
|
71 #define SND_SEQ_ADDRESS_BROADCAST 255 /**< send event to all queues/clients/ports/channels */
|
jpayne@69
|
72
|
jpayne@69
|
73 /** known client numbers */
|
jpayne@69
|
74 #define SND_SEQ_CLIENT_SYSTEM 0 /**< system client */
|
jpayne@69
|
75
|
jpayne@69
|
76 /*
|
jpayne@69
|
77 */
|
jpayne@69
|
78 int snd_seq_open(snd_seq_t **handle, const char *name, int streams, int mode);
|
jpayne@69
|
79 int snd_seq_open_lconf(snd_seq_t **handle, const char *name, int streams, int mode, snd_config_t *lconf);
|
jpayne@69
|
80 const char *snd_seq_name(snd_seq_t *seq);
|
jpayne@69
|
81 snd_seq_type_t snd_seq_type(snd_seq_t *seq);
|
jpayne@69
|
82 int snd_seq_close(snd_seq_t *handle);
|
jpayne@69
|
83 int snd_seq_poll_descriptors_count(snd_seq_t *handle, short events);
|
jpayne@69
|
84 int snd_seq_poll_descriptors(snd_seq_t *handle, struct pollfd *pfds, unsigned int space, short events);
|
jpayne@69
|
85 int snd_seq_poll_descriptors_revents(snd_seq_t *seq, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
|
jpayne@69
|
86 int snd_seq_nonblock(snd_seq_t *handle, int nonblock);
|
jpayne@69
|
87 int snd_seq_client_id(snd_seq_t *handle);
|
jpayne@69
|
88
|
jpayne@69
|
89 size_t snd_seq_get_output_buffer_size(snd_seq_t *handle);
|
jpayne@69
|
90 size_t snd_seq_get_input_buffer_size(snd_seq_t *handle);
|
jpayne@69
|
91 int snd_seq_set_output_buffer_size(snd_seq_t *handle, size_t size);
|
jpayne@69
|
92 int snd_seq_set_input_buffer_size(snd_seq_t *handle, size_t size);
|
jpayne@69
|
93
|
jpayne@69
|
94 /** system information container */
|
jpayne@69
|
95 typedef struct _snd_seq_system_info snd_seq_system_info_t;
|
jpayne@69
|
96
|
jpayne@69
|
97 size_t snd_seq_system_info_sizeof(void);
|
jpayne@69
|
98 /** allocate a #snd_seq_system_info_t container on stack */
|
jpayne@69
|
99 #define snd_seq_system_info_alloca(ptr) \
|
jpayne@69
|
100 __snd_alloca(ptr, snd_seq_system_info)
|
jpayne@69
|
101 int snd_seq_system_info_malloc(snd_seq_system_info_t **ptr);
|
jpayne@69
|
102 void snd_seq_system_info_free(snd_seq_system_info_t *ptr);
|
jpayne@69
|
103 void snd_seq_system_info_copy(snd_seq_system_info_t *dst, const snd_seq_system_info_t *src);
|
jpayne@69
|
104
|
jpayne@69
|
105 int snd_seq_system_info_get_queues(const snd_seq_system_info_t *info);
|
jpayne@69
|
106 int snd_seq_system_info_get_clients(const snd_seq_system_info_t *info);
|
jpayne@69
|
107 int snd_seq_system_info_get_ports(const snd_seq_system_info_t *info);
|
jpayne@69
|
108 int snd_seq_system_info_get_channels(const snd_seq_system_info_t *info);
|
jpayne@69
|
109 int snd_seq_system_info_get_cur_clients(const snd_seq_system_info_t *info);
|
jpayne@69
|
110 int snd_seq_system_info_get_cur_queues(const snd_seq_system_info_t *info);
|
jpayne@69
|
111
|
jpayne@69
|
112 int snd_seq_system_info(snd_seq_t *handle, snd_seq_system_info_t *info);
|
jpayne@69
|
113
|
jpayne@69
|
114 /** \} */
|
jpayne@69
|
115
|
jpayne@69
|
116
|
jpayne@69
|
117 /**
|
jpayne@69
|
118 * \defgroup SeqClient Sequencer Client Interface
|
jpayne@69
|
119 * Sequencer Client Interface
|
jpayne@69
|
120 * \ingroup Sequencer
|
jpayne@69
|
121 * \{
|
jpayne@69
|
122 */
|
jpayne@69
|
123
|
jpayne@69
|
124 /** client information container */
|
jpayne@69
|
125 typedef struct _snd_seq_client_info snd_seq_client_info_t;
|
jpayne@69
|
126
|
jpayne@69
|
127 /** client types */
|
jpayne@69
|
128 typedef enum snd_seq_client_type {
|
jpayne@69
|
129 SND_SEQ_USER_CLIENT = 1, /**< user client */
|
jpayne@69
|
130 SND_SEQ_KERNEL_CLIENT = 2 /**< kernel client */
|
jpayne@69
|
131 } snd_seq_client_type_t;
|
jpayne@69
|
132
|
jpayne@69
|
133 size_t snd_seq_client_info_sizeof(void);
|
jpayne@69
|
134 /** allocate a #snd_seq_client_info_t container on stack */
|
jpayne@69
|
135 #define snd_seq_client_info_alloca(ptr) \
|
jpayne@69
|
136 __snd_alloca(ptr, snd_seq_client_info)
|
jpayne@69
|
137 int snd_seq_client_info_malloc(snd_seq_client_info_t **ptr);
|
jpayne@69
|
138 void snd_seq_client_info_free(snd_seq_client_info_t *ptr);
|
jpayne@69
|
139 void snd_seq_client_info_copy(snd_seq_client_info_t *dst, const snd_seq_client_info_t *src);
|
jpayne@69
|
140
|
jpayne@69
|
141 int snd_seq_client_info_get_client(const snd_seq_client_info_t *info);
|
jpayne@69
|
142 snd_seq_client_type_t snd_seq_client_info_get_type(const snd_seq_client_info_t *info);
|
jpayne@69
|
143 const char *snd_seq_client_info_get_name(snd_seq_client_info_t *info);
|
jpayne@69
|
144 int snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t *info);
|
jpayne@69
|
145 int snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t *info);
|
jpayne@69
|
146 int snd_seq_client_info_get_card(const snd_seq_client_info_t *info);
|
jpayne@69
|
147 int snd_seq_client_info_get_pid(const snd_seq_client_info_t *info);
|
jpayne@69
|
148 const unsigned char *snd_seq_client_info_get_event_filter(const snd_seq_client_info_t *info);
|
jpayne@69
|
149 int snd_seq_client_info_get_num_ports(const snd_seq_client_info_t *info);
|
jpayne@69
|
150 int snd_seq_client_info_get_event_lost(const snd_seq_client_info_t *info);
|
jpayne@69
|
151
|
jpayne@69
|
152 void snd_seq_client_info_set_client(snd_seq_client_info_t *info, int client);
|
jpayne@69
|
153 void snd_seq_client_info_set_name(snd_seq_client_info_t *info, const char *name);
|
jpayne@69
|
154 void snd_seq_client_info_set_broadcast_filter(snd_seq_client_info_t *info, int val);
|
jpayne@69
|
155 void snd_seq_client_info_set_error_bounce(snd_seq_client_info_t *info, int val);
|
jpayne@69
|
156 void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned char *filter);
|
jpayne@69
|
157
|
jpayne@69
|
158 void snd_seq_client_info_event_filter_clear(snd_seq_client_info_t *info);
|
jpayne@69
|
159 void snd_seq_client_info_event_filter_add(snd_seq_client_info_t *info, int event_type);
|
jpayne@69
|
160 void snd_seq_client_info_event_filter_del(snd_seq_client_info_t *info, int event_type);
|
jpayne@69
|
161 int snd_seq_client_info_event_filter_check(snd_seq_client_info_t *info, int event_type);
|
jpayne@69
|
162
|
jpayne@69
|
163 int snd_seq_get_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
|
jpayne@69
|
164 int snd_seq_get_any_client_info(snd_seq_t *handle, int client, snd_seq_client_info_t *info);
|
jpayne@69
|
165 int snd_seq_set_client_info(snd_seq_t *handle, snd_seq_client_info_t *info);
|
jpayne@69
|
166 int snd_seq_query_next_client(snd_seq_t *handle, snd_seq_client_info_t *info);
|
jpayne@69
|
167
|
jpayne@69
|
168 /*
|
jpayne@69
|
169 */
|
jpayne@69
|
170
|
jpayne@69
|
171 /** client pool information container */
|
jpayne@69
|
172 typedef struct _snd_seq_client_pool snd_seq_client_pool_t;
|
jpayne@69
|
173
|
jpayne@69
|
174 size_t snd_seq_client_pool_sizeof(void);
|
jpayne@69
|
175 /** allocate a #snd_seq_client_pool_t container on stack */
|
jpayne@69
|
176 #define snd_seq_client_pool_alloca(ptr) \
|
jpayne@69
|
177 __snd_alloca(ptr, snd_seq_client_pool)
|
jpayne@69
|
178 int snd_seq_client_pool_malloc(snd_seq_client_pool_t **ptr);
|
jpayne@69
|
179 void snd_seq_client_pool_free(snd_seq_client_pool_t *ptr);
|
jpayne@69
|
180 void snd_seq_client_pool_copy(snd_seq_client_pool_t *dst, const snd_seq_client_pool_t *src);
|
jpayne@69
|
181
|
jpayne@69
|
182 int snd_seq_client_pool_get_client(const snd_seq_client_pool_t *info);
|
jpayne@69
|
183 size_t snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t *info);
|
jpayne@69
|
184 size_t snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t *info);
|
jpayne@69
|
185 size_t snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t *info);
|
jpayne@69
|
186 size_t snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t *info);
|
jpayne@69
|
187 size_t snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t *info);
|
jpayne@69
|
188 void snd_seq_client_pool_set_output_pool(snd_seq_client_pool_t *info, size_t size);
|
jpayne@69
|
189 void snd_seq_client_pool_set_input_pool(snd_seq_client_pool_t *info, size_t size);
|
jpayne@69
|
190 void snd_seq_client_pool_set_output_room(snd_seq_client_pool_t *info, size_t size);
|
jpayne@69
|
191
|
jpayne@69
|
192 int snd_seq_get_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info);
|
jpayne@69
|
193 int snd_seq_set_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info);
|
jpayne@69
|
194
|
jpayne@69
|
195
|
jpayne@69
|
196 /** \} */
|
jpayne@69
|
197
|
jpayne@69
|
198
|
jpayne@69
|
199 /**
|
jpayne@69
|
200 * \defgroup SeqPort Sequencer Port Interface
|
jpayne@69
|
201 * Sequencer Port Interface
|
jpayne@69
|
202 * \ingroup Sequencer
|
jpayne@69
|
203 * \{
|
jpayne@69
|
204 */
|
jpayne@69
|
205
|
jpayne@69
|
206 /** port information container */
|
jpayne@69
|
207 typedef struct _snd_seq_port_info snd_seq_port_info_t;
|
jpayne@69
|
208
|
jpayne@69
|
209 /** known port numbers */
|
jpayne@69
|
210 #define SND_SEQ_PORT_SYSTEM_TIMER 0 /**< system timer port */
|
jpayne@69
|
211 #define SND_SEQ_PORT_SYSTEM_ANNOUNCE 1 /**< system announce port */
|
jpayne@69
|
212
|
jpayne@69
|
213 /** port capabilities (32 bits) */
|
jpayne@69
|
214 #define SND_SEQ_PORT_CAP_READ (1<<0) /**< readable from this port */
|
jpayne@69
|
215 #define SND_SEQ_PORT_CAP_WRITE (1<<1) /**< writable to this port */
|
jpayne@69
|
216
|
jpayne@69
|
217 #define SND_SEQ_PORT_CAP_SYNC_READ (1<<2) /**< allow read subscriptions */
|
jpayne@69
|
218 #define SND_SEQ_PORT_CAP_SYNC_WRITE (1<<3) /**< allow write subscriptions */
|
jpayne@69
|
219
|
jpayne@69
|
220 #define SND_SEQ_PORT_CAP_DUPLEX (1<<4) /**< allow read/write duplex */
|
jpayne@69
|
221
|
jpayne@69
|
222 #define SND_SEQ_PORT_CAP_SUBS_READ (1<<5) /**< allow read subscription */
|
jpayne@69
|
223 #define SND_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /**< allow write subscription */
|
jpayne@69
|
224 #define SND_SEQ_PORT_CAP_NO_EXPORT (1<<7) /**< routing not allowed */
|
jpayne@69
|
225
|
jpayne@69
|
226 /* port type */
|
jpayne@69
|
227 /** Messages sent from/to this port have device-specific semantics. */
|
jpayne@69
|
228 #define SND_SEQ_PORT_TYPE_SPECIFIC (1<<0)
|
jpayne@69
|
229 /** This port understands MIDI messages. */
|
jpayne@69
|
230 #define SND_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1)
|
jpayne@69
|
231 /** This port is compatible with the General MIDI specification. */
|
jpayne@69
|
232 #define SND_SEQ_PORT_TYPE_MIDI_GM (1<<2)
|
jpayne@69
|
233 /** This port is compatible with the Roland GS standard. */
|
jpayne@69
|
234 #define SND_SEQ_PORT_TYPE_MIDI_GS (1<<3)
|
jpayne@69
|
235 /** This port is compatible with the Yamaha XG specification. */
|
jpayne@69
|
236 #define SND_SEQ_PORT_TYPE_MIDI_XG (1<<4)
|
jpayne@69
|
237 /** This port is compatible with the Roland MT-32. */
|
jpayne@69
|
238 #define SND_SEQ_PORT_TYPE_MIDI_MT32 (1<<5)
|
jpayne@69
|
239 /** This port is compatible with the General MIDI 2 specification. */
|
jpayne@69
|
240 #define SND_SEQ_PORT_TYPE_MIDI_GM2 (1<<6)
|
jpayne@69
|
241 /** This port understands SND_SEQ_EVENT_SAMPLE_xxx messages
|
jpayne@69
|
242 (these are not MIDI messages). */
|
jpayne@69
|
243 #define SND_SEQ_PORT_TYPE_SYNTH (1<<10)
|
jpayne@69
|
244 /** Instruments can be downloaded to this port
|
jpayne@69
|
245 (with SND_SEQ_EVENT_INSTR_xxx messages sent directly). */
|
jpayne@69
|
246 #define SND_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)
|
jpayne@69
|
247 /** Instruments can be downloaded to this port
|
jpayne@69
|
248 (with SND_SEQ_EVENT_INSTR_xxx messages sent directly or through a queue). */
|
jpayne@69
|
249 #define SND_SEQ_PORT_TYPE_SAMPLE (1<<12)
|
jpayne@69
|
250 /** This port is implemented in hardware. */
|
jpayne@69
|
251 #define SND_SEQ_PORT_TYPE_HARDWARE (1<<16)
|
jpayne@69
|
252 /** This port is implemented in software. */
|
jpayne@69
|
253 #define SND_SEQ_PORT_TYPE_SOFTWARE (1<<17)
|
jpayne@69
|
254 /** Messages sent to this port will generate sounds. */
|
jpayne@69
|
255 #define SND_SEQ_PORT_TYPE_SYNTHESIZER (1<<18)
|
jpayne@69
|
256 /** This port may connect to other devices
|
jpayne@69
|
257 (whose characteristics are not known). */
|
jpayne@69
|
258 #define SND_SEQ_PORT_TYPE_PORT (1<<19)
|
jpayne@69
|
259 /** This port belongs to an application, such as a sequencer or editor. */
|
jpayne@69
|
260 #define SND_SEQ_PORT_TYPE_APPLICATION (1<<20)
|
jpayne@69
|
261
|
jpayne@69
|
262
|
jpayne@69
|
263 size_t snd_seq_port_info_sizeof(void);
|
jpayne@69
|
264 /** allocate a #snd_seq_port_info_t container on stack */
|
jpayne@69
|
265 #define snd_seq_port_info_alloca(ptr) \
|
jpayne@69
|
266 __snd_alloca(ptr, snd_seq_port_info)
|
jpayne@69
|
267 int snd_seq_port_info_malloc(snd_seq_port_info_t **ptr);
|
jpayne@69
|
268 void snd_seq_port_info_free(snd_seq_port_info_t *ptr);
|
jpayne@69
|
269 void snd_seq_port_info_copy(snd_seq_port_info_t *dst, const snd_seq_port_info_t *src);
|
jpayne@69
|
270
|
jpayne@69
|
271 int snd_seq_port_info_get_client(const snd_seq_port_info_t *info);
|
jpayne@69
|
272 int snd_seq_port_info_get_port(const snd_seq_port_info_t *info);
|
jpayne@69
|
273 const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info);
|
jpayne@69
|
274 const char *snd_seq_port_info_get_name(const snd_seq_port_info_t *info);
|
jpayne@69
|
275 unsigned int snd_seq_port_info_get_capability(const snd_seq_port_info_t *info);
|
jpayne@69
|
276 unsigned int snd_seq_port_info_get_type(const snd_seq_port_info_t *info);
|
jpayne@69
|
277 int snd_seq_port_info_get_midi_channels(const snd_seq_port_info_t *info);
|
jpayne@69
|
278 int snd_seq_port_info_get_midi_voices(const snd_seq_port_info_t *info);
|
jpayne@69
|
279 int snd_seq_port_info_get_synth_voices(const snd_seq_port_info_t *info);
|
jpayne@69
|
280 int snd_seq_port_info_get_read_use(const snd_seq_port_info_t *info);
|
jpayne@69
|
281 int snd_seq_port_info_get_write_use(const snd_seq_port_info_t *info);
|
jpayne@69
|
282 int snd_seq_port_info_get_port_specified(const snd_seq_port_info_t *info);
|
jpayne@69
|
283 int snd_seq_port_info_get_timestamping(const snd_seq_port_info_t *info);
|
jpayne@69
|
284 int snd_seq_port_info_get_timestamp_real(const snd_seq_port_info_t *info);
|
jpayne@69
|
285 int snd_seq_port_info_get_timestamp_queue(const snd_seq_port_info_t *info);
|
jpayne@69
|
286
|
jpayne@69
|
287 void snd_seq_port_info_set_client(snd_seq_port_info_t *info, int client);
|
jpayne@69
|
288 void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port);
|
jpayne@69
|
289 void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr);
|
jpayne@69
|
290 void snd_seq_port_info_set_name(snd_seq_port_info_t *info, const char *name);
|
jpayne@69
|
291 void snd_seq_port_info_set_capability(snd_seq_port_info_t *info, unsigned int capability);
|
jpayne@69
|
292 void snd_seq_port_info_set_type(snd_seq_port_info_t *info, unsigned int type);
|
jpayne@69
|
293 void snd_seq_port_info_set_midi_channels(snd_seq_port_info_t *info, int channels);
|
jpayne@69
|
294 void snd_seq_port_info_set_midi_voices(snd_seq_port_info_t *info, int voices);
|
jpayne@69
|
295 void snd_seq_port_info_set_synth_voices(snd_seq_port_info_t *info, int voices);
|
jpayne@69
|
296 void snd_seq_port_info_set_port_specified(snd_seq_port_info_t *info, int val);
|
jpayne@69
|
297 void snd_seq_port_info_set_timestamping(snd_seq_port_info_t *info, int enable);
|
jpayne@69
|
298 void snd_seq_port_info_set_timestamp_real(snd_seq_port_info_t *info, int realtime);
|
jpayne@69
|
299 void snd_seq_port_info_set_timestamp_queue(snd_seq_port_info_t *info, int queue);
|
jpayne@69
|
300
|
jpayne@69
|
301 int snd_seq_create_port(snd_seq_t *handle, snd_seq_port_info_t *info);
|
jpayne@69
|
302 int snd_seq_delete_port(snd_seq_t *handle, int port);
|
jpayne@69
|
303 int snd_seq_get_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info);
|
jpayne@69
|
304 int snd_seq_get_any_port_info(snd_seq_t *handle, int client, int port, snd_seq_port_info_t *info);
|
jpayne@69
|
305 int snd_seq_set_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info);
|
jpayne@69
|
306 int snd_seq_query_next_port(snd_seq_t *handle, snd_seq_port_info_t *info);
|
jpayne@69
|
307
|
jpayne@69
|
308 /** \} */
|
jpayne@69
|
309
|
jpayne@69
|
310
|
jpayne@69
|
311 /**
|
jpayne@69
|
312 * \defgroup SeqSubscribe Sequencer Port Subscription
|
jpayne@69
|
313 * Sequencer Port Subscription
|
jpayne@69
|
314 * \ingroup Sequencer
|
jpayne@69
|
315 * \{
|
jpayne@69
|
316 */
|
jpayne@69
|
317
|
jpayne@69
|
318 /** port subscription container */
|
jpayne@69
|
319 typedef struct _snd_seq_port_subscribe snd_seq_port_subscribe_t;
|
jpayne@69
|
320
|
jpayne@69
|
321 size_t snd_seq_port_subscribe_sizeof(void);
|
jpayne@69
|
322 /** allocate a #snd_seq_port_subscribe_t container on stack */
|
jpayne@69
|
323 #define snd_seq_port_subscribe_alloca(ptr) \
|
jpayne@69
|
324 __snd_alloca(ptr, snd_seq_port_subscribe)
|
jpayne@69
|
325 int snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t **ptr);
|
jpayne@69
|
326 void snd_seq_port_subscribe_free(snd_seq_port_subscribe_t *ptr);
|
jpayne@69
|
327 void snd_seq_port_subscribe_copy(snd_seq_port_subscribe_t *dst, const snd_seq_port_subscribe_t *src);
|
jpayne@69
|
328
|
jpayne@69
|
329 const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info);
|
jpayne@69
|
330 const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info);
|
jpayne@69
|
331 int snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t *info);
|
jpayne@69
|
332 int snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t *info);
|
jpayne@69
|
333 int snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t *info);
|
jpayne@69
|
334 int snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t *info);
|
jpayne@69
|
335
|
jpayne@69
|
336 void snd_seq_port_subscribe_set_sender(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr);
|
jpayne@69
|
337 void snd_seq_port_subscribe_set_dest(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr);
|
jpayne@69
|
338 void snd_seq_port_subscribe_set_queue(snd_seq_port_subscribe_t *info, int q);
|
jpayne@69
|
339 void snd_seq_port_subscribe_set_exclusive(snd_seq_port_subscribe_t *info, int val);
|
jpayne@69
|
340 void snd_seq_port_subscribe_set_time_update(snd_seq_port_subscribe_t *info, int val);
|
jpayne@69
|
341 void snd_seq_port_subscribe_set_time_real(snd_seq_port_subscribe_t *info, int val);
|
jpayne@69
|
342
|
jpayne@69
|
343 int snd_seq_get_port_subscription(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
|
jpayne@69
|
344 int snd_seq_subscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
|
jpayne@69
|
345 int snd_seq_unsubscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub);
|
jpayne@69
|
346
|
jpayne@69
|
347 /*
|
jpayne@69
|
348 */
|
jpayne@69
|
349
|
jpayne@69
|
350 /** subscription query container */
|
jpayne@69
|
351 typedef struct _snd_seq_query_subscribe snd_seq_query_subscribe_t;
|
jpayne@69
|
352
|
jpayne@69
|
353 /** type of query subscription */
|
jpayne@69
|
354 typedef enum {
|
jpayne@69
|
355 SND_SEQ_QUERY_SUBS_READ, /**< query read subscriptions */
|
jpayne@69
|
356 SND_SEQ_QUERY_SUBS_WRITE /**< query write subscriptions */
|
jpayne@69
|
357 } snd_seq_query_subs_type_t;
|
jpayne@69
|
358
|
jpayne@69
|
359 size_t snd_seq_query_subscribe_sizeof(void);
|
jpayne@69
|
360 /** allocate a #snd_seq_query_subscribe_t container on stack */
|
jpayne@69
|
361 #define snd_seq_query_subscribe_alloca(ptr) \
|
jpayne@69
|
362 __snd_alloca(ptr, snd_seq_query_subscribe)
|
jpayne@69
|
363 int snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t **ptr);
|
jpayne@69
|
364 void snd_seq_query_subscribe_free(snd_seq_query_subscribe_t *ptr);
|
jpayne@69
|
365 void snd_seq_query_subscribe_copy(snd_seq_query_subscribe_t *dst, const snd_seq_query_subscribe_t *src);
|
jpayne@69
|
366
|
jpayne@69
|
367 int snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
368 int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
369 const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
370 snd_seq_query_subs_type_t snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
371 int snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
372 int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
373 const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
374 int snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
375 int snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
376 int snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
377 int snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t *info);
|
jpayne@69
|
378
|
jpayne@69
|
379 void snd_seq_query_subscribe_set_client(snd_seq_query_subscribe_t *info, int client);
|
jpayne@69
|
380 void snd_seq_query_subscribe_set_port(snd_seq_query_subscribe_t *info, int port);
|
jpayne@69
|
381 void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr);
|
jpayne@69
|
382 void snd_seq_query_subscribe_set_type(snd_seq_query_subscribe_t *info, snd_seq_query_subs_type_t type);
|
jpayne@69
|
383 void snd_seq_query_subscribe_set_index(snd_seq_query_subscribe_t *info, int _index);
|
jpayne@69
|
384
|
jpayne@69
|
385 int snd_seq_query_port_subscribers(snd_seq_t *seq, snd_seq_query_subscribe_t * subs);
|
jpayne@69
|
386
|
jpayne@69
|
387 /** \} */
|
jpayne@69
|
388
|
jpayne@69
|
389
|
jpayne@69
|
390 /**
|
jpayne@69
|
391 * \defgroup SeqQueue Sequencer Queue Interface
|
jpayne@69
|
392 * Sequencer Queue Interface
|
jpayne@69
|
393 * \ingroup Sequencer
|
jpayne@69
|
394 * \{
|
jpayne@69
|
395 */
|
jpayne@69
|
396
|
jpayne@69
|
397 /** queue information container */
|
jpayne@69
|
398 typedef struct _snd_seq_queue_info snd_seq_queue_info_t;
|
jpayne@69
|
399 /** queue status container */
|
jpayne@69
|
400 typedef struct _snd_seq_queue_status snd_seq_queue_status_t;
|
jpayne@69
|
401 /** queue tempo container */
|
jpayne@69
|
402 typedef struct _snd_seq_queue_tempo snd_seq_queue_tempo_t;
|
jpayne@69
|
403 /** queue timer information container */
|
jpayne@69
|
404 typedef struct _snd_seq_queue_timer snd_seq_queue_timer_t;
|
jpayne@69
|
405
|
jpayne@69
|
406 /** special queue ids */
|
jpayne@69
|
407 #define SND_SEQ_QUEUE_DIRECT 253 /**< direct dispatch */
|
jpayne@69
|
408
|
jpayne@69
|
409 size_t snd_seq_queue_info_sizeof(void);
|
jpayne@69
|
410 /** allocate a #snd_seq_queue_info_t container on stack */
|
jpayne@69
|
411 #define snd_seq_queue_info_alloca(ptr) \
|
jpayne@69
|
412 __snd_alloca(ptr, snd_seq_queue_info)
|
jpayne@69
|
413 int snd_seq_queue_info_malloc(snd_seq_queue_info_t **ptr);
|
jpayne@69
|
414 void snd_seq_queue_info_free(snd_seq_queue_info_t *ptr);
|
jpayne@69
|
415 void snd_seq_queue_info_copy(snd_seq_queue_info_t *dst, const snd_seq_queue_info_t *src);
|
jpayne@69
|
416
|
jpayne@69
|
417 int snd_seq_queue_info_get_queue(const snd_seq_queue_info_t *info);
|
jpayne@69
|
418 const char *snd_seq_queue_info_get_name(const snd_seq_queue_info_t *info);
|
jpayne@69
|
419 int snd_seq_queue_info_get_owner(const snd_seq_queue_info_t *info);
|
jpayne@69
|
420 int snd_seq_queue_info_get_locked(const snd_seq_queue_info_t *info);
|
jpayne@69
|
421 unsigned int snd_seq_queue_info_get_flags(const snd_seq_queue_info_t *info);
|
jpayne@69
|
422
|
jpayne@69
|
423 void snd_seq_queue_info_set_name(snd_seq_queue_info_t *info, const char *name);
|
jpayne@69
|
424 void snd_seq_queue_info_set_owner(snd_seq_queue_info_t *info, int owner);
|
jpayne@69
|
425 void snd_seq_queue_info_set_locked(snd_seq_queue_info_t *info, int locked);
|
jpayne@69
|
426 void snd_seq_queue_info_set_flags(snd_seq_queue_info_t *info, unsigned int flags);
|
jpayne@69
|
427
|
jpayne@69
|
428 int snd_seq_create_queue(snd_seq_t *seq, snd_seq_queue_info_t *info);
|
jpayne@69
|
429 int snd_seq_alloc_named_queue(snd_seq_t *seq, const char *name);
|
jpayne@69
|
430 int snd_seq_alloc_queue(snd_seq_t *handle);
|
jpayne@69
|
431 int snd_seq_free_queue(snd_seq_t *handle, int q);
|
jpayne@69
|
432 int snd_seq_get_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info);
|
jpayne@69
|
433 int snd_seq_set_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info);
|
jpayne@69
|
434 int snd_seq_query_named_queue(snd_seq_t *seq, const char *name);
|
jpayne@69
|
435
|
jpayne@69
|
436 int snd_seq_get_queue_usage(snd_seq_t *handle, int q);
|
jpayne@69
|
437 int snd_seq_set_queue_usage(snd_seq_t *handle, int q, int used);
|
jpayne@69
|
438
|
jpayne@69
|
439 /*
|
jpayne@69
|
440 */
|
jpayne@69
|
441 size_t snd_seq_queue_status_sizeof(void);
|
jpayne@69
|
442 /** allocate a #snd_seq_queue_status_t container on stack */
|
jpayne@69
|
443 #define snd_seq_queue_status_alloca(ptr) \
|
jpayne@69
|
444 __snd_alloca(ptr, snd_seq_queue_status)
|
jpayne@69
|
445 int snd_seq_queue_status_malloc(snd_seq_queue_status_t **ptr);
|
jpayne@69
|
446 void snd_seq_queue_status_free(snd_seq_queue_status_t *ptr);
|
jpayne@69
|
447 void snd_seq_queue_status_copy(snd_seq_queue_status_t *dst, const snd_seq_queue_status_t *src);
|
jpayne@69
|
448
|
jpayne@69
|
449 int snd_seq_queue_status_get_queue(const snd_seq_queue_status_t *info);
|
jpayne@69
|
450 int snd_seq_queue_status_get_events(const snd_seq_queue_status_t *info);
|
jpayne@69
|
451 snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_status_t *info);
|
jpayne@69
|
452 const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info);
|
jpayne@69
|
453 unsigned int snd_seq_queue_status_get_status(const snd_seq_queue_status_t *info);
|
jpayne@69
|
454
|
jpayne@69
|
455 int snd_seq_get_queue_status(snd_seq_t *handle, int q, snd_seq_queue_status_t *status);
|
jpayne@69
|
456
|
jpayne@69
|
457 /*
|
jpayne@69
|
458 */
|
jpayne@69
|
459 size_t snd_seq_queue_tempo_sizeof(void);
|
jpayne@69
|
460 /** allocate a #snd_seq_queue_tempo_t container on stack */
|
jpayne@69
|
461 #define snd_seq_queue_tempo_alloca(ptr) \
|
jpayne@69
|
462 __snd_alloca(ptr, snd_seq_queue_tempo)
|
jpayne@69
|
463 int snd_seq_queue_tempo_malloc(snd_seq_queue_tempo_t **ptr);
|
jpayne@69
|
464 void snd_seq_queue_tempo_free(snd_seq_queue_tempo_t *ptr);
|
jpayne@69
|
465 void snd_seq_queue_tempo_copy(snd_seq_queue_tempo_t *dst, const snd_seq_queue_tempo_t *src);
|
jpayne@69
|
466
|
jpayne@69
|
467 int snd_seq_queue_tempo_get_queue(const snd_seq_queue_tempo_t *info);
|
jpayne@69
|
468 unsigned int snd_seq_queue_tempo_get_tempo(const snd_seq_queue_tempo_t *info);
|
jpayne@69
|
469 int snd_seq_queue_tempo_get_ppq(const snd_seq_queue_tempo_t *info);
|
jpayne@69
|
470 unsigned int snd_seq_queue_tempo_get_skew(const snd_seq_queue_tempo_t *info);
|
jpayne@69
|
471 unsigned int snd_seq_queue_tempo_get_skew_base(const snd_seq_queue_tempo_t *info);
|
jpayne@69
|
472 void snd_seq_queue_tempo_set_tempo(snd_seq_queue_tempo_t *info, unsigned int tempo);
|
jpayne@69
|
473 void snd_seq_queue_tempo_set_ppq(snd_seq_queue_tempo_t *info, int ppq);
|
jpayne@69
|
474 void snd_seq_queue_tempo_set_skew(snd_seq_queue_tempo_t *info, unsigned int skew);
|
jpayne@69
|
475 void snd_seq_queue_tempo_set_skew_base(snd_seq_queue_tempo_t *info, unsigned int base);
|
jpayne@69
|
476
|
jpayne@69
|
477 int snd_seq_get_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo);
|
jpayne@69
|
478 int snd_seq_set_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo);
|
jpayne@69
|
479
|
jpayne@69
|
480 /*
|
jpayne@69
|
481 */
|
jpayne@69
|
482
|
jpayne@69
|
483 /** sequencer timer sources */
|
jpayne@69
|
484 typedef enum {
|
jpayne@69
|
485 SND_SEQ_TIMER_ALSA = 0, /* ALSA timer */
|
jpayne@69
|
486 SND_SEQ_TIMER_MIDI_CLOCK = 1, /* Midi Clock (CLOCK event) */
|
jpayne@69
|
487 SND_SEQ_TIMER_MIDI_TICK = 2 /* Midi Timer Tick (TICK event */
|
jpayne@69
|
488 } snd_seq_queue_timer_type_t;
|
jpayne@69
|
489
|
jpayne@69
|
490 size_t snd_seq_queue_timer_sizeof(void);
|
jpayne@69
|
491 /** allocate a #snd_seq_queue_timer_t container on stack */
|
jpayne@69
|
492 #define snd_seq_queue_timer_alloca(ptr) \
|
jpayne@69
|
493 __snd_alloca(ptr, snd_seq_queue_timer)
|
jpayne@69
|
494 int snd_seq_queue_timer_malloc(snd_seq_queue_timer_t **ptr);
|
jpayne@69
|
495 void snd_seq_queue_timer_free(snd_seq_queue_timer_t *ptr);
|
jpayne@69
|
496 void snd_seq_queue_timer_copy(snd_seq_queue_timer_t *dst, const snd_seq_queue_timer_t *src);
|
jpayne@69
|
497
|
jpayne@69
|
498 int snd_seq_queue_timer_get_queue(const snd_seq_queue_timer_t *info);
|
jpayne@69
|
499 snd_seq_queue_timer_type_t snd_seq_queue_timer_get_type(const snd_seq_queue_timer_t *info);
|
jpayne@69
|
500 const snd_timer_id_t *snd_seq_queue_timer_get_id(const snd_seq_queue_timer_t *info);
|
jpayne@69
|
501 unsigned int snd_seq_queue_timer_get_resolution(const snd_seq_queue_timer_t *info);
|
jpayne@69
|
502
|
jpayne@69
|
503 void snd_seq_queue_timer_set_type(snd_seq_queue_timer_t *info, snd_seq_queue_timer_type_t type);
|
jpayne@69
|
504 void snd_seq_queue_timer_set_id(snd_seq_queue_timer_t *info, const snd_timer_id_t *id);
|
jpayne@69
|
505 void snd_seq_queue_timer_set_resolution(snd_seq_queue_timer_t *info, unsigned int resolution);
|
jpayne@69
|
506
|
jpayne@69
|
507 int snd_seq_get_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);
|
jpayne@69
|
508 int snd_seq_set_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer);
|
jpayne@69
|
509
|
jpayne@69
|
510 /** \} */
|
jpayne@69
|
511
|
jpayne@69
|
512 /**
|
jpayne@69
|
513 * \defgroup SeqEvent Sequencer Event API
|
jpayne@69
|
514 * Sequencer Event API
|
jpayne@69
|
515 * \ingroup Sequencer
|
jpayne@69
|
516 * \{
|
jpayne@69
|
517 */
|
jpayne@69
|
518
|
jpayne@69
|
519 int snd_seq_free_event(snd_seq_event_t *ev);
|
jpayne@69
|
520 ssize_t snd_seq_event_length(snd_seq_event_t *ev);
|
jpayne@69
|
521 int snd_seq_event_output(snd_seq_t *handle, snd_seq_event_t *ev);
|
jpayne@69
|
522 int snd_seq_event_output_buffer(snd_seq_t *handle, snd_seq_event_t *ev);
|
jpayne@69
|
523 int snd_seq_event_output_direct(snd_seq_t *handle, snd_seq_event_t *ev);
|
jpayne@69
|
524 int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev);
|
jpayne@69
|
525 int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer);
|
jpayne@69
|
526 int snd_seq_drain_output(snd_seq_t *handle);
|
jpayne@69
|
527 int snd_seq_event_output_pending(snd_seq_t *seq);
|
jpayne@69
|
528 int snd_seq_extract_output(snd_seq_t *handle, snd_seq_event_t **ev);
|
jpayne@69
|
529 int snd_seq_drop_output(snd_seq_t *handle);
|
jpayne@69
|
530 int snd_seq_drop_output_buffer(snd_seq_t *handle);
|
jpayne@69
|
531 int snd_seq_drop_input(snd_seq_t *handle);
|
jpayne@69
|
532 int snd_seq_drop_input_buffer(snd_seq_t *handle);
|
jpayne@69
|
533
|
jpayne@69
|
534 /** event removal conditionals */
|
jpayne@69
|
535 typedef struct _snd_seq_remove_events snd_seq_remove_events_t;
|
jpayne@69
|
536
|
jpayne@69
|
537 /** Remove conditional flags */
|
jpayne@69
|
538 #define SND_SEQ_REMOVE_INPUT (1<<0) /**< Flush input queues */
|
jpayne@69
|
539 #define SND_SEQ_REMOVE_OUTPUT (1<<1) /**< Flush output queues */
|
jpayne@69
|
540 #define SND_SEQ_REMOVE_DEST (1<<2) /**< Restrict by destination q:client:port */
|
jpayne@69
|
541 #define SND_SEQ_REMOVE_DEST_CHANNEL (1<<3) /**< Restrict by channel */
|
jpayne@69
|
542 #define SND_SEQ_REMOVE_TIME_BEFORE (1<<4) /**< Restrict to before time */
|
jpayne@69
|
543 #define SND_SEQ_REMOVE_TIME_AFTER (1<<5) /**< Restrict to time or after */
|
jpayne@69
|
544 #define SND_SEQ_REMOVE_TIME_TICK (1<<6) /**< Time is in ticks */
|
jpayne@69
|
545 #define SND_SEQ_REMOVE_EVENT_TYPE (1<<7) /**< Restrict to event type */
|
jpayne@69
|
546 #define SND_SEQ_REMOVE_IGNORE_OFF (1<<8) /**< Do not flush off events */
|
jpayne@69
|
547 #define SND_SEQ_REMOVE_TAG_MATCH (1<<9) /**< Restrict to events with given tag */
|
jpayne@69
|
548
|
jpayne@69
|
549 size_t snd_seq_remove_events_sizeof(void);
|
jpayne@69
|
550 /** allocate a #snd_seq_remove_events_t container on stack */
|
jpayne@69
|
551 #define snd_seq_remove_events_alloca(ptr) \
|
jpayne@69
|
552 __snd_alloca(ptr, snd_seq_remove_events)
|
jpayne@69
|
553 int snd_seq_remove_events_malloc(snd_seq_remove_events_t **ptr);
|
jpayne@69
|
554 void snd_seq_remove_events_free(snd_seq_remove_events_t *ptr);
|
jpayne@69
|
555 void snd_seq_remove_events_copy(snd_seq_remove_events_t *dst, const snd_seq_remove_events_t *src);
|
jpayne@69
|
556
|
jpayne@69
|
557 unsigned int snd_seq_remove_events_get_condition(const snd_seq_remove_events_t *info);
|
jpayne@69
|
558 int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info);
|
jpayne@69
|
559 const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info);
|
jpayne@69
|
560 const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info);
|
jpayne@69
|
561 int snd_seq_remove_events_get_channel(const snd_seq_remove_events_t *info);
|
jpayne@69
|
562 int snd_seq_remove_events_get_event_type(const snd_seq_remove_events_t *info);
|
jpayne@69
|
563 int snd_seq_remove_events_get_tag(const snd_seq_remove_events_t *info);
|
jpayne@69
|
564
|
jpayne@69
|
565 void snd_seq_remove_events_set_condition(snd_seq_remove_events_t *info, unsigned int flags);
|
jpayne@69
|
566 void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue);
|
jpayne@69
|
567 void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time);
|
jpayne@69
|
568 void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr);
|
jpayne@69
|
569 void snd_seq_remove_events_set_channel(snd_seq_remove_events_t *info, int channel);
|
jpayne@69
|
570 void snd_seq_remove_events_set_event_type(snd_seq_remove_events_t *info, int type);
|
jpayne@69
|
571 void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag);
|
jpayne@69
|
572
|
jpayne@69
|
573 int snd_seq_remove_events(snd_seq_t *handle, snd_seq_remove_events_t *info);
|
jpayne@69
|
574
|
jpayne@69
|
575 /** \} */
|
jpayne@69
|
576
|
jpayne@69
|
577 /**
|
jpayne@69
|
578 * \defgroup SeqMisc Sequencer Miscellaneous
|
jpayne@69
|
579 * Sequencer Miscellaneous
|
jpayne@69
|
580 * \ingroup Sequencer
|
jpayne@69
|
581 * \{
|
jpayne@69
|
582 */
|
jpayne@69
|
583
|
jpayne@69
|
584 void snd_seq_set_bit(int nr, void *array);
|
jpayne@69
|
585 void snd_seq_unset_bit(int nr, void *array);
|
jpayne@69
|
586 int snd_seq_change_bit(int nr, void *array);
|
jpayne@69
|
587 int snd_seq_get_bit(int nr, void *array);
|
jpayne@69
|
588
|
jpayne@69
|
589 /** \} */
|
jpayne@69
|
590
|
jpayne@69
|
591
|
jpayne@69
|
592 /**
|
jpayne@69
|
593 * \defgroup SeqEvType Sequencer Event Type Checks
|
jpayne@69
|
594 * Sequencer Event Type Checks
|
jpayne@69
|
595 * \ingroup Sequencer
|
jpayne@69
|
596 * \{
|
jpayne@69
|
597 */
|
jpayne@69
|
598
|
jpayne@69
|
599 /* event type macros */
|
jpayne@69
|
600 enum {
|
jpayne@69
|
601 SND_SEQ_EVFLG_RESULT,
|
jpayne@69
|
602 SND_SEQ_EVFLG_NOTE,
|
jpayne@69
|
603 SND_SEQ_EVFLG_CONTROL,
|
jpayne@69
|
604 SND_SEQ_EVFLG_QUEUE,
|
jpayne@69
|
605 SND_SEQ_EVFLG_SYSTEM,
|
jpayne@69
|
606 SND_SEQ_EVFLG_MESSAGE,
|
jpayne@69
|
607 SND_SEQ_EVFLG_CONNECTION,
|
jpayne@69
|
608 SND_SEQ_EVFLG_SAMPLE,
|
jpayne@69
|
609 SND_SEQ_EVFLG_USERS,
|
jpayne@69
|
610 SND_SEQ_EVFLG_INSTR,
|
jpayne@69
|
611 SND_SEQ_EVFLG_QUOTE,
|
jpayne@69
|
612 SND_SEQ_EVFLG_NONE,
|
jpayne@69
|
613 SND_SEQ_EVFLG_RAW,
|
jpayne@69
|
614 SND_SEQ_EVFLG_FIXED,
|
jpayne@69
|
615 SND_SEQ_EVFLG_VARIABLE,
|
jpayne@69
|
616 SND_SEQ_EVFLG_VARUSR
|
jpayne@69
|
617 };
|
jpayne@69
|
618
|
jpayne@69
|
619 enum {
|
jpayne@69
|
620 SND_SEQ_EVFLG_NOTE_ONEARG,
|
jpayne@69
|
621 SND_SEQ_EVFLG_NOTE_TWOARG
|
jpayne@69
|
622 };
|
jpayne@69
|
623
|
jpayne@69
|
624 enum {
|
jpayne@69
|
625 SND_SEQ_EVFLG_QUEUE_NOARG,
|
jpayne@69
|
626 SND_SEQ_EVFLG_QUEUE_TICK,
|
jpayne@69
|
627 SND_SEQ_EVFLG_QUEUE_TIME,
|
jpayne@69
|
628 SND_SEQ_EVFLG_QUEUE_VALUE
|
jpayne@69
|
629 };
|
jpayne@69
|
630
|
jpayne@69
|
631 /**
|
jpayne@69
|
632 * Exported event type table
|
jpayne@69
|
633 *
|
jpayne@69
|
634 * This table is referred by snd_seq_ev_is_xxx.
|
jpayne@69
|
635 */
|
jpayne@69
|
636 extern const unsigned int snd_seq_event_types[];
|
jpayne@69
|
637
|
jpayne@69
|
638 #define _SND_SEQ_TYPE(x) (1<<(x)) /**< master type - 24bit */
|
jpayne@69
|
639 #define _SND_SEQ_TYPE_OPT(x) ((x)<<24) /**< optional type - 8bit */
|
jpayne@69
|
640
|
jpayne@69
|
641 /** check the event type */
|
jpayne@69
|
642 #define snd_seq_type_check(ev,x) (snd_seq_event_types[(ev)->type] & _SND_SEQ_TYPE(x))
|
jpayne@69
|
643
|
jpayne@69
|
644 /** event type check: result events */
|
jpayne@69
|
645 #define snd_seq_ev_is_result_type(ev) \
|
jpayne@69
|
646 snd_seq_type_check(ev, SND_SEQ_EVFLG_RESULT)
|
jpayne@69
|
647 /** event type check: note events */
|
jpayne@69
|
648 #define snd_seq_ev_is_note_type(ev) \
|
jpayne@69
|
649 snd_seq_type_check(ev, SND_SEQ_EVFLG_NOTE)
|
jpayne@69
|
650 /** event type check: control events */
|
jpayne@69
|
651 #define snd_seq_ev_is_control_type(ev) \
|
jpayne@69
|
652 snd_seq_type_check(ev, SND_SEQ_EVFLG_CONTROL)
|
jpayne@69
|
653 /** event type check: channel specific events */
|
jpayne@69
|
654 #define snd_seq_ev_is_channel_type(ev) \
|
jpayne@69
|
655 (snd_seq_event_types[(ev)->type] & (_SND_SEQ_TYPE(SND_SEQ_EVFLG_NOTE) | _SND_SEQ_TYPE(SND_SEQ_EVFLG_CONTROL)))
|
jpayne@69
|
656
|
jpayne@69
|
657 /** event type check: queue control events */
|
jpayne@69
|
658 #define snd_seq_ev_is_queue_type(ev) \
|
jpayne@69
|
659 snd_seq_type_check(ev, SND_SEQ_EVFLG_QUEUE)
|
jpayne@69
|
660 /** event type check: system status messages */
|
jpayne@69
|
661 #define snd_seq_ev_is_message_type(ev) \
|
jpayne@69
|
662 snd_seq_type_check(ev, SND_SEQ_EVFLG_MESSAGE)
|
jpayne@69
|
663 /** event type check: system status messages */
|
jpayne@69
|
664 #define snd_seq_ev_is_subscribe_type(ev) \
|
jpayne@69
|
665 snd_seq_type_check(ev, SND_SEQ_EVFLG_CONNECTION)
|
jpayne@69
|
666 /** event type check: sample messages */
|
jpayne@69
|
667 #define snd_seq_ev_is_sample_type(ev) \
|
jpayne@69
|
668 snd_seq_type_check(ev, SND_SEQ_EVFLG_SAMPLE)
|
jpayne@69
|
669 /** event type check: user-defined messages */
|
jpayne@69
|
670 #define snd_seq_ev_is_user_type(ev) \
|
jpayne@69
|
671 snd_seq_type_check(ev, SND_SEQ_EVFLG_USERS)
|
jpayne@69
|
672 /** event type check: instrument layer events */
|
jpayne@69
|
673 #define snd_seq_ev_is_instr_type(ev) \
|
jpayne@69
|
674 snd_seq_type_check(ev, SND_SEQ_EVFLG_INSTR)
|
jpayne@69
|
675 /** event type check: fixed length events */
|
jpayne@69
|
676 #define snd_seq_ev_is_fixed_type(ev) \
|
jpayne@69
|
677 snd_seq_type_check(ev, SND_SEQ_EVFLG_FIXED)
|
jpayne@69
|
678 /** event type check: variable length events */
|
jpayne@69
|
679 #define snd_seq_ev_is_variable_type(ev) \
|
jpayne@69
|
680 snd_seq_type_check(ev, SND_SEQ_EVFLG_VARIABLE)
|
jpayne@69
|
681 /** event type check: user pointer events */
|
jpayne@69
|
682 #define snd_seq_ev_is_varusr_type(ev) \
|
jpayne@69
|
683 snd_seq_type_check(ev, SND_SEQ_EVFLG_VARUSR)
|
jpayne@69
|
684 /** event type check: reserved for kernel */
|
jpayne@69
|
685 #define snd_seq_ev_is_reserved(ev) \
|
jpayne@69
|
686 (! snd_seq_event_types[(ev)->type])
|
jpayne@69
|
687
|
jpayne@69
|
688 /**
|
jpayne@69
|
689 * macros to check event flags
|
jpayne@69
|
690 */
|
jpayne@69
|
691 /** prior events */
|
jpayne@69
|
692 #define snd_seq_ev_is_prior(ev) \
|
jpayne@69
|
693 (((ev)->flags & SND_SEQ_PRIORITY_MASK) == SND_SEQ_PRIORITY_HIGH)
|
jpayne@69
|
694
|
jpayne@69
|
695 /** get the data length type */
|
jpayne@69
|
696 #define snd_seq_ev_length_type(ev) \
|
jpayne@69
|
697 ((ev)->flags & SND_SEQ_EVENT_LENGTH_MASK)
|
jpayne@69
|
698 /** fixed length events */
|
jpayne@69
|
699 #define snd_seq_ev_is_fixed(ev) \
|
jpayne@69
|
700 (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_FIXED)
|
jpayne@69
|
701 /** variable length events */
|
jpayne@69
|
702 #define snd_seq_ev_is_variable(ev) \
|
jpayne@69
|
703 (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARIABLE)
|
jpayne@69
|
704 /** variable length on user-space */
|
jpayne@69
|
705 #define snd_seq_ev_is_varusr(ev) \
|
jpayne@69
|
706 (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARUSR)
|
jpayne@69
|
707
|
jpayne@69
|
708 /** time-stamp type */
|
jpayne@69
|
709 #define snd_seq_ev_timestamp_type(ev) \
|
jpayne@69
|
710 ((ev)->flags & SND_SEQ_TIME_STAMP_MASK)
|
jpayne@69
|
711 /** event is in tick time */
|
jpayne@69
|
712 #define snd_seq_ev_is_tick(ev) \
|
jpayne@69
|
713 (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_TICK)
|
jpayne@69
|
714 /** event is in real-time */
|
jpayne@69
|
715 #define snd_seq_ev_is_real(ev) \
|
jpayne@69
|
716 (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_REAL)
|
jpayne@69
|
717
|
jpayne@69
|
718 /** time-mode type */
|
jpayne@69
|
719 #define snd_seq_ev_timemode_type(ev) \
|
jpayne@69
|
720 ((ev)->flags & SND_SEQ_TIME_MODE_MASK)
|
jpayne@69
|
721 /** scheduled in absolute time */
|
jpayne@69
|
722 #define snd_seq_ev_is_abstime(ev) \
|
jpayne@69
|
723 (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_ABS)
|
jpayne@69
|
724 /** scheduled in relative time */
|
jpayne@69
|
725 #define snd_seq_ev_is_reltime(ev) \
|
jpayne@69
|
726 (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_REL)
|
jpayne@69
|
727
|
jpayne@69
|
728 /** direct dispatched events */
|
jpayne@69
|
729 #define snd_seq_ev_is_direct(ev) \
|
jpayne@69
|
730 ((ev)->queue == SND_SEQ_QUEUE_DIRECT)
|
jpayne@69
|
731
|
jpayne@69
|
732 /** \} */
|
jpayne@69
|
733
|
jpayne@69
|
734 #ifdef __cplusplus
|
jpayne@69
|
735 }
|
jpayne@69
|
736 #endif
|
jpayne@69
|
737
|
jpayne@69
|
738 #endif /* __ALSA_SEQ_H */
|
jpayne@69
|
739
|