aboutsummaryrefslogtreecommitdiff
path: root/sound/midiparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/midiparser.h')
-rw-r--r--sound/midiparser.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/midiparser.h b/sound/midiparser.h
index 0ba12ce2b1..3ef99fcd6e 100644
--- a/sound/midiparser.h
+++ b/sound/midiparser.h
@@ -267,13 +267,12 @@ struct NoteTimer {
* memory block containing the music data.)
*/
class MidiParser {
-private:
+protected:
uint16 _active_notes[128]; ///< Each uint16 is a bit mask for channels that have that note on.
NoteTimer _hanging_notes[32]; ///< Maintains expiration info for up to 32 notes.
///< Used for "Smart Jump" and MIDI formats that do not include explicit Note Off events.
byte _hanging_notes_count; ///< Count of hanging notes, used to optimize expiration.
-protected:
MidiDriver *_driver; ///< The device to which all events will be transmitted.
uint32 _timer_rate; ///< The time in microseconds between onTimer() calls. Obtained from the MidiDriver.
uint32 _ppqn; ///< Pulses Per Quarter Note. (We refer to "pulses" as "ticks".)
@@ -303,6 +302,11 @@ protected:
void hangingNote(byte channel, byte note, uint32 ticks_left, bool recycle = true);
void hangAllActiveNotes();
+ virtual void sendToDriver(uint32 b);
+ void sendToDriver(byte status, byte firstOp, byte secondOp) {
+ sendToDriver(status | ((uint32)firstOp << 8) | ((uint32)secondOp << 16));
+ }
+
/**
* Platform independent BE uint32 read-and-advance.
* This helper function reads Big Endian 32-bit numbers