diff options
author | Johannes Schickel | 2011-10-29 00:56:39 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-10-29 01:00:18 +0200 |
commit | 7469187ef3dbfe34acef6d3a538489595e246b55 (patch) | |
tree | 05739554860317d1506cff33cb8addf00d976d61 /engines/kyra/sound.cpp | |
parent | 9d9837f217599fa238d5a9098b65994f089ece6b (diff) | |
download | scummvm-rg350-7469187ef3dbfe34acef6d3a538489595e246b55.tar.gz scummvm-rg350-7469187ef3dbfe34acef6d3a538489595e246b55.tar.bz2 scummvm-rg350-7469187ef3dbfe34acef6d3a538489595e246b55.zip |
KYRA: Move MixedSoundDriver implementation to sound.cpp.
Diffstat (limited to 'engines/kyra/sound.cpp')
-rw-r--r-- | engines/kyra/sound.cpp | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index af50f0f5cb..5195271808 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -163,6 +163,91 @@ bool Sound::allVoiceChannelsPlaying() const { #pragma mark - +MixedSoundDriver::MixedSoundDriver(KyraEngine_v1 *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx) + : Sound(vm, mixer), _music(music), _sfx(sfx) { +} + +MixedSoundDriver::~MixedSoundDriver() { + delete _music; + delete _sfx; +} + +Sound::kType MixedSoundDriver::getMusicType() const { + return _music->getMusicType(); +} + +Sound::kType MixedSoundDriver::getSfxType() const { + return _sfx->getSfxType(); +} + +bool MixedSoundDriver::init() { + return (_music->init() && _sfx->init()); +} + +void MixedSoundDriver::process() { + _music->process(); + _sfx->process(); +} + +void MixedSoundDriver::updateVolumeSettings() { + _music->updateVolumeSettings(); + _sfx->updateVolumeSettings(); +} + +void MixedSoundDriver::setSoundList(const AudioDataStruct *list) { + _music->setSoundList(list); + _sfx->setSoundList(list); +} + +bool MixedSoundDriver::hasSoundFile(uint file) const { + return _music->hasSoundFile(file) && _sfx->hasSoundFile(file); +} + +void MixedSoundDriver::loadSoundFile(uint file) { + _music->loadSoundFile(file); + _sfx->loadSoundFile(file); +} + +void MixedSoundDriver::loadSoundFile(Common::String file) { + _music->loadSoundFile(file); + _sfx->loadSoundFile(file); +} + +void MixedSoundDriver::loadSfxFile(Common::String file) { + _sfx->loadSoundFile(file); +} + +void MixedSoundDriver::playTrack(uint8 track) { + _music->playTrack(track); +} + +void MixedSoundDriver::haltTrack() { + _music->haltTrack(); +} + +bool MixedSoundDriver::isPlaying() const { + return _music->isPlaying() | _sfx->isPlaying(); +} + +void MixedSoundDriver::playSoundEffect(uint8 track) { + _sfx->playSoundEffect(track); +} + +void MixedSoundDriver::stopAllSoundEffects() { + _sfx->stopAllSoundEffects(); +} + +void MixedSoundDriver::beginFadeOut() { + _music->beginFadeOut(); +} + +void MixedSoundDriver::pause(bool paused) { + _music->pause(paused); + _sfx->pause(paused); +} + +#pragma mark - + void KyraEngine_v1::snd_playTheme(int file, int track) { if (_curMusicTheme == file) return; |