diff options
-rw-r--r-- | engines/parallaction/parallaction.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 3 | ||||
-rw-r--r-- | engines/parallaction/sound.cpp | 21 |
3 files changed, 22 insertions, 3 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 87c06b8c36..55cef1a3c1 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -120,6 +120,7 @@ Parallaction::Parallaction(OSystem *syst) : Common::addSpecialDebugLevel(kDebugGraphics, "gfx", "Gfx debug level"); Common::addSpecialDebugLevel(kDebugJobs, "jobs", "Jobs debug level"); Common::addSpecialDebugLevel(kDebugInput, "input", "Input debug level"); + Common::addSpecialDebugLevel(kDebugAudio, "audio", "Audio debug level"); } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index dfb1096dfb..554dcb6869 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -51,7 +51,8 @@ enum { kDebugDialogue = 1 << 3, kDebugGraphics = 1 << 4, kDebugJobs = 1 << 5, - kDebugInput = 1 << 6 + kDebugInput = 1 << 6, + kDebugAudio = 1 << 7 }; enum { diff --git a/engines/parallaction/sound.cpp b/engines/parallaction/sound.cpp index 8a00b2972f..07a5528c32 100644 --- a/engines/parallaction/sound.cpp +++ b/engines/parallaction/sound.cpp @@ -231,10 +231,14 @@ DosSoundMan::DosSoundMan(Parallaction *vm, MidiDriver *midiDriver) : SoundMan(vm } DosSoundMan::~DosSoundMan() { + debugC(1, kDebugAudio, "DosSoundMan::playMusic()"); + delete _midiPlayer; } void DosSoundMan::playMusic() { + debugC(1, kDebugAudio, "DosSoundMan::playMusic()"); + _midiPlayer->play(_musicFile); } @@ -313,6 +317,8 @@ void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, in return; } + debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel); + Channel *ch = &_channels[channel]; Common::ReadStream *stream = _vm->_disk->loadSound(filename); Audio::A8SVXDecoder decoder(*stream, ch->header, ch->data, ch->dataSize); @@ -349,6 +355,8 @@ void AmigaSoundMan::stopSfx(uint channel) { return; } + debugC(1, kDebugAudio, "AmigaSoundMan::stopSfx(%i)", channel); + _mixer->stopHandle(_channels[channel].handle); free(_channels[channel].data); _channels[channel].data = 0; @@ -357,16 +365,25 @@ void AmigaSoundMan::stopSfx(uint channel) { void AmigaSoundMan::playMusic() { stopMusic(); + debugC(1, kDebugAudio, "AmigaSoundMan::playMusic()"); + Common::ReadStream *stream = _vm->_disk->loadMusic(_musicFile); _musicStream = Audio::makeProtrackerStream(stream); delete stream; + debugC(3, kDebugAudio, "AmigaSoundMan::playMusic(): created new music stream"); + _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _musicStream, -1, 255, 0, false, false); } void AmigaSoundMan::stopMusic() { - _mixer->stopHandle(_musicHandle); - delete _musicStream; + debugC(1, kDebugAudio, "AmigaSoundMan::stopMusic()"); + + if (_mixer->isSoundHandleActive(_musicHandle)) { + _mixer->stopHandle(_musicHandle); + delete _musicStream; + _musicStream = 0; + } } void AmigaSoundMan::playCharacterMusic(const char *character) { |