From 6c5a5cd8e90fcaafae6fd6f409fde04b29fa7e7a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Sep 2013 23:05:37 +0200 Subject: AUDIO: Split event processing from MidiParser::onTimer This is to prepare for overriding more of this functionality in SCI. --- audio/midiparser.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'audio/midiparser.h') diff --git a/audio/midiparser.h b/audio/midiparser.h index bb9749b97f..4470d7d980 100644 --- a/audio/midiparser.h +++ b/audio/midiparser.h @@ -105,8 +105,8 @@ struct EventInfo { ///< will occur, and the MidiParser will have to generate one itself. ///< For all other events, this value should always be zero. - byte channel() { return event & 0x0F; } ///< Separates the MIDI channel from the event. - byte command() { return event >> 4; } ///< Separates the command code from the event. + byte channel() const { return event & 0x0F; } ///< Separates the MIDI channel from the event. + byte command() const { return event >> 4; } ///< Separates the command code from the event. }; /** @@ -293,6 +293,7 @@ protected: virtual void resetTracking(); virtual void allNotesOff(); virtual void parseNextEvent(EventInfo &info) = 0; + virtual bool processEvent(const EventInfo &info); void activeNote(byte channel, byte note, bool active); void hangingNote(byte channel, byte note, uint32 ticksLeft, bool recycle = true); -- cgit v1.2.3 From da81c593081ffebb33740ada85d9c2a5084f7d0a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 21 Sep 2013 00:21:08 +0200 Subject: AUDIO: Let jumpToTick use processEvent too --- audio/midiparser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/midiparser.h') diff --git a/audio/midiparser.h b/audio/midiparser.h index 4470d7d980..e9a8881cf6 100644 --- a/audio/midiparser.h +++ b/audio/midiparser.h @@ -293,7 +293,7 @@ protected: virtual void resetTracking(); virtual void allNotesOff(); virtual void parseNextEvent(EventInfo &info) = 0; - virtual bool processEvent(const EventInfo &info); + virtual bool processEvent(const EventInfo &info, bool fireEvents = true); void activeNote(byte channel, byte note, bool active); void hangingNote(byte channel, byte note, uint32 ticksLeft, bool recycle = true); -- cgit v1.2.3 From 86c2fe47e04449602e4c005fa0a9c183bc8bba39 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 21 Sep 2013 01:08:02 +0200 Subject: AUDIO: Simplify MidiTracker::processEvent return value --- audio/midiparser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/midiparser.h') diff --git a/audio/midiparser.h b/audio/midiparser.h index e9a8881cf6..28f39e623f 100644 --- a/audio/midiparser.h +++ b/audio/midiparser.h @@ -293,7 +293,7 @@ protected: virtual void resetTracking(); virtual void allNotesOff(); virtual void parseNextEvent(EventInfo &info) = 0; - virtual bool processEvent(const EventInfo &info, bool fireEvents = true); + virtual void processEvent(const EventInfo &info, bool fireEvents = true); void activeNote(byte channel, byte note, bool active); void hangingNote(byte channel, byte note, uint32 ticksLeft, bool recycle = true); -- cgit v1.2.3 From 3792af8e955bea5a07359c808361a16b15481327 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 21 Sep 2013 09:30:42 +0200 Subject: AUDIO: Simplify SCI inFastForward flag by moving it to MidiParser --- audio/midiparser.h | 1 + 1 file changed, 1 insertion(+) (limited to 'audio/midiparser.h') diff --git a/audio/midiparser.h b/audio/midiparser.h index 28f39e623f..05d0cbe1db 100644 --- a/audio/midiparser.h +++ b/audio/midiparser.h @@ -287,6 +287,7 @@ protected: ///< so each event is parsed only once; this permits ///< simulated events in certain formats. bool _abortParse; ///< If a jump or other operation interrupts parsing, flag to abort. + bool _jumpingToTick; ///< True if currently inside jumpToTick protected: static uint32 readVLQ(byte * &data); -- cgit v1.2.3