diff options
author | Johannes Schickel | 2006-03-28 15:15:36 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-03-28 15:15:36 +0000 |
commit | c09d1ea52032be21fed34fa1ca17484af202b547 (patch) | |
tree | a1577c4b306fb6b18068dd692cd8c391228e6596 /engines/kyra/sound.h | |
parent | 46270a5dd7ffd36ba741f54865fa3715e8b5c6e7 (diff) | |
download | scummvm-rg350-c09d1ea52032be21fed34fa1ca17484af202b547.tar.gz scummvm-rg350-c09d1ea52032be21fed34fa1ca17484af202b547.tar.bz2 scummvm-rg350-c09d1ea52032be21fed34fa1ca17484af202b547.zip |
- Commits heaviliy modifed patch #1459951 ("KYRA: Combining MIDI music with Adlib sfx") (created a wrapper class for two different sound drivers instead of adding a new variable to the KyraEngine class and chaning stuff there)
- Prevents to play track 0 for non mt-32 midi devices (got ugly sound output with windows midi)
svn-id: r21479
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r-- | engines/kyra/sound.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 117b0c2cf1..9d0c131c5c 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -188,6 +188,30 @@ private: MidiParser *_soundEffect; byte *_soundEffectSource; }; + +class MixedSoundDriver : public Sound { +public: + MixedSoundDriver(KyraEngine *engine, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(engine, mixer), _music(music), _sfx(sfx) {} + ~MixedSoundDriver() { delete _music; delete _sfx; } + + bool init() { return _music->init() | _sfx->init(); } + void process() { _music->process(); _sfx->process(); } + + void setVolume(int volume) { _music->setVolume(volume); _sfx->setVolume(volume); } + int getVolume() { return _music->getVolume(); } + + void loadMusicFile(const char *file) { _music->loadMusicFile(file); _sfx->loadMusicFile(file); } + + void playTrack(uint8 track) { _music->playTrack(track); } + void haltTrack() { _music->haltTrack(); } + + void playSoundEffect(uint8 track) { _sfx->playSoundEffect(track); } + + void beginFadeOut() { _music->beginFadeOut(); } +private: + Sound *_music, *_sfx; +}; + } // end of namespace Kyra #endif |