📄 asequenc.h
字号:
/* simple loop redefinition */struct sndrv_seq_ev_loop { unsigned int start; /* loop start (in samples) * 16 */ unsigned int end; /* loop end (in samples) * 16 */};struct sndrv_seq_ev_sample_control { unsigned char channel; unsigned char unused1, unused2, unused3; /* pad */ union { struct sndrv_seq_ev_sample sample; struct sndrv_seq_ev_cluster cluster; sndrv_seq_position_t position; int stop_mode; sndrv_seq_frequency_t frequency; struct sndrv_seq_ev_volume volume; struct sndrv_seq_ev_loop loop; unsigned char raw8[8]; } param;};/* INSTR_BEGIN event */struct sndrv_seq_ev_instr_begin { int timeout; /* zero = forever, otherwise timeout in ms */};struct sndrv_seq_result { int event; /* processed event type */ int result;};struct sndrv_seq_real_time { unsigned int tv_sec; /* seconds */ unsigned int tv_nsec; /* nanoseconds */};typedef unsigned int sndrv_seq_tick_time_t; /* midi ticks */union sndrv_seq_timestamp { sndrv_seq_tick_time_t tick; struct sndrv_seq_real_time time;};struct sndrv_seq_queue_skew { unsigned int value; unsigned int base;}; /* queue timer control */struct sndrv_seq_ev_queue_control { unsigned char queue; /* affected queue */ unsigned char pad[3]; /* reserved */ union { signed int value; /* affected value (e.g. tempo) */ union sndrv_seq_timestamp time; /* time */ unsigned int position; /* sync position */ struct sndrv_seq_queue_skew skew; unsigned int d32[2]; unsigned char d8[8]; } param;}; /* quoted event - inside the kernel only */struct sndrv_seq_ev_quote { struct sndrv_seq_addr origin; /* original sender */ unsigned short value; /* optional data */ struct sndrv_seq_event *event; /* quoted event */} __attribute__((packed)); /* sequencer event */struct sndrv_seq_event { sndrv_seq_event_type_t type; /* event type */ unsigned char flags; /* event flags */ char tag; unsigned char queue; /* schedule queue */ union sndrv_seq_timestamp time; /* schedule time */ struct sndrv_seq_addr source; /* source address */ struct sndrv_seq_addr dest; /* destination address */ union { /* event data... */ struct sndrv_seq_ev_note note; struct sndrv_seq_ev_ctrl control; struct sndrv_seq_ev_raw8 raw8; struct sndrv_seq_ev_raw32 raw32; struct sndrv_seq_ev_ext ext; struct sndrv_seq_ev_queue_control queue; union sndrv_seq_timestamp time; struct sndrv_seq_addr addr; struct sndrv_seq_connect connect; struct sndrv_seq_result result; struct sndrv_seq_ev_instr_begin instr_begin; struct sndrv_seq_ev_sample_control sample; struct sndrv_seq_ev_quote quote; } data;};/* * bounce event - stored as variable size data */struct sndrv_seq_event_bounce { int err; struct sndrv_seq_event event; /* external data follows here. */};#define sndrv_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(sndrv_seq_event_bounce_t)))/* * type check macros *//* result events: 0-4 */#define sndrv_seq_ev_is_result_type(ev) ((ev)->type < 5)/* channel specific events: 5-19 */#define sndrv_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)/* note events: 5-9 */#define sndrv_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)/* control events: 10-19 */#define sndrv_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)/* queue control events: 30-39 */#define sndrv_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)/* system status messages */#define sndrv_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)/* sample messages */#define sndrv_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)/* user-defined messages */#define sndrv_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)/* fixed length events: 0-99 */#define sndrv_seq_ev_is_fixed_type(ev) ((ev)->type < 100)/* instrument layer events: 100-129 */#define sndrv_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)/* variable length events: 130-139 */#define sndrv_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)/* reserved for kernel */#define sndrv_seq_ev_is_reserved(ev) ((ev)->type >= 150)/* direct dispatched events */#define sndrv_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)/* * macros to check event flags *//* prior events */#define sndrv_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)/* event length type */#define sndrv_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)#define sndrv_seq_ev_is_fixed(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)#define sndrv_seq_ev_is_variable(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)#define sndrv_seq_ev_is_varusr(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)/* time-stamp type */#define sndrv_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)#define sndrv_seq_ev_is_tick(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)#define sndrv_seq_ev_is_real(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)/* time-mode type */#define sndrv_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)#define sndrv_seq_ev_is_abstime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)#define sndrv_seq_ev_is_reltime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)/* queue sync port */#define sndrv_seq_queue_sync_port(q) ((q) + 16)#endif /* __KERNEL__ */ /* system information */struct sndrv_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];}; /* system running information */struct sndrv_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 */enum sndrv_seq_client_type { NO_CLIENT = 0, USER_CLIENT = 1, KERNEL_CLIENT = 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 sndrv_seq_client_info { int client; /* client number to inquire */ int 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 sndrv_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 sndrv_seq_remove_events { unsigned int remove_mode; /* Flags that determine what gets removed */ union sndrv_seq_timestamp time; unsigned char queue; /* Queue for REMOVE_DEST */ struct sndrv_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) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -