167 |
type_note_off, ///< (real) MIDI note-off event |
type_note_off, ///< (real) MIDI note-off event |
168 |
type_pitchbend, ///< MIDI pitch bend wheel change event |
type_pitchbend, ///< MIDI pitch bend wheel change event |
169 |
type_control_change, ///< MIDI CC event |
type_control_change, ///< MIDI CC event |
170 |
|
type_rpn, ///< Transformed from a raw RPN CC MIDI event. |
171 |
|
type_nrpn, ///< Transformed from a raw NRPN CC MIDI event. |
172 |
type_sysex, ///< MIDI system exclusive message |
type_sysex, ///< MIDI system exclusive message |
173 |
type_cancel_release_key, ///< transformed either from a (real) MIDI note-on or sustain-pedal-down event |
type_cancel_release_key, ///< transformed either from a (real) MIDI note-on or sustain-pedal-down event |
174 |
type_release_key, ///< transformed either from a (real) MIDI note-off or sustain-pedal-up event |
type_release_key, ///< transformed either from a (real) MIDI note-off or sustain-pedal-up event |
260 |
uint8_t Controller; ///< MIDI controller number of control change event. |
uint8_t Controller; ///< MIDI controller number of control change event. |
261 |
uint8_t Value; ///< Controller Value of control change event. |
uint8_t Value; ///< Controller Value of control change event. |
262 |
} CC; |
} CC; |
263 |
|
/// Used for both RPN & NRPN events |
264 |
|
struct _RPN { |
265 |
|
uint8_t Channel; ///< MIDI channel (0..15) |
266 |
|
uint16_t Parameter; ///< Merged 14 bit representation of parameter number (that is MSB and LSB combined). |
267 |
|
uint16_t Value; ///< Merged 14 bit representation of new (N)RPN value (that is MSB and LSB combined). |
268 |
|
uint8_t ParameterMSB() const { return Parameter >> 7; } |
269 |
|
uint8_t ParameterLSB() const { return Parameter & 127; } |
270 |
|
uint8_t ValueMSB() const { return Value >> 7; } |
271 |
|
uint8_t ValueLSB() const { return Value & 127; } |
272 |
|
} RPN, NRPN; |
273 |
/// Pitchbend event specifics |
/// Pitchbend event specifics |
274 |
struct _Pitch { |
struct _Pitch { |
275 |
uint8_t Channel; ///< MIDI channel (0..15) |
uint8_t Channel; ///< MIDI channel (0..15) |
346 |
int32_t iFragmentPos; ///< Position in the current fragment this event refers to. |
int32_t iFragmentPos; ///< Position in the current fragment this event refers to. |
347 |
}; |
}; |
348 |
|
|
349 |
|
inline Pool<Event>::Iterator prevEventOf(const Pool<Event>::Iterator& itEvent) { |
350 |
|
if (!itEvent) return Pool<Event>::Iterator(); |
351 |
|
Pool<Event>::Iterator itPrev = itEvent; |
352 |
|
return --itPrev; |
353 |
|
} |
354 |
|
|
355 |
|
inline Pool<Event>::Iterator nextEventOf(const Pool<Event>::Iterator& itEvent) { |
356 |
|
if (!itEvent) return Pool<Event>::Iterator(); |
357 |
|
Pool<Event>::Iterator itNext = itEvent; |
358 |
|
return ++itNext; |
359 |
|
} |
360 |
|
|
361 |
|
inline bool isPrevEventCCNr(const Pool<Event>::Iterator& itEvent, uint8_t CCNr) { |
362 |
|
Pool<Event>::Iterator itPrev = prevEventOf(itEvent); |
363 |
|
if (!itPrev) return false; |
364 |
|
return itPrev->Type == Event::type_control_change && |
365 |
|
itPrev->Param.CC.Controller == CCNr; |
366 |
|
} |
367 |
|
|
368 |
|
inline bool isNextEventCCNr(const Pool<Event>::Iterator& itEvent, uint8_t CCNr) { |
369 |
|
Pool<Event>::Iterator itNext = nextEventOf(itEvent); |
370 |
|
if (!itNext) return false; |
371 |
|
return itNext->Type == Event::type_control_change && |
372 |
|
itNext->Param.CC.Controller == CCNr; |
373 |
|
} |
374 |
|
|
375 |
/** |
/** |
376 |
* Used to sort timing relevant objects (i.e. events) into timing/scheduler |
* Used to sort timing relevant objects (i.e. events) into timing/scheduler |
377 |
* queue. This class is just intended as base class and should be derived |
* queue. This class is just intended as base class and should be derived |