aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorMax Horn2011-03-23 15:23:26 +0100
committerMax Horn2011-03-23 15:25:47 +0100
commit29847ea42da3e597d3496972c80ce49bea76da20 (patch)
tree654596bc11032f28d9b2a776571fdb7623ceb5c6 /engines/hugo
parentc70c8864f131bfe42437b05d03f77ab198f59247 (diff)
downloadscummvm-rg350-29847ea42da3e597d3496972c80ce49bea76da20.tar.gz
scummvm-rg350-29847ea42da3e597d3496972c80ce49bea76da20.tar.bz2
scummvm-rg350-29847ea42da3e597d3496972c80ce49bea76da20.zip
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.
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/sound.cpp16
-rw-r--r--engines/hugo/sound.h8
2 files changed, 1 insertions, 23 deletions
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();