aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/sound.cpp24
-rw-r--r--engines/hugo/sound.h9
2 files changed, 14 insertions, 19 deletions
diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp
index daa467f517..f80faea5aa 100644
--- a/engines/hugo/sound.cpp
+++ b/engines/hugo/sound.cpp
@@ -60,7 +60,16 @@ MidiPlayer::MidiPlayer(MidiDriver *driver)
}
MidiPlayer::~MidiPlayer() {
- close();
+ stop();
+
+ Common::StackLock lock(_mutex);
+ _driver->setTimerCallback(0, 0);
+ _driver->close();
+ delete _driver;
+ _driver = 0;
+ if (_parser)
+ _parser->setMidiDriver(0);
+ delete _parser;
}
bool MidiPlayer::isPlaying() const {
@@ -179,19 +188,6 @@ int MidiPlayer::open() {
return 0;
}
-void MidiPlayer::close() {
- stop();
-
- Common::StackLock lock(_mutex);
- _driver->setTimerCallback(0, 0);
- _driver->close();
- delete _driver;
- _driver = 0;
- if (_parser)
- _parser->setMidiDriver(0);
- delete _parser;
-}
-
void MidiPlayer::send(uint32 b) {
byte volume, ch = (byte)(b & 0xF);
debugC(9, kDebugMusic, "MidiPlayer::send, channel %d (volume is %d)", ch, _channelsVolume[ch]);
diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h
index c8f4ae50da..cdde8cc130 100644
--- a/engines/hugo/sound.h
+++ b/engines/hugo/sound.h
@@ -58,12 +58,11 @@ public:
void syncVolume();
void updateTimer();
- // MidiDriver interface
- int open();
- void close();
- void metaEvent(byte type, byte *data, uint16 length);
- void send(uint32 b);
+ // MidiDriver_BASE interface
+ virtual void metaEvent(byte type, byte *data, uint16 length);
+ virtual void send(uint32 b);
+ int open();
uint32 getBaseTempo();
private: