📄 asequencer.h
字号:
/* system running information */struct snd_seq_running_info { unsigned char client; /* client id */ unsigned char big_endian; /* 1 = big-endian */ unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */ unsigned char pad; /* reserved */ unsigned char reserved[12];}; /* known client numbers */#define SNDRV_SEQ_CLIENT_SYSTEM 0 /* internal client numbers */#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */ /* client types */typedef int __bitwise snd_seq_client_type_t;#define NO_CLIENT ( (snd_seq_client_type_t) 0)#define USER_CLIENT ( (snd_seq_client_type_t) 1)#define KERNEL_CLIENT ( (snd_seq_client_type_t) 2) /* event filter flags */#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */struct snd_seq_client_info { int client; /* client number to inquire */ snd_seq_client_type_t type; /* client type */ char name[64]; /* client name */ unsigned int filter; /* filter flags */ unsigned char multicast_filter[8]; /* multicast filter bitmap */ unsigned char event_filter[32]; /* event filter bitmap */ int num_ports; /* RO: number of ports */ int event_lost; /* number of lost events */ char reserved[64]; /* for future use */};/* 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 { unsigned int remove_mode; /* Flags that determine what gets removed */ union snd_seq_timestamp time; unsigned char queue; /* Queue for REMOVE_DEST */ struct snd_seq_addr dest; /* Address for REMOVE_DEST */ unsigned char 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 */#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */ /* port type */#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device *//* other standards...*/#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) *//*...*/#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) *//* misc. conditioning flags */#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)struct snd_seq_port_info { struct snd_seq_addr addr; /* client/port numbers */ char name[64]; /* port name */ unsigned int capability; /* port capability bits */ unsigned int 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) */ unsigned int flags; /* misc. conditioning */ unsigned char time_queue; /* queue # for timestamping */ char reserved[59]; /* for future use */};/* queue flags */#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled *//* 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 */ unsigned int 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 */ unsigned int tempo; /* current tempo, us/tick */ int ppq; /* time resolution, ticks/quarter */ unsigned int skew_value; /* queue skew */ unsigned int skew_base; /* queue skew base */ char reserved[24]; /* for the future */};/* sequencer timer sources */#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) *//* 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 */ unsigned int 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 */};#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)struct snd_seq_port_subscribe { struct snd_seq_addr sender; /* sender address */ struct snd_seq_addr dest; /* destination address */ unsigned int voices; /* number of voices to be allocated (0 = don't care) */ unsigned int flags; /* modes */ unsigned char queue; /* input time-stamp queue (optional) */ unsigned char pad[3]; /* reserved */ char reserved[64];};/* type of query subscription */#define SNDRV_SEQ_QUERY_SUBS_READ 0#define SNDRV_SEQ_QUERY_SUBS_WRITE 1struct 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 */ unsigned char queue; /* R/O: result */ unsigned int flags; /* R/O: result */ char reserved[64]; /* for future use */};/* * Instrument abstraction layer * - based on events *//* instrument types */#define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */#define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias *//* instrument ASCII identifiers */#define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1"#define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2"#define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave"#define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont"#define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch"#define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF"#define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM"#define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4"/* instrument types */#define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */#define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */#define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */#define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */#define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */#define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */#define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */#define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 *//* put commands */#define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0#define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1#define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2#define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3#define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4/* get commands */#define SNDRV_SEQ_INSTR_GET_CMD_FULL 0#define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1/* query flags */#define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0)/* free commands */#define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0#define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1#define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3/* size of ROM/RAM */typedef unsigned int snd_seq_instr_size_t;/* INSTR_INFO */struct snd_seq_instr_info { int result; /* operation result */ unsigned int formats[8]; /* bitmap of supported formats */ int ram_count; /* count of RAM banks */ snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */ int rom_count; /* count of ROM banks */ snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */ char reserved[128];};/* INSTR_STATUS */struct snd_seq_instr_status { int result; /* operation result */ snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */ int instrument_count; /* count of downloaded instruments */ char reserved[128];};/* INSTR_FORMAT_INFO */struct snd_seq_instr_format_info { char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */ unsigned int len; /* max data length (without this structure) */};struct snd_seq_instr_format_info_result { int result; /* operation result */ char format[16]; /* format identifier */ unsigned int len; /* filled data length (without this structure) */};/* instrument data */struct snd_seq_instr_data { char name[32]; /* instrument name */ char reserved[16]; /* for the future use */ int type; /* instrument type */ union { char format[16]; /* format identifier */ struct snd_seq_instr alias; } data;};/* INSTR_PUT/GET, data are stored in one block (extended), header + data */struct snd_seq_instr_header { union { struct snd_seq_instr instr; snd_seq_instr_cluster_t cluster; } id; /* instrument identifier */ unsigned int cmd; /* get/put/free command */ unsigned int flags; /* query flags (only for get) */ unsigned int len; /* real instrument data length (without header) */ int result; /* operation result */ char reserved[16]; /* for the future */ struct snd_seq_instr_data data; /* instrument data (for put/get result) */};/* INSTR_CLUSTER_SET */struct snd_seq_instr_cluster_set { snd_seq_instr_cluster_t cluster; /* cluster identifier */ char name[32]; /* cluster name */ int priority; /* cluster priority */ char reserved[64]; /* for the future use */};/* INSTR_CLUSTER_GET */struct snd_seq_instr_cluster_get { snd_seq_instr_cluster_t cluster; /* cluster identifier */ char name[32]; /* cluster name */ int priority; /* cluster priority */ char reserved[64]; /* for the future use */};/* * IOCTL commands */#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)/* XXX#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)*/#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)#endif /* __SOUND_ASEQUENCER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -