From 29847ea42da3e597d3496972c80ce49bea76da20 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 23 Mar 2011 15:23:26 +0100 Subject: AUDIO: Change several fake MidiDrivers to MidiDriver_BASE subclasses Many engines follow the advice in audio/midiparser.h and create a "pseudo-MidiDriver" subclass. But MidiParser really only needs a tiny subset of the MidiDriver capabilities, namely those found in MidiDriver_BASE. So we try to subclass from that whenever possible; this allows us to remove many stub methods, and enables further future simplifications. --- engines/hugo/sound.cpp | 16 ---------------- engines/hugo/sound.h | 8 +------- 2 files changed, 1 insertion(+), 23 deletions(-) (limited to 'engines/hugo') diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 33627fb240..daa467f517 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -75,18 +75,6 @@ void MidiPlayer::setLooping(bool loop) { _isLooping = loop; } -MidiChannel *MidiPlayer::allocateChannel() { - return 0; -} - -MidiChannel *MidiPlayer::getPercussionChannel() { - return 0; -} - -uint32 MidiPlayer::getBaseTempo() { - return _driver ? _driver->getBaseTempo() : 0; -} - void MidiPlayer::play(uint8 *stream, uint16 size) { debugC(3, kDebugMusic, "MidiPlayer::play"); if (!stream) { @@ -191,10 +179,6 @@ int MidiPlayer::open() { return 0; } -bool MidiPlayer::isOpen() const { - return _driver && _driver->isOpen(); -} - void MidiPlayer::close() { stop(); diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h index e5e9d94ebb..c8f4ae50da 100644 --- a/engines/hugo/sound.h +++ b/engines/hugo/sound.h @@ -40,7 +40,7 @@ namespace Hugo { -class MidiPlayer : public MidiDriver { +class MidiPlayer : public MidiDriver_BASE { public: MidiPlayer(MidiDriver *driver); ~MidiPlayer(); @@ -60,15 +60,9 @@ public: // MidiDriver interface int open(); - bool isOpen() const; - - MidiChannel *allocateChannel(); - MidiChannel *getPercussionChannel(); - void close(); void metaEvent(byte type, byte *data, uint16 length); void send(uint32 b); - void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { } uint32 getBaseTempo(); -- cgit v1.2.3