28#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD) 
   30#warning "use #include <alsa/asoundlib.h>, <alsa/seq_event.h> should not be used directly" 
   31#include <alsa/asoundlib.h> 
   34#ifndef __ALSA_SEQ_EVENT_H 
   35#define __ALSA_SEQ_EVENT_H 
   47typedef unsigned char snd_seq_event_type_t;
 
   50enum snd_seq_event_type {
 
   52    SND_SEQ_EVENT_SYSTEM = 0,
 
   57    SND_SEQ_EVENT_NOTE = 5,
 
   61    SND_SEQ_EVENT_NOTEOFF,
 
   63    SND_SEQ_EVENT_KEYPRESS,
 
   66    SND_SEQ_EVENT_CONTROLLER = 10,
 
   68    SND_SEQ_EVENT_PGMCHANGE,
 
   70    SND_SEQ_EVENT_CHANPRESS,
 
   72    SND_SEQ_EVENT_PITCHBEND,
 
   74    SND_SEQ_EVENT_CONTROL14,
 
   76    SND_SEQ_EVENT_NONREGPARAM,
 
   78    SND_SEQ_EVENT_REGPARAM,
 
   81    SND_SEQ_EVENT_SONGPOS = 20,
 
   83    SND_SEQ_EVENT_SONGSEL,
 
   87    SND_SEQ_EVENT_TIMESIGN,
 
   89    SND_SEQ_EVENT_KEYSIGN,
 
   92    SND_SEQ_EVENT_START = 30,
 
   94    SND_SEQ_EVENT_CONTINUE,
 
   98    SND_SEQ_EVENT_SETPOS_TICK,
 
  100    SND_SEQ_EVENT_SETPOS_TIME,
 
  108    SND_SEQ_EVENT_QUEUE_SKEW,
 
  110    SND_SEQ_EVENT_SYNC_POS,
 
  113    SND_SEQ_EVENT_TUNE_REQUEST = 40,
 
  117    SND_SEQ_EVENT_SENSING,
 
  120    SND_SEQ_EVENT_ECHO = 50,
 
  125    SND_SEQ_EVENT_CLIENT_START = 60,
 
  127    SND_SEQ_EVENT_CLIENT_EXIT,
 
  129    SND_SEQ_EVENT_CLIENT_CHANGE,
 
  131    SND_SEQ_EVENT_PORT_START,
 
  133    SND_SEQ_EVENT_PORT_EXIT,
 
  135    SND_SEQ_EVENT_PORT_CHANGE,
 
  138    SND_SEQ_EVENT_PORT_SUBSCRIBED,
 
  140    SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
 
  143    SND_SEQ_EVENT_UMP_EP_CHANGE,
 
  145    SND_SEQ_EVENT_UMP_BLOCK_CHANGE,
 
  148    SND_SEQ_EVENT_USR0 = 90,
 
  169    SND_SEQ_EVENT_SYSEX = 130,
 
  171    SND_SEQ_EVENT_BOUNCE,
 
  173    SND_SEQ_EVENT_USR_VAR0 = 135,
 
  175    SND_SEQ_EVENT_USR_VAR1,
 
  177    SND_SEQ_EVENT_USR_VAR2,
 
  179    SND_SEQ_EVENT_USR_VAR3,
 
  181    SND_SEQ_EVENT_USR_VAR4,
 
  184    SND_SEQ_EVENT_NONE = 255
 
  189typedef struct snd_seq_addr {
 
  190    unsigned char client;   
 
  195typedef struct snd_seq_connect {
 
  196    snd_seq_addr_t sender;  
 
  202typedef struct snd_seq_real_time {
 
  204    unsigned int tv_nsec;       
 
  205} snd_seq_real_time_t;
 
  208typedef unsigned int snd_seq_tick_time_t;
 
  211typedef union snd_seq_timestamp {
 
  212    snd_seq_tick_time_t tick;   
 
  213    struct snd_seq_real_time time;  
 
  214} snd_seq_timestamp_t;
 
  222#define SND_SEQ_TIME_STAMP_TICK     (0<<0)   
  223#define SND_SEQ_TIME_STAMP_REAL     (1<<0)   
  224#define SND_SEQ_TIME_STAMP_MASK     (1<<0)   
  226#define SND_SEQ_TIME_MODE_ABS       (0<<1)   
  227#define SND_SEQ_TIME_MODE_REL       (1<<1)   
  228#define SND_SEQ_TIME_MODE_MASK      (1<<1)   
  230#define SND_SEQ_EVENT_LENGTH_FIXED  (0<<2)   
  231#define SND_SEQ_EVENT_LENGTH_VARIABLE   (1<<2)   
  232#define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2)   
  233#define SND_SEQ_EVENT_LENGTH_MASK   (3<<2)   
  235#define SND_SEQ_PRIORITY_NORMAL     (0<<4)   
  236#define SND_SEQ_PRIORITY_HIGH       (1<<4)   
  237#define SND_SEQ_PRIORITY_MASK       (1<<4)   
  239#define SND_SEQ_EVENT_UMP       (1<<5)   
  242typedef struct snd_seq_ev_note {
 
  243    unsigned char channel;      
 
  245    unsigned char velocity;     
 
  246    unsigned char off_velocity; 
 
  247    unsigned int duration;      
 
  251typedef struct snd_seq_ev_ctrl {
 
  252    unsigned char channel;      
 
  253    unsigned char unused[3];    
 
  259typedef struct snd_seq_ev_raw8 {
 
  264typedef struct snd_seq_ev_raw32 {
 
  269struct snd_seq_ev_ext {
 
  272} __attribute__((packed));
 
  274typedef struct snd_seq_ev_ext snd_seq_ev_ext_t;
 
  277typedef snd_seq_ev_ext snd_seq_ev_ext_t;
 
  281typedef struct snd_seq_result {
 
  287typedef struct snd_seq_queue_skew {
 
  290} snd_seq_queue_skew_t;
 
  293typedef struct snd_seq_ev_queue_control {
 
  295    unsigned char unused[3];        
 
  298        snd_seq_timestamp_t time;   
 
  299        unsigned int position;      
 
  300        snd_seq_queue_skew_t skew;  
 
  304} snd_seq_ev_queue_control_t;
 
  307typedef struct snd_seq_ev_ump_notify {
 
  308    unsigned char client;   
 
  310} snd_seq_ev_ump_notify_t;
 
  313typedef union snd_seq_event_data {
 
  314    snd_seq_ev_note_t note;     
 
  315    snd_seq_ev_ctrl_t control;  
 
  316    snd_seq_ev_raw8_t raw8;     
 
  317    snd_seq_ev_raw32_t raw32;   
 
  318    snd_seq_ev_ext_t ext;       
 
  319    snd_seq_ev_queue_control_t queue; 
 
  320    snd_seq_timestamp_t time;   
 
  322    snd_seq_connect_t connect;  
 
  323    snd_seq_result_t result;    
 
  324    snd_seq_ev_ump_notify_t ump_notify; 
 
  325} snd_seq_event_data_t;
 
  328typedef struct snd_seq_event {
 
  329    snd_seq_event_type_t type;  
 
  334    snd_seq_timestamp_t time;   
 
  336    snd_seq_addr_t source;      
 
  339    snd_seq_event_data_t data;  
 
  343typedef struct snd_seq_ump_event {
 
  344    snd_seq_event_type_t type;  
 
  348    snd_seq_timestamp_t time;   
 
  349    snd_seq_addr_t source;      
 
  353        snd_seq_event_data_t data;  
 
  356} snd_seq_ump_event_t;