aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/sound
diff options
context:
space:
mode:
authorSven Hesse2008-05-17 19:01:00 +0000
committerSven Hesse2008-05-17 19:01:00 +0000
commit6e13bde2130fb12f7d307c4fcdedd8e36e3038bb (patch)
treee47f3ec74503f4b0c8f7a3a0b06c9b7fbdf013d7 /engines/gob/sound
parent2e14d05caa043848f7d74f53117bce284c325b12 (diff)
downloadscummvm-rg350-6e13bde2130fb12f7d307c4fcdedd8e36e3038bb.tar.gz
scummvm-rg350-6e13bde2130fb12f7d307c4fcdedd8e36e3038bb.tar.bz2
scummvm-rg350-6e13bde2130fb12f7d307c4fcdedd8e36e3038bb.zip
Changing debug channels a bit
svn-id: r32157
Diffstat (limited to 'engines/gob/sound')
-rw-r--r--engines/gob/sound/adlib.cpp2
-rw-r--r--engines/gob/sound/cdrom.cpp6
-rw-r--r--engines/gob/sound/sound.cpp58
3 files changed, 58 insertions, 8 deletions
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index fb0d9d58c1..b3d392ad1e 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -125,7 +125,7 @@ int AdLib::readBuffer(int16 *buffer, const int numSamples) {
}
void AdLib::writeOPL(byte reg, byte val) {
- debugC(6, kDebugMusic, "writeOPL(%02X, %02X)", reg, val);
+ debugC(6, kDebugSound, "writeOPL(%02X, %02X)", reg, val);
OPLWriteReg(_opl, reg, val);
}
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index f3bc70807e..eef8025cc2 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -83,8 +83,6 @@ void CDROM::startTrack(const char *trackName) {
if (!_LICbuffer)
return;
- debugC(1, kDebugMusic, "CDROM::startTrack(%s)", trackName);
-
byte *matchPtr = getTrackBuffer(trackName);
if (!matchPtr) {
warning("Track \"%s\" not found", trackName);
@@ -114,8 +112,6 @@ void CDROM::play(uint32 from, uint32 to) {
// HSG encodes frame information into a double word:
// minute multiplied by 4500, plus second multiplied by 75,
// plus frame, minus 150
- debugC(1, kDebugMusic, "CDROM::play(%d, %d)", from, to);
-
AudioCD.play(1, 1, from, to - from + 1);
_cdPlaying = true;
}
@@ -159,8 +155,6 @@ void CDROM::stopPlaying() {
}
void CDROM::stop() {
- debugC(1, kDebugMusic, "CDROM::stop()");
-
_curTrackBuffer = 0;
AudioCD.stop();
_cdPlaying = false;
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index 63b74ca36f..79fe5acb56 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -92,6 +92,8 @@ bool Sound::sampleLoad(SoundDesc *sndDesc, const char *fileName, bool tryExist)
if (!sndDesc)
return false;
+ debugC(2, kDebugSound, "Loading sample \"%s\"", fileName);
+
int16 handle = _vm->_dataIO->openData(fileName);
if (handle < 0) {
warning("Can't open sample file \"%s\"", fileName);
@@ -137,6 +139,8 @@ void Sound::speakerOn(int16 frequency, int32 length) {
if (!_pcspeaker)
return;
+ debugC(1, kDebugSound, "PCSpeaker: Playing tone (%d, %d)", frequency, length);
+
_pcspeaker->speakerOn(frequency, length);
}
@@ -144,6 +148,8 @@ void Sound::speakerOff() {
if (!_pcspeaker)
return;
+ debugC(1, kDebugSound, "PCSpeaker: Stopping tone");
+
_pcspeaker->speakerOff();
}
@@ -158,6 +164,8 @@ bool Sound::infogramesLoadInstruments(const char *fileName) {
if (!_infogrames)
return false;
+ debugC(1, kDebugSound, "Infogrames: Loading instruments \"%s\"", fileName);
+
return _infogrames->loadInstruments(fileName);
}
@@ -165,6 +173,8 @@ bool Sound::infogramesLoadSong(const char *fileName) {
if (!_infogrames)
return false;
+ debugC(1, kDebugSound, "Infogrames: Loading song \"%s\"", fileName);
+
return _infogrames->loadSong(fileName);
}
@@ -172,6 +182,8 @@ void Sound::infogramesPlay() {
if (!_infogrames)
return;
+ debugC(1, kDebugSound, "Infogrames: Starting playback");
+
_infogrames->play();
}
@@ -179,6 +191,8 @@ void Sound::infogramesStop() {
if (!_infogrames)
return;
+ debugC(1, kDebugSound, "Infogrames: Stopping playback");
+
_infogrames->stop();
}
@@ -186,6 +200,8 @@ bool Sound::adlibLoad(const char *fileName) {
if (!_adlib)
return false;
+ debugC(1, kDebugSound, "Adlib: Loading data (\"%s\")", fileName);
+
return _adlib->load(fileName);
}
@@ -193,6 +209,8 @@ bool Sound::adlibLoad(byte *data, uint32 size, int index) {
if (!_adlib)
return false;
+ debugC(1, kDebugSound, "Adlib: Loading data (%d)", index);
+
return _adlib->load(data, size, index);
}
@@ -200,6 +218,8 @@ void Sound::adlibUnload() {
if (!_adlib)
return;
+ debugC(1, kDebugSound, "Adlib: Unloading data");
+
_adlib->unload();
}
@@ -207,7 +227,7 @@ void Sound::adlibPlayTrack(const char *trackname) {
if (!_adlib || _adlib->isPlaying())
return;
- debugC(1, kDebugMusic, "Adlib::playTrack(%s)", trackname);
+ debugC(1, kDebugSound, "Adlib: Playing track \"%s\"", trackname);
_adlib->unload();
_adlib->load(trackname);
@@ -235,6 +255,8 @@ void Sound::adlibPlay() {
if (!_adlib)
return;
+ debugC(1, kDebugSound, "Adlib: Starting playback");
+
_adlib->startPlay();
}
@@ -242,6 +264,8 @@ void Sound::adlibStop() {
if (!_adlib)
return;
+ debugC(1, kDebugSound, "Adlib: Stopping playback");
+
_adlib->stopPlay();
}
@@ -278,6 +302,9 @@ void Sound::blasterPlay(SoundDesc *sndDesc, int16 repCount,
if (!_blaster || !sndDesc)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Playing sample (%d, %d, %d)",
+ repCount, frequency, fadeLength);
+
_blaster->playSample(*sndDesc, repCount, frequency, fadeLength);
}
@@ -285,6 +312,8 @@ void Sound::blasterStop(int16 fadeLength, SoundDesc *sndDesc) {
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Stopping playback");
+
_blaster->stopSound(fadeLength, sndDesc);
}
@@ -293,6 +322,9 @@ void Sound::blasterPlayComposition(int16 *composition, int16 freqVal,
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Playing composition (%d, %d)",
+ freqVal, sndCount);
+
blasterWaitEndPlay();
_blaster->stopComposition();
@@ -306,6 +338,8 @@ void Sound::blasterStopComposition() {
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Stopping composition");
+
_blaster->stopComposition();
}
@@ -327,6 +361,8 @@ void Sound::blasterWaitEndPlay(bool interruptible, bool stopComp) {
if (!_blaster)
return;
+ debugC(1, kDebugSound, "SoundBlaster: Waiting for playback to end");
+
if (stopComp)
_blaster->endComposition();
@@ -345,6 +381,8 @@ void Sound::cdLoadLIC(const char *fname) {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Loading LIC \"%s\"", fname);
+
int handle = _vm->_dataIO->openData(fname);
if (handle == -1)
@@ -366,6 +404,8 @@ void Sound::cdUnloadLIC() {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Unloading LIC");
+
_cdrom->freeLICBuffer();
}
@@ -400,6 +440,9 @@ void Sound::cdPlayBgMusic() {
for (int i = 0; i < ARRAYSIZE(tracks); i++)
if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
+ debugC(1, kDebugSound, "CDROM: Playing background music \"%s\" (\"%s\")",
+ tracks[i][1], _vm->_game->_curTotFile);
+
_cdrom->startTrack(tracks[i][1]);
break;
}
@@ -422,6 +465,9 @@ void Sound::cdPlayMultMusic() {
int language = _vm->_global->_language <= 4 ? _vm->_global->_language : 2;
for (int i = 0; i < ARRAYSIZE(tracks); i++)
if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
+ debugC(1, kDebugSound, "CDROM: Playing mult music \"%s\" (\"%s\")",
+ tracks[i][language + 1], _vm->_game->_curTotFile);
+
_cdrom->startTrack(tracks[i][language + 1]);
break;
}
@@ -431,6 +477,7 @@ void Sound::cdPlay(const char *trackName) {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Playing track \"%s\"", trackName);
_cdrom->startTrack(trackName);
}
@@ -438,6 +485,7 @@ void Sound::cdStop() {
if (!_cdrom)
return;
+ debugC(1, kDebugSound, "CDROM: Stopping playback");
_cdrom->stopPlaying();
}
@@ -473,6 +521,8 @@ void Sound::bgPlay(const char *base, int count) {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Playing \"%s\" (%d)", base, count);
+
_bgatmos->stop();
_bgatmos->queueClear();
@@ -495,6 +545,8 @@ void Sound::bgStop() {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Stopping playback");
+
_bgatmos->stop();
_bgatmos->queueClear();
}
@@ -510,6 +562,8 @@ void Sound::bgShade() {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Shading playback");
+
_bgatmos->shade();
}
@@ -517,6 +571,8 @@ void Sound::bgUnshade() {
if (!_bgatmos)
return;
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Unshading playback");
+
_bgatmos->unshade();
}