aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
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/parallaction
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/parallaction')
-rw-r--r--engines/parallaction/sound_br.cpp11
-rw-r--r--engines/parallaction/sound_ns.cpp11
2 files changed, 2 insertions, 20 deletions
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 80bd95779d..b74a584b2c 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -201,7 +201,7 @@ MidiParser *createParser_MSC() {
}
-class MidiPlayer_MSC : public MidiDriver {
+class MidiPlayer_MSC : public MidiDriver_BASE {
public:
enum {
@@ -222,14 +222,9 @@ public:
// MidiDriver interface
int open();
- bool isOpen() const;
void close();
void send(uint32 b);
void metaEvent(byte type, byte *data, uint16 length);
- void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { }
- uint32 getBaseTempo() { return _driver ? _driver->getBaseTempo() : 0; }
- MidiChannel *allocateChannel() { return 0; }
- MidiChannel *getPercussionChannel() { return 0; }
private:
@@ -342,10 +337,6 @@ int MidiPlayer_MSC::open() {
return ret;
}
-bool MidiPlayer_MSC::isOpen() const {
- return _driver && _driver->isOpen();
-}
-
void MidiPlayer_MSC::close() {
stop();
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index aeb934fd8b..6d80b5dbc1 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -38,7 +38,7 @@
namespace Parallaction {
-class MidiPlayer : public MidiDriver {
+class MidiPlayer : public MidiDriver_BASE {
public:
enum {
@@ -59,14 +59,9 @@ public:
// MidiDriver interface
int open();
- bool isOpen() const;
void close();
void send(uint32 b);
void metaEvent(byte type, byte *data, uint16 length);
- void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { }
- uint32 getBaseTempo() { return _driver ? _driver->getBaseTempo() : 0; }
- MidiChannel *allocateChannel() { return 0; }
- MidiChannel *getPercussionChannel() { return 0; }
private:
@@ -177,10 +172,6 @@ int MidiPlayer::open() {
return ret;
}
-bool MidiPlayer::isOpen() const {
- return _driver && _driver->isOpen();
-}
-
void MidiPlayer::close() {
stop();