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