📄 asequencer.h
字号:
/* simple loop redefinition */typedef struct { unsigned int start; /* loop start (in samples) * 16 */ unsigned int end; /* loop end (in samples) * 16 */} snd_seq_ev_loop;typedef struct { unsigned char channel; unsigned char unused1, unused2, unused3; /* pad */ union { snd_seq_ev_sample sample; snd_seq_ev_cluster cluster; snd_seq_position_t position; snd_seq_stop_mode_t stop_mode; snd_seq_frequency_t frequency; snd_seq_ev_volume volume; snd_seq_ev_loop loop; unsigned char raw8[8]; } param;} snd_seq_ev_sample_control_t;/* INSTR_BEGIN event */typedef struct { long timeout; /* zero = forever, otherwise timeout in ms */} snd_seq_ev_instr_begin_t;typedef struct { int event; /* processed event type */ int result;} snd_seq_result_t;typedef struct { long int tv_sec; /* seconds */ long int tv_nsec; /* nanoseconds */} snd_seq_real_time_t;typedef unsigned int snd_seq_tick_time_t; /* midi ticks */typedef union { snd_seq_tick_time_t tick; snd_seq_real_time_t time;} snd_seq_timestamp_t; /* queue timer control */typedef struct { unsigned char queue; /* affected queue */ unsigned char unused1, unused2, unused3; /* pad */ union { signed int value; /* affected value (e.g. tempo) */ snd_seq_timestamp_t time; } param;} snd_seq_ev_queue_control_t; /* quoted event - inside the kernel only */typedef struct { snd_seq_addr_t origin; /* original sender */ unsigned short value; /* optional data */ snd_seq_event_t *event; /* quoted event */} snd_seq_ev_quote_t; /* sequencer event */struct snd_seq_event { snd_seq_event_type type; /* event type */ unsigned char flags; /* event flags */ char tag; unsigned char queue; /* schedule queue */ snd_seq_timestamp_t time; /* schedule time */ snd_seq_addr_t source; /* source address */ snd_seq_addr_t dest; /* destination address */ union { /* event data... */ snd_seq_ev_note note; snd_seq_ev_ctrl control; snd_seq_ev_raw8 raw8; snd_seq_ev_raw32 raw32; snd_seq_ev_ext ext; snd_seq_ev_ipcshm ipcshm; snd_seq_ev_queue_control_t queue; snd_seq_timestamp_t time; snd_seq_addr_t addr; snd_seq_result_t result; snd_seq_ev_instr_begin_t instr_begin; snd_seq_ev_sample_control_t sample; snd_seq_ev_quote_t quote; } data;};/* * bounce event - stored as variable size data */typedef struct snd_seq_event_bounce { int err; snd_seq_event_t event; /* external data follows here. */} snd_seq_event_bounce_t;#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(snd_seq_event_bounce_t)))/* * type check macros *//* result events: 0-4 */#define snd_seq_ev_is_result_type(ev) ((ev)->type < 5)/* channel specific events: 5-19 */#define snd_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)/* note events: 5-9 */#define snd_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)/* control events: 10-19 */#define snd_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)/* queue control events: 30-39 */#define snd_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)/* system status messages */#define snd_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)/* sample messages */#define snd_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)/* user-defined messages */#define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)/* fixed length events: 0-99 */#define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)/* instrument layer events: 100-129 */#define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)/* variable length events: 130-139 */#define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)/* ipc shmem events: 140-149 */#define snd_seq_ev_is_varipc_type(ev) ((ev)->type >= 140 && (ev)->type < 150)/* reserved for kernel */#define snd_seq_ev_is_reserved(ev) ((ev)->type >= 150)/* direct dispatched events */#define snd_seq_ev_is_direct(ev) ((ev)->queue == SND_SEQ_QUEUE_DIRECT)/* * macros to check event flags *//* prior events */#define snd_seq_ev_is_prior(ev) (((ev)->flags & SND_SEQ_PRIORITY_MASK) == SND_SEQ_PRIORITY_HIGH)/* event length type */#define snd_seq_ev_length_type(ev) ((ev)->flags & SND_SEQ_EVENT_LENGTH_MASK)#define snd_seq_ev_is_fixed(ev) (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_FIXED)#define snd_seq_ev_is_variable(ev) (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARIABLE)#define snd_seq_ev_is_varusr(ev) (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARUSR)#define snd_seq_ev_is_varipc(ev) (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARIPC)/* time-stamp type */#define snd_seq_ev_timestamp_type(ev) ((ev)->flags & SND_SEQ_TIME_STAMP_MASK)#define snd_seq_ev_is_tick(ev) (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_TICK)#define snd_seq_ev_is_real(ev) (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_REAL)/* time-mode type */#define snd_seq_ev_timemode_type(ev) ((ev)->flags & SND_SEQ_TIME_MODE_MASK)#define snd_seq_ev_is_abstime(ev) (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_ABS)#define snd_seq_ev_is_reltime(ev) (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_REL) /* system information */typedef struct { int queues; /* maximum queues count */ int clients; /* maximum clients count */ int ports; /* maximum ports per client */ int channels; /* maximum channels per port */ char reserved[32];} snd_seq_system_info_t; /* known client numbers */#define SND_SEQ_CLIENT_SYSTEM 0#define SND_SEQ_CLIENT_DUMMY 62 /* dummy ports */#define SND_SEQ_CLIENT_OSS 63 /* oss sequencer emulator */ /* client types */typedef enum { NO_CLIENT = 0, USER_CLIENT = 1, KERNEL_CLIENT = 2} snd_seq_client_type_t; /* event filter flags */#define SND_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */#define SND_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */#define SND_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */#define SND_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */typedef struct { 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 */ char group[32]; /* group name */ int num_ports; /* RO: number of ports */ int event_lost; /* number of lost events */ char reserved[64]; /* for future use */} snd_seq_client_info_t;/* client pool size */typedef struct { 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];} snd_seq_client_pool_t;/* Remove events by specified criteria */typedef struct snd_seq_remove_events { int tick:1; /* True when time is in ticks */ int input:1; /* Flush input queues */ int output:1; /* Flush output queues */ int remove_mode; /* Flags that determine what gets removed */ snd_seq_timestamp_t time; unsigned char queue; /* Queue for REMOVE_DEST */ snd_seq_addr_t 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 */} snd_seq_remove_events_t;/* Flush mode flags */#define SND_SEQ_REMOVE_DEST (1<<0) /* Restrict by destination q:client:port */#define SND_SEQ_REMOVE_DEST_CHANNEL (1<<1) /* Restrict by channel */#define SND_SEQ_REMOVE_TIME_BEFORE (1<<2) /* Restrict to before time */#define SND_SEQ_REMOVE_TIME_AFTER (1<<3) /* Restrict to time or after */#define SND_SEQ_REMOVE_EVENT_TYPE (1<<4) /* Restrict to event type */#define SND_SEQ_REMOVE_IGNORE_OFF (1<<5) /* Do not flush off events */#define SND_SEQ_REMOVE_TAG_MATCH (1<<6) /* Restrict to events with given tag */ /* known port numbers */#define SND_SEQ_PORT_SYSTEM_TIMER 0#define SND_SEQ_PORT_SYSTEM_ANNOUNCE 1 /* port capabilities (32 bits) */#define SND_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */#define SND_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */#define SND_SEQ_PORT_CAP_SYNC_READ (1<<2)#define SND_SEQ_PORT_CAP_SYNC_WRITE (1<<3)#define SND_SEQ_PORT_CAP_DUPLEX (1<<4)#define SND_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */#define SND_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */#define SND_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */ /* port type */#define SND_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */#define SND_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */#define SND_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */#define SND_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */#define SND_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */#define SND_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device *//* other standards...*/#define SND_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device */#define SND_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */#define SND_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) *//*...*/#define SND_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) *//* standard group names */#define SND_SEQ_GROUP_SYSTEM "system"#define SND_SEQ_GROUP_DEVICE "device"#define SND_SEQ_GROUP_APPLICATION "application"/* misc. conditioning flags */#define SND_SEQ_PORT_FLG_GIVEN_PORT (1<<0)typedef struct { int client; /* client number */ int port; /* port number */ char name[64]; /* port name */ char group[32]; /* group name (copied from client) */ unsigned int capability; /* port capability bits */ unsigned int cap_group; /* permission to group */ 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 */ char reserved[60]; /* for future use */} snd_seq_port_info_t;/* queue information */typedef struct { 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 */ int locked:1; /* timing queue locked for other queues */ char name[64]; /* name of this queue */ char reserved[64]; /* for future use */} snd_seq_queue_info_t;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -