Skip to content

Commit

Permalink
FMOD|Cleanup: Log entries containing pointer values
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 14, 2014
1 parent f8a662d commit ccb1c89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/fmod/src/driver_fmod.cpp
Expand Up @@ -134,7 +134,7 @@ int DS_Init(void)
// Print the credit required by FMOD license.
LOG_AUDIO_NOTE("FMOD Sound System (c) Firelight Technologies Pty, Ltd., 1994-2013");

DSFMOD_TRACE("DS_Init: FMOD initialized.");
LOGDEV_AUDIO_VERBOSE("[FMOD] Initialized");
return true;
}

Expand Down
33 changes: 15 additions & 18 deletions doomsday/plugins/fmod/src/fmod_sfx.cpp
Expand Up @@ -156,7 +156,7 @@ static FMOD_RESULT F_CALLBACK channelCallback(FMOD_CHANNEL* chanPtr,
channel->getUserData(reinterpret_cast<void**>(&buf));
if(buf)
{
DSFMOD_TRACE("channelCallback: sfxbuffer " << buf << " stops.");
LOGDEV_AUDIO_XVERBOSE("[FMOD] channelCallback: sfxbuffer %p stops") << buf;
buf->flags &= ~SFXBF_PLAYING;
// The channel becomes invalid after the sound stops.
bufferInfo(buf).channel = 0;
Expand Down Expand Up @@ -194,7 +194,7 @@ sfxbuffer_t* DS_SFX_CreateBuffer(int flags, int bits, int rate)
// Allocate extra state information.
buf->ptr = new BufferInfo;

DSFMOD_TRACE("SFX_CreateBuffer: Created sfxbuffer " << buf);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_CreateBuffer: Created sfxbuffer %p") << buf;

return buf;
}
Expand All @@ -203,7 +203,7 @@ void DS_SFX_DestroyBuffer(sfxbuffer_t* buf)
{
if(!buf) return;

DSFMOD_TRACE("SFX_DestroyBuffer: Destroying sfxbuffer " << buf);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_DestroyBuffer: Destroying sfxbuffer %p") << buf;

BufferInfo& info = bufferInfo(buf);
if(info.sound)
Expand Down Expand Up @@ -279,15 +279,13 @@ void DS_SFX_Load(sfxbuffer_t* buf, struct sfxsample_s* sample)
params.numchannels = 1; // Doomsday only uses mono samples currently.
params.format = (sample->bytesPer == 1? FMOD_SOUND_FORMAT_PCM8 : FMOD_SOUND_FORMAT_PCM16);

DSFMOD_TRACE("SFX_Load: sfxbuffer " << buf
<< " sample (size:" << sample->size
<< ", freq:" << sample->rate
<< ", bps:" << sample->bytesPer << ")");
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Load: sfxbuffer %p sample (size:%i, freq:%i, bps:%i)")
<< buf << sample->size << sample->rate << sample->bytesPer;

// If it has a sample, release it later.
if(info.sound)
{
DSFMOD_TRACE("SFX_Load: Releasing buffer's old Sound " << info.sound);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Load: Releasing buffer's old Sound %p") << info.sound;
info.sound->release();
streams.erase(info.sound);
}
Expand Down Expand Up @@ -330,13 +328,15 @@ void DS_SFX_Load(sfxbuffer_t* buf, struct sfxsample_s* sample)
FMOD_RESULT result;
result = fmodSystem->createSound(sampleData, info.mode, &params, &info.sound);
DSFMOD_ERRCHECK(result);
DSFMOD_TRACE("SFX_Load: created Sound " << info.sound << (streaming? " as streaming" : ""));
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Load: created Sound %p%s")
<< info.sound << (streaming? " as streaming" : "");

if(streaming)
{
// Keep a record of the playing stream for the PCM read callback.
streams[info.sound] = buf;
DSFMOD_TRACE("SFX_Load: noting " << info.sound << " belongs to streaming buffer " << buf);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Load: noting %p belongs to streaming buffer %p")
<< info.sound << buf;
}

// Not started yet.
Expand All @@ -361,7 +361,7 @@ void DS_SFX_Reset(sfxbuffer_t* buf)
if(!buf)
return;

DSFMOD_TRACE("SFX_Reset: sfxbuffer " << buf);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Reset: sfxbuffer %p") << buf;

DS_SFX_Stop(buf);
buf->sample = 0;
Expand All @@ -370,7 +370,7 @@ void DS_SFX_Reset(sfxbuffer_t* buf)
BufferInfo& info = bufferInfo(buf);
if(info.sound)
{
DSFMOD_TRACE("SFX_Reset: releasing Sound " << info.sound);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Reset: releasing Sound %p") << info.sound;
info.sound->release();
streams.erase(info.sound);
}
Expand Down Expand Up @@ -413,11 +413,8 @@ void DS_SFX_Play(sfxbuffer_t* buf)
info.channel->setMode(info.mode);
}

DSFMOD_TRACE("SFX_Play: sfxbuffer " << buf <<
", pan:" << info.pan <<
", freq:" << buf->freq <<
", vol:" << info.volume <<
", loop:" << ((buf->flags & SFXBF_REPEAT) != 0));
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Play: sfxbuffer %p, pan:%f, freq:%i, vol:%f, loop:%b")
<< buf << info.pan << buf->freq << info.volume << ((buf->flags & SFXBF_REPEAT) != 0);

// Start playing it.
info.channel->setPaused(false);
Expand All @@ -430,7 +427,7 @@ void DS_SFX_Stop(sfxbuffer_t* buf)
{
if(!buf) return;

DSFMOD_TRACE("SFX_Stop: sfxbuffer " << buf);
LOGDEV_AUDIO_XVERBOSE("[FMOD] SFX_Stop: sfxbuffer %p") << buf;

BufferInfo& info = bufferInfo(buf);

Expand Down

0 comments on commit ccb1c89

Please sign in to comment.