/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * Main header file for the ALSA sequencer * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl> * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
*/ #ifndef _UAPI__SOUND_ASEQUENCER_H #define _UAPI__SOUND_ASEQUENCER_H
#include <sound/asound.h>
/** version of the sequencer */ #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 5)
/** * definition of sequencer event types
*/
/** system messages * event data type = #snd_seq_result
*/ #define SNDRV_SEQ_EVENT_SYSTEM 0 #define SNDRV_SEQ_EVENT_RESULT 1
/** control messages (channel specific) * event data type = #snd_seq_ev_ctrl
*/ #define SNDRV_SEQ_EVENT_CONTROLLER 10 #define SNDRV_SEQ_EVENT_PGMCHANGE 11 #define SNDRV_SEQ_EVENT_CHANPRESS 12 #define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */ #define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */ #define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */ #define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
/** synchronisation messages * event data type = #snd_seq_ev_ctrl
*/ #define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */ #define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */ #define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */ #define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */ #define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
/** timer messages * event data type = snd_seq_ev_queue_control
*/ #define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */ #define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */ #define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */ #define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */ #define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */ #define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */ #define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */ #define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */ #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
/** others * event data type = none
*/ #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */ #define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */ #define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
/** echo back, kernel private messages * event data type = any type
*/ #define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */ #define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
/** system status messages (broadcast for subscribers) * event data type = snd_seq_addr
*/ #define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */ #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */ #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */ #define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */ #define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */ #define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
/** port connection changes * event data type = snd_seq_connect
*/ #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
#define SNDRV_SEQ_EVENT_UMP_EP_CHANGE 68 /* UMP EP info has changed */ #define SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE 69 /* UMP block info has changed */
/* 130-139: variable length events * event data type = snd_seq_ev_ext * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
*/ #define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */ #define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */ /* 132-134: reserved */ #define SNDRV_SEQ_EVENT_USR_VAR0 135 #define SNDRV_SEQ_EVENT_USR_VAR1 136 #define SNDRV_SEQ_EVENT_USR_VAR2 137 #define SNDRV_SEQ_EVENT_USR_VAR3 138 #define SNDRV_SEQ_EVENT_USR_VAR4 139
/* 150-151: kernel events with quote - DO NOT use in user clients */ #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150 #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
/* 152-191: reserved */
/* 192-254: hardware specific events */
/* 255: special event */ #define SNDRV_SEQ_EVENT_NONE 255
typedefunsignedchar snd_seq_event_type_t;
/** event address */ struct snd_seq_addr { unsignedchar client; /**< Client number: 0..255, 255 = broadcast to all clients */ unsignedchar port; /**< Port within client: 0..255, 255 = broadcast to all ports */
};
union { union snd_seq_event_data data; unsignedint ump[4];
};
};
/* * bounce event - stored as variable size data
*/ struct snd_seq_event_bounce { int err; struct snd_seq_event event; /* external data follows here. */
};
/* system information */ struct snd_seq_system_info { int queues; /* maximum queues count */ int clients; /* maximum clients count */ int ports; /* maximum ports per client */ int channels; /* maximum channels per port */ int cur_clients; /* current clients */ int cur_queues; /* current queues */ char reserved[24];
};
/* client pool size */ struct snd_seq_client_pool { int client; /* client number to inquire */ int output_pool; /* outgoing (write) pool size */ int input_pool; /* incoming (read) pool size */ int output_room; /* minimum free pool size for select/blocking mode */ int output_free; /* unused size */ int input_free; /* unused size */ char reserved[64];
};
/* Remove events by specified criteria */
#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */ #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */ #define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */ #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */ #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */ #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */ #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */ #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */ #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */ #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
struct snd_seq_remove_events { unsignedint remove_mode; /* Flags that determine what gets removed */
union snd_seq_timestamp time;
unsignedchar queue; /* Queue for REMOVE_DEST */ struct snd_seq_addr dest; /* Address for REMOVE_DEST */ unsignedchar channel; /* Channel for REMOVE_DEST */
int type; /* For REMOVE_EVENT_TYPE */ char tag; /* Tag for REMOVE_TAG */
int reserved[10]; /* To allow for future binary compatibility */
};
/* known port numbers */ #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0 #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
/* port capabilities (32 bits) */ #define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */ #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
/* port direction */ #define SNDRV_SEQ_PORT_DIR_UNKNOWN 0 #define SNDRV_SEQ_PORT_DIR_INPUT 1 #define SNDRV_SEQ_PORT_DIR_OUTPUT 2 #define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3
struct snd_seq_port_info { struct snd_seq_addr addr; /* client/port numbers */ char name[64]; /* port name */
unsignedint capability; /* port capability bits */ unsignedint type; /* port type bits */ int midi_channels; /* channels per MIDI port */ int midi_voices; /* voices per MIDI port */ int synth_voices; /* voices per SYNTH port */
int read_use; /* R/O: subscribers for output (from this port) */ int write_use; /* R/O: subscribers for input (to this port) */
void *kernel; /* reserved for kernel use (must be NULL) */ unsignedint flags; /* misc. conditioning */ unsignedchar time_queue; /* queue # for timestamping */ unsignedchar direction; /* port usage direction (r/w/bidir) */ unsignedchar ump_group; /* 0 = UMP EP (no conversion), 1-16 = UMP group number */ char reserved[57]; /* for future use */
};
/* queue information */ struct snd_seq_queue_info { int queue; /* queue id */
/* * security settings, only owner of this queue can start/stop timer * etc. if the queue is locked for other clients
*/ int owner; /* client id for owner of the queue */ unsigned locked:1; /* timing queue locked for other queues */ char name[64]; /* name of this queue */ unsignedint flags; /* flags */ char reserved[60]; /* for future use */
};
/* queue info/status */ struct snd_seq_queue_status { int queue; /* queue id */ int events; /* read-only - queue size */
snd_seq_tick_time_t tick; /* current tick */ struct snd_seq_real_time time; /* current time */ int running; /* running state of queue */ int flags; /* various flags */ char reserved[64]; /* for the future */
};
/* queue tempo */ struct snd_seq_queue_tempo { int queue; /* sequencer queue */ unsignedint tempo; /* current tempo, us/tick (or different time-base below) */ int ppq; /* time resolution, ticks/quarter */ unsignedint skew_value; /* queue skew */ unsignedint skew_base; /* queue skew base */ unsignedshort tempo_base; /* tempo base in nsec unit; either 10 or 1000 */ char reserved[22]; /* for the future */
};
/* queue timer info */ struct snd_seq_queue_timer { int queue; /* sequencer queue */ int type; /* source timer type */ union { struct { struct snd_timer_id id; /* ALSA's timer ID */ unsignedint resolution; /* resolution in Hz */
} alsa;
} u; char reserved[64]; /* for the future use */
};
struct snd_seq_queue_client { int queue; /* sequencer queue */ int client; /* sequencer client */ int used; /* queue is used with this client
(must be set for accepting events) */ /* per client watermarks */ char reserved[64]; /* for future use */
};
/* type of query subscription */ #define SNDRV_SEQ_QUERY_SUBS_READ 0 #define SNDRV_SEQ_QUERY_SUBS_WRITE 1
struct snd_seq_query_subs { struct snd_seq_addr root; /* client/port id to be searched */ int type; /* READ or WRITE */ int index; /* 0..N-1 */ int num_subs; /* R/O: number of subscriptions on this port */ struct snd_seq_addr addr; /* R/O: result */ unsignedchar queue; /* R/O: result */ unsignedint flags; /* R/O: result */ char reserved[64]; /* for future use */
};
/* * UMP-specific information
*/ /* type of UMP info query */ #define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT 0 #define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK 1
struct snd_seq_client_ump_info { int client; /* client number to inquire/set */ int type; /* type to inquire/set */ unsignedchar info[512]; /* info (either UMP ep or block info) */
} __packed;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.