ALSA project - the C library reference
|
00001 00011 /* 00012 * This library is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License as 00014 * published by the Free Software Foundation; either version 2.1 of 00015 * the License, or (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 */ 00027 00028 #ifndef __ALSA_SEQ_EVENT_H 00029 #define __ALSA_SEQ_EVENT_H 00030 00041 typedef unsigned char snd_seq_event_type_t; 00042 00044 enum snd_seq_event_type { 00046 SND_SEQ_EVENT_SYSTEM = 0, 00048 SND_SEQ_EVENT_RESULT, 00049 00051 SND_SEQ_EVENT_NOTE = 5, 00053 SND_SEQ_EVENT_NOTEON, 00055 SND_SEQ_EVENT_NOTEOFF, 00057 SND_SEQ_EVENT_KEYPRESS, 00058 00060 SND_SEQ_EVENT_CONTROLLER = 10, 00062 SND_SEQ_EVENT_PGMCHANGE, 00064 SND_SEQ_EVENT_CHANPRESS, 00066 SND_SEQ_EVENT_PITCHBEND, 00068 SND_SEQ_EVENT_CONTROL14, 00070 SND_SEQ_EVENT_NONREGPARAM, 00072 SND_SEQ_EVENT_REGPARAM, 00073 00075 SND_SEQ_EVENT_SONGPOS = 20, 00077 SND_SEQ_EVENT_SONGSEL, 00079 SND_SEQ_EVENT_QFRAME, 00081 SND_SEQ_EVENT_TIMESIGN, 00083 SND_SEQ_EVENT_KEYSIGN, 00084 00086 SND_SEQ_EVENT_START = 30, 00088 SND_SEQ_EVENT_CONTINUE, 00090 SND_SEQ_EVENT_STOP, 00092 SND_SEQ_EVENT_SETPOS_TICK, 00094 SND_SEQ_EVENT_SETPOS_TIME, 00096 SND_SEQ_EVENT_TEMPO, 00098 SND_SEQ_EVENT_CLOCK, 00100 SND_SEQ_EVENT_TICK, 00102 SND_SEQ_EVENT_QUEUE_SKEW, 00104 SND_SEQ_EVENT_SYNC_POS, 00105 00107 SND_SEQ_EVENT_TUNE_REQUEST = 40, 00109 SND_SEQ_EVENT_RESET, 00111 SND_SEQ_EVENT_SENSING, 00112 00114 SND_SEQ_EVENT_ECHO = 50, 00116 SND_SEQ_EVENT_OSS, 00117 00119 SND_SEQ_EVENT_CLIENT_START = 60, 00121 SND_SEQ_EVENT_CLIENT_EXIT, 00123 SND_SEQ_EVENT_CLIENT_CHANGE, 00125 SND_SEQ_EVENT_PORT_START, 00127 SND_SEQ_EVENT_PORT_EXIT, 00129 SND_SEQ_EVENT_PORT_CHANGE, 00130 00132 SND_SEQ_EVENT_PORT_SUBSCRIBED, 00134 SND_SEQ_EVENT_PORT_UNSUBSCRIBED, 00135 00137 SND_SEQ_EVENT_USR0 = 90, 00139 SND_SEQ_EVENT_USR1, 00141 SND_SEQ_EVENT_USR2, 00143 SND_SEQ_EVENT_USR3, 00145 SND_SEQ_EVENT_USR4, 00147 SND_SEQ_EVENT_USR5, 00149 SND_SEQ_EVENT_USR6, 00151 SND_SEQ_EVENT_USR7, 00153 SND_SEQ_EVENT_USR8, 00155 SND_SEQ_EVENT_USR9, 00156 00158 SND_SEQ_EVENT_SYSEX = 130, 00160 SND_SEQ_EVENT_BOUNCE, 00162 SND_SEQ_EVENT_USR_VAR0 = 135, 00164 SND_SEQ_EVENT_USR_VAR1, 00166 SND_SEQ_EVENT_USR_VAR2, 00168 SND_SEQ_EVENT_USR_VAR3, 00170 SND_SEQ_EVENT_USR_VAR4, 00171 00173 SND_SEQ_EVENT_NONE = 255 00174 }; 00175 00176 00178 typedef struct snd_seq_addr { 00179 unsigned char client; 00180 unsigned char port; 00181 } snd_seq_addr_t; 00182 00184 typedef struct snd_seq_connect { 00185 snd_seq_addr_t sender; 00186 snd_seq_addr_t dest; 00187 } snd_seq_connect_t; 00188 00189 00191 typedef struct snd_seq_real_time { 00192 unsigned int tv_sec; 00193 unsigned int tv_nsec; 00194 } snd_seq_real_time_t; 00195 00197 typedef unsigned int snd_seq_tick_time_t; 00198 00200 typedef union snd_seq_timestamp { 00201 snd_seq_tick_time_t tick; 00202 struct snd_seq_real_time time; 00203 } snd_seq_timestamp_t; 00204 00205 00211 #define SND_SEQ_TIME_STAMP_TICK (0<<0) 00212 #define SND_SEQ_TIME_STAMP_REAL (1<<0) 00213 #define SND_SEQ_TIME_STAMP_MASK (1<<0) 00215 #define SND_SEQ_TIME_MODE_ABS (0<<1) 00216 #define SND_SEQ_TIME_MODE_REL (1<<1) 00217 #define SND_SEQ_TIME_MODE_MASK (1<<1) 00219 #define SND_SEQ_EVENT_LENGTH_FIXED (0<<2) 00220 #define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2) 00221 #define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2) 00222 #define SND_SEQ_EVENT_LENGTH_MASK (3<<2) 00224 #define SND_SEQ_PRIORITY_NORMAL (0<<4) 00225 #define SND_SEQ_PRIORITY_HIGH (1<<4) 00226 #define SND_SEQ_PRIORITY_MASK (1<<4) 00230 typedef struct snd_seq_ev_note { 00231 unsigned char channel; 00232 unsigned char note; 00233 unsigned char velocity; 00234 unsigned char off_velocity; 00235 unsigned int duration; 00236 } snd_seq_ev_note_t; 00237 00239 typedef struct snd_seq_ev_ctrl { 00240 unsigned char channel; 00241 unsigned char unused[3]; 00242 unsigned int param; 00243 signed int value; 00244 } snd_seq_ev_ctrl_t; 00245 00247 typedef struct snd_seq_ev_raw8 { 00248 unsigned char d[12]; 00249 } snd_seq_ev_raw8_t; 00250 00252 typedef struct snd_seq_ev_raw32 { 00253 unsigned int d[3]; 00254 } snd_seq_ev_raw32_t; 00255 00257 struct snd_seq_ev_ext { 00258 unsigned int len; 00259 void *ptr; 00260 } __attribute__((packed)); 00262 typedef struct snd_seq_ev_ext snd_seq_ev_ext_t; 00263 #ifdef DOC_HIDDEN 00264 /* redefine typedef for stupid doxygen */ 00265 typedef snd_seq_ev_ext snd_seq_ev_ext_t; 00266 #endif 00267 00269 typedef struct snd_seq_result { 00270 int event; 00271 int result; 00272 } snd_seq_result_t; 00273 00275 typedef struct snd_seq_queue_skew { 00276 unsigned int value; 00277 unsigned int base; 00278 } snd_seq_queue_skew_t; 00279 00281 typedef struct snd_seq_ev_queue_control { 00282 unsigned char queue; 00283 unsigned char unused[3]; 00284 union { 00285 signed int value; 00286 snd_seq_timestamp_t time; 00287 unsigned int position; 00288 snd_seq_queue_skew_t skew; 00289 unsigned int d32[2]; 00290 unsigned char d8[8]; 00291 } param; 00292 } snd_seq_ev_queue_control_t; 00293 00294 00296 typedef struct snd_seq_event { 00297 snd_seq_event_type_t type; 00298 unsigned char flags; 00299 unsigned char tag; 00301 unsigned char queue; 00302 snd_seq_timestamp_t time; 00304 snd_seq_addr_t source; 00305 snd_seq_addr_t dest; 00307 union { 00308 snd_seq_ev_note_t note; 00309 snd_seq_ev_ctrl_t control; 00310 snd_seq_ev_raw8_t raw8; 00311 snd_seq_ev_raw32_t raw32; 00312 snd_seq_ev_ext_t ext; 00313 snd_seq_ev_queue_control_t queue; 00314 snd_seq_timestamp_t time; 00315 snd_seq_addr_t addr; 00316 snd_seq_connect_t connect; 00317 snd_seq_result_t result; 00318 } data; 00319 } snd_seq_event_t; 00320 00321 00324 #endif /* __ALSA_SEQ_EVENT_H */ 00325