diff options
Diffstat (limited to 'engines/agi/sound.cpp')
-rw-r--r-- | engines/agi/sound.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 8f678cbac9..2c1eb021f9 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -29,9 +29,19 @@ #include "agi/sound_pcjr.h" #include "common/textconsole.h" +#include "audio/mixer.h" namespace Agi { +SoundGen::SoundGen(AgiBase *vm, Audio::Mixer *pMixer) : _vm(vm), _mixer(pMixer) { + _sampleRate = pMixer->getOutputRate(); + _soundHandle = new Audio::SoundHandle(); +} + +SoundGen::~SoundGen() { + delete _soundHandle; +} + // // TODO: add support for variable sampling rate in the output device // @@ -140,7 +150,7 @@ void SoundMgr::startSound(int resnum, int flag) { if (_vm->getVersion() < 0x2000) { _vm->_game.vars[_endflag] = 0; } else { - _vm->setflag(_endflag, false); + _vm->setFlag(_endflag, false); } } @@ -160,7 +170,7 @@ void SoundMgr::stopSound() { if (_vm->getVersion() < 0x2000) { _vm->_game.vars[_endflag] = 1; } else { - _vm->setflag(_endflag, true); + _vm->setFlag(_endflag, true); } } @@ -169,7 +179,7 @@ void SoundMgr::stopSound() { void SoundMgr::soundIsFinished() { if (_endflag != -1) - _vm->setflag(_endflag, true); + _vm->setFlag(_endflag, true); if (_playingSound != -1) _vm->_game.sounds[_playingSound]->stop(); @@ -183,6 +193,7 @@ SoundMgr::SoundMgr(AgiBase *agi, Audio::Mixer *pMixer) { _playingSound = -1; switch (_vm->_soundemu) { + default: case SOUND_EMU_NONE: case SOUND_EMU_AMIGA: case SOUND_EMU_MAC: |