diff options
author | Max Horn | 2011-03-23 16:14:39 +0100 |
---|---|---|
committer | Max Horn | 2011-03-23 16:49:41 +0100 |
commit | e70fd59b3505619cccb6f3280a4cf0fb57aefa97 (patch) | |
tree | 055c9719a41c4706baa4e5c4837e5fd31da95486 /engines/made/music.h | |
parent | 29847ea42da3e597d3496972c80ce49bea76da20 (diff) | |
download | scummvm-rg350-e70fd59b3505619cccb6f3280a4cf0fb57aefa97.tar.gz scummvm-rg350-e70fd59b3505619cccb6f3280a4cf0fb57aefa97.tar.bz2 scummvm-rg350-e70fd59b3505619cccb6f3280a4cf0fb57aefa97.zip |
ENGINES: Further simplify pseudo MidiDrivers; fix some regressions
The regression affected AGOS and maybe some others; specifically,
the real MidiDriver would have been deleted twice -- I previously
missed that the Engine instances takes care of freeing the real
MidiDriver, not the MidiPlayer wrapping it.
This commit should clarify the ownership of the real MidiDriver for
most pseudo MidiDrivers.
Diffstat (limited to 'engines/made/music.h')
-rw-r--r-- | engines/made/music.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/engines/made/music.h b/engines/made/music.h index 6bd4da470e..b52a8116b5 100644 --- a/engines/made/music.h +++ b/engines/made/music.h @@ -43,7 +43,7 @@ enum MusicFlags { class MusicPlayer : public MidiDriver_BASE { public: - MusicPlayer(MidiDriver *driver); + MusicPlayer(); ~MusicPlayer(); bool isPlaying() { return _isPlaying; } @@ -52,8 +52,7 @@ public: void setVolume(int volume); int getVolume() { return _masterVolume; } - void setNativeMT32(bool b) { _nativeMT32 = b; } - bool hasNativeMT32() { return _nativeMT32; } + bool hasNativeMT32() const { return _nativeMT32; } void playXMIDI(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL); void playSMF(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL); void stop(); @@ -64,20 +63,17 @@ public: void setGM(bool isGM) { _isGM = isGM; } - //MidiDriver interface implementation - int open(); - void close(); - void send(uint32 b); - - void metaEvent(byte type, byte *data, uint16 length); - - MidiParser *_parser; - Common::Mutex _mutex; + // MidiDriver_BASE interface implementation + virtual void send(uint32 b); + virtual void metaEvent(byte type, byte *data, uint16 length); protected: static void onTimer(void *data); + MidiParser *_parser; + Common::Mutex _mutex; + MidiChannel *_channel[16]; MidiDriver *_driver; MidiParser *_xmidiParser, *_smfParser; |