Remove juce completely, cleanup
[carla.git] / source / includes / dssi / seq_event-compat.h
blob69519a4f31c7c7b74953cfde351b20326031d9e9
1 /*
2 * This library is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU Lesser General Public License as
4 * published by the Free Software Foundation; either version 2.1 of
5 * the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef __ALSA_SEQ_EVENT_COMPAT_H
19 #define __ALSA_SEQ_EVENT_COMPAT_H
21 /**
22 * Sequencer event data type
24 typedef unsigned char snd_seq_event_type_t;
26 /** Sequencer event type */
27 enum snd_seq_event_type {
28 /** system status; event data type = #snd_seq_result_t */
29 SND_SEQ_EVENT_SYSTEM = 0,
30 /** returned result status; event data type = #snd_seq_result_t */
31 SND_SEQ_EVENT_RESULT,
33 /** note on and off with duration; event data type = #snd_seq_ev_note_t */
34 SND_SEQ_EVENT_NOTE = 5,
35 /** note on; event data type = #snd_seq_ev_note_t */
36 SND_SEQ_EVENT_NOTEON,
37 /** note off; event data type = #snd_seq_ev_note_t */
38 SND_SEQ_EVENT_NOTEOFF,
39 /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */
40 SND_SEQ_EVENT_KEYPRESS,
42 /** controller; event data type = #snd_seq_ev_ctrl_t */
43 SND_SEQ_EVENT_CONTROLLER = 10,
44 /** program change; event data type = #snd_seq_ev_ctrl_t */
45 SND_SEQ_EVENT_PGMCHANGE,
46 /** channel pressure; event data type = #snd_seq_ev_ctrl_t */
47 SND_SEQ_EVENT_CHANPRESS,
48 /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */
49 SND_SEQ_EVENT_PITCHBEND,
50 /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */
51 SND_SEQ_EVENT_CONTROL14,
52 /** 14 bit NRPN; event data type = #snd_seq_ev_ctrl_t */
53 SND_SEQ_EVENT_NONREGPARAM,
54 /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */
55 SND_SEQ_EVENT_REGPARAM,
57 /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */
58 SND_SEQ_EVENT_SONGPOS = 20,
59 /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */
60 SND_SEQ_EVENT_SONGSEL,
61 /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */
62 SND_SEQ_EVENT_QFRAME,
63 /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */
64 SND_SEQ_EVENT_TIMESIGN,
65 /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */
66 SND_SEQ_EVENT_KEYSIGN,
68 /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */
69 SND_SEQ_EVENT_START = 30,
70 /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */
71 SND_SEQ_EVENT_CONTINUE,
72 /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */
73 SND_SEQ_EVENT_STOP,
74 /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */
75 SND_SEQ_EVENT_SETPOS_TICK,
76 /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */
77 SND_SEQ_EVENT_SETPOS_TIME,
78 /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */
79 SND_SEQ_EVENT_TEMPO,
80 /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */
81 SND_SEQ_EVENT_CLOCK,
82 /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */
83 SND_SEQ_EVENT_TICK,
84 /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */
85 SND_SEQ_EVENT_QUEUE_SKEW,
86 /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */
87 SND_SEQ_EVENT_SYNC_POS,
89 /** Tune request; event data type = none */
90 SND_SEQ_EVENT_TUNE_REQUEST = 40,
91 /** Reset to power-on state; event data type = none */
92 SND_SEQ_EVENT_RESET,
93 /** Active sensing event; event data type = none */
94 SND_SEQ_EVENT_SENSING,
96 /** Echo-back event; event data type = any type */
97 SND_SEQ_EVENT_ECHO = 50,
98 /** OSS emulation raw event; event data type = any type */
99 SND_SEQ_EVENT_OSS,
101 /** New client has connected; event data type = #snd_seq_addr_t */
102 SND_SEQ_EVENT_CLIENT_START = 60,
103 /** Client has left the system; event data type = #snd_seq_addr_t */
104 SND_SEQ_EVENT_CLIENT_EXIT,
105 /** Client status/info has changed; event data type = #snd_seq_addr_t */
106 SND_SEQ_EVENT_CLIENT_CHANGE,
107 /** New port was created; event data type = #snd_seq_addr_t */
108 SND_SEQ_EVENT_PORT_START,
109 /** Port was deleted from system; event data type = #snd_seq_addr_t */
110 SND_SEQ_EVENT_PORT_EXIT,
111 /** Port status/info has changed; event data type = #snd_seq_addr_t */
112 SND_SEQ_EVENT_PORT_CHANGE,
114 /** Ports connected; event data type = #snd_seq_connect_t */
115 SND_SEQ_EVENT_PORT_SUBSCRIBED,
116 /** Ports disconnected; event data type = #snd_seq_connect_t */
117 SND_SEQ_EVENT_PORT_UNSUBSCRIBED,
119 /** user-defined event; event data type = any (fixed size) */
120 SND_SEQ_EVENT_USR0 = 90,
121 /** user-defined event; event data type = any (fixed size) */
122 SND_SEQ_EVENT_USR1,
123 /** user-defined event; event data type = any (fixed size) */
124 SND_SEQ_EVENT_USR2,
125 /** user-defined event; event data type = any (fixed size) */
126 SND_SEQ_EVENT_USR3,
127 /** user-defined event; event data type = any (fixed size) */
128 SND_SEQ_EVENT_USR4,
129 /** user-defined event; event data type = any (fixed size) */
130 SND_SEQ_EVENT_USR5,
131 /** user-defined event; event data type = any (fixed size) */
132 SND_SEQ_EVENT_USR6,
133 /** user-defined event; event data type = any (fixed size) */
134 SND_SEQ_EVENT_USR7,
135 /** user-defined event; event data type = any (fixed size) */
136 SND_SEQ_EVENT_USR8,
137 /** user-defined event; event data type = any (fixed size) */
138 SND_SEQ_EVENT_USR9,
140 /** NOP; ignored in any case */
141 SND_SEQ_EVENT_NONE = 255
144 /** Sequencer event address */
145 typedef struct snd_seq_addr {
146 unsigned char client; /**< Client id */
147 unsigned char port; /**< Port id */
148 } snd_seq_addr_t;
150 /** Connection (subscription) between ports */
151 typedef struct snd_seq_connect {
152 snd_seq_addr_t sender; /**< sender address */
153 snd_seq_addr_t dest; /**< destination address */
154 } snd_seq_connect_t;
156 /** Real-time data record */
157 typedef struct snd_seq_real_time {
158 unsigned int tv_sec; /**< seconds */
159 unsigned int tv_nsec; /**< nanoseconds */
160 } snd_seq_real_time_t;
162 /** (MIDI) Tick-time data record */
163 typedef unsigned int snd_seq_tick_time_t;
165 /** unioned time stamp */
166 typedef union snd_seq_timestamp {
167 snd_seq_tick_time_t tick; /**< tick-time */
168 struct snd_seq_real_time time; /**< real-time */
169 } snd_seq_timestamp_t;
171 /** Note event */
172 typedef struct snd_seq_ev_note {
173 unsigned char channel; /**< channel number */
174 unsigned char note; /**< note */
175 unsigned char velocity; /**< velocity */
176 unsigned char off_velocity; /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */
177 unsigned int duration; /**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */
178 } snd_seq_ev_note_t;
180 /** Controller event */
181 typedef struct snd_seq_ev_ctrl {
182 unsigned char channel; /**< channel number */
183 unsigned char unused[3]; /**< reserved */
184 unsigned int param; /**< control parameter */
185 signed int value; /**< control value */
186 } snd_seq_ev_ctrl_t;
188 /** generic set of bytes (12x8 bit) */
189 typedef struct snd_seq_ev_raw8 {
190 unsigned char d[12]; /**< 8 bit value */
191 } snd_seq_ev_raw8_t;
193 /** generic set of integers (3x32 bit) */
194 typedef struct snd_seq_ev_raw32 {
195 unsigned int d[3]; /**< 32 bit value */
196 } snd_seq_ev_raw32_t;
198 /** Result events */
199 typedef struct snd_seq_result {
200 int event; /**< processed event type */
201 int result; /**< status */
202 } snd_seq_result_t;
204 /** Queue skew values */
205 typedef struct snd_seq_queue_skew {
206 unsigned int value; /**< skew value */
207 unsigned int base; /**< skew base */
208 } snd_seq_queue_skew_t;
210 /** queue timer control */
211 typedef struct snd_seq_ev_queue_control {
212 unsigned char queue; /**< affected queue */
213 unsigned char unused[3]; /**< reserved */
214 union {
215 signed int value; /**< affected value (e.g. tempo) */
216 snd_seq_timestamp_t time; /**< time */
217 unsigned int position; /**< sync position */
218 snd_seq_queue_skew_t skew; /**< queue skew */
219 unsigned int d32[2]; /**< any data */
220 unsigned char d8[8]; /**< any data */
221 } param; /**< data value union */
222 } snd_seq_ev_queue_control_t;
224 /** Sequencer event */
225 typedef struct snd_seq_event {
226 snd_seq_event_type_t type; /**< event type */
227 unsigned char flags; /**< event flags */
228 unsigned char tag; /**< tag */
230 unsigned char queue; /**< schedule queue */
231 snd_seq_timestamp_t time; /**< schedule time */
233 snd_seq_addr_t source; /**< source address */
234 snd_seq_addr_t dest; /**< destination address */
236 union {
237 snd_seq_ev_note_t note; /**< note information */
238 snd_seq_ev_ctrl_t control; /**< MIDI control information */
239 snd_seq_ev_raw8_t raw8; /**< raw8 data */
240 snd_seq_ev_raw32_t raw32; /**< raw32 data */
241 snd_seq_ev_queue_control_t queue; /**< queue control */
242 snd_seq_timestamp_t time; /**< timestamp */
243 snd_seq_addr_t addr; /**< address */
244 snd_seq_connect_t connect; /**< connect information */
245 snd_seq_result_t result; /**< operation result code */
246 } data; /**< event data... */
247 } snd_seq_event_t;
249 #endif /* __ALSA_SEQ_EVENT_COMPAT_H */