diff options
-rwxr-xr-x | engines/startrek/sound.cpp | 10 | ||||
-rwxr-xr-x | engines/startrek/startrek.cpp | 3 | ||||
-rwxr-xr-x | engines/startrek/startrek.h | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp index 32b31901b8..7b16c289ac 100755 --- a/engines/startrek/sound.cpp +++ b/engines/startrek/sound.cpp @@ -88,6 +88,8 @@ void Sound::playMidiTrack(int track) { assert(loadedSoundData != NULL); + debugC(6, kDebugSound, "Playing MIDI track %d", track); + // Check if a midi slot for this track exists already for (int i=1; i<8; i++) { if (_midiSlots[i].track == track) { @@ -152,10 +154,13 @@ void Sound::playSoundEffect(const char *baseSoundName) { if (readStream == nullptr) error("Couldn't open '%s'", soundName.c_str()); + debugC(5, kDebugSound, "Playing sound effect '%s'", baseSoundName); Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES); _vm->_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandles[i], audioStream); return; } + + debugC(3, kDebugSound, "No sound slot to play '%s'", baseSoundName); } void Sound::playSpeech(const Common::String &basename) { @@ -174,7 +179,7 @@ void Sound::playSpeech(const Common::String &basename) { } Common::String filename = "voc/" + Common::String(name.c_str(), name.c_str()+i) + ".voc"; - debug("Playing speech '%s'", filename.c_str()); + debugC(5, kDebugSound, "Playing speech '%s'", filename.c_str()); Common::SeekableReadStream *readStream = SearchMan.createReadStreamForMember(filename); if (readStream == nullptr) error("Couldn't open '%s'", filename.c_str()); @@ -197,6 +202,7 @@ void Sound::playSpeech(const Common::String &basename) { void Sound::stopPlayingSpeech() { if (_playingSpeech) { + debugC(5, kDebugSound, "Canceled speech playback"); _playingSpeech = false; _vm->_system->getMixer()->stopHandle(_speechHandle); } @@ -230,7 +236,7 @@ void Sound::loadPCMusicFile(const char *baseSoundName) { break; } - debug(0, "Playing sound \'%s\'\n", soundName.c_str()); + debugC(5, kDebugSound, "Loading midi \'%s\'\n", soundName.c_str()); SharedPtr<Common::SeekableReadStream> soundStream = _vm->openFile(soundName.c_str()); if (loadedSoundData != nullptr) diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp index d888d1f710..e25d427157 100755 --- a/engines/startrek/startrek.cpp +++ b/engines/startrek/startrek.cpp @@ -24,6 +24,7 @@ #include "base/version.h" #include "common/archive.h" #include "common/config-manager.h" +#include "common/debug-channels.h" #include "common/error.h" #include "common/events.h" #include "common/file.h" @@ -39,6 +40,8 @@ namespace StarTrek { StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) { + DebugMan.addDebugChannel(kDebugSound, "sound", "Sound"); + _gfx = nullptr; _sound = nullptr; _macResFork = nullptr; diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h index 232482a767..faf396a0c2 100755 --- a/engines/startrek/startrek.h +++ b/engines/startrek/startrek.h @@ -57,6 +57,10 @@ enum StarTrekGameFeatures { GF_DEMO = (1 << 0) }; +enum kDebugLevels { + kDebugSound = 1 << 0 +}; + enum TrekEventType { TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks) |