diff options
author | Eric Fry | 2018-05-01 20:33:10 +1000 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 5dd96b6fbe574d8ea2ec3710b46fe94779c3d3ce (patch) | |
tree | 90cf5f4664ef3be4b2f79eae5eb7324e324b6291 /engines/illusions/sound.h | |
parent | a7d78df98cdd0399d338c0077efc474d02678643 (diff) | |
download | scummvm-rg350-5dd96b6fbe574d8ea2ec3710b46fe94779c3d3ce.tar.gz scummvm-rg350-5dd96b6fbe574d8ea2ec3710b46fe94779c3d3ce.tar.bz2 scummvm-rg350-5dd96b6fbe574d8ea2ec3710b46fe94779c3d3ce.zip |
ILLUSIONS: Add midi music player
Diffstat (limited to 'engines/illusions/sound.h')
-rw-r--r-- | engines/illusions/sound.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/illusions/sound.h b/engines/illusions/sound.h index d2d91ac3c8..7979978c62 100644 --- a/engines/illusions/sound.h +++ b/engines/illusions/sound.h @@ -25,6 +25,7 @@ #include "illusions/graphics.h" #include "audio/audiostream.h" +#include "audio/midiplayer.h" #include "audio/mixer.h" #include "audio/decoders/wave.h" #include "common/list.h" @@ -46,6 +47,27 @@ protected: uint _flags; }; +class MidiPlayer : public Audio::MidiPlayer { +public: + MidiPlayer(); + + void pause(bool p); + void play(const Common::String &filename); + + // The following line prevents compiler warnings about hiding the pause() + // method from the parent class. + // FIXME: Maybe the pause(bool p) method should be removed and the + // pause/resume methods of the parent class be used instead? + virtual void pause() { Audio::MidiPlayer::pause(); } + + // Overload Audio::MidiPlayer method + virtual void sendToChannel(byte channel, uint32 b); + virtual void onTimer(); + +private: + bool _paused; +}; + class VoicePlayer { public: VoicePlayer(); @@ -90,6 +112,9 @@ public: void playMusic(uint32 musicId, int16 type, int16 volume, int16 pan, uint32 notifyThreadId); void stopMusic(); + void playMidiMusic(uint32 musicId); + void stopMidiMusic(); + bool cueVoice(const char *voiceName); void stopCueingVoice(); void startVoice(int16 volume, int16 pan); @@ -109,6 +134,7 @@ protected: IllusionsEngine *_vm; uint32 _musicNotifyThreadId; MusicPlayer *_musicPlayer; + MidiPlayer *_midiPlayer; VoicePlayer *_voicePlayer; SoundList _sounds; Sound *getSound(uint32 soundEffectId); |