From b6aef6f0ec591bd1f51c2fcd991576f43899afc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Thu, 9 Jan 2014 09:02:59 +0200 Subject: [PATCH] Cleanup|Audio: Log levels and domains (continued) --- doomsday/client/src/audio/audiodriver.cpp | 31 ++++++++-------- .../client/src/audio/audiodriver_music.cpp | 4 +- doomsday/client/src/audio/m_mus2midi.cpp | 7 +++- doomsday/client/src/audio/s_main.cpp | 20 +++++----- doomsday/client/src/audio/s_mus.cpp | 25 +++++-------- doomsday/client/src/audio/s_sfx.cpp | 6 ++- doomsday/client/src/audio/s_wav.cpp | 12 +++--- .../client/src/audio/sys_audiod_sdlmixer.cpp | 37 ++++++++++--------- doomsday/libdeng2/include/de/c_wrapper.h | 10 ++--- doomsday/libdeng2/src/c_wrapper.cpp | 9 +++-- doomsday/plugins/example/src/example.c | 3 +- .../fluidsynth/include/driver_fluidsynth.h | 2 +- doomsday/plugins/fmod/include/driver_fmod.h | 4 +- doomsday/plugins/fmod/src/driver_fmod.cpp | 6 +-- 14 files changed, 90 insertions(+), 86 deletions(-) diff --git a/doomsday/client/src/audio/audiodriver.cpp b/doomsday/client/src/audio/audiodriver.cpp index b912330349..86578694b1 100644 --- a/doomsday/client/src/audio/audiodriver.cpp +++ b/doomsday/client/src/audio/audiodriver.cpp @@ -150,6 +150,8 @@ static AutoStr* findAudioPluginPath(const char* name) static boolean loadAudioDriver(driver_t* driver, const char* name) { + LOG_AS("loadAudioDriver"); + boolean ok = false; if(name && name[0]) @@ -164,7 +166,7 @@ static boolean loadAudioDriver(driver_t* driver, const char* name) } else { - Con_Message("Warning: loadAudioDriver: Loading of \"%s\" failed.", name); + LOG_AUDIO_WARNING("Loading of \"%s\" failed") << name; } } return ok; @@ -183,8 +185,9 @@ static const char* getDriverName(audiodriverid_t id) }; if(VALID_AUDIODRIVER_IDENTIFIER(id)) return audioDriverNames[id]; - Con_Error("S_GetDriverName: Unknown driver id %i.\n", id); - return 0; // Unreachable. + + DENG2_ASSERT(!"S_GetDriverName: Unknown driver id"); + return ""; // Unreachable. } static audiodriverid_t identifierToDriverId(const char* name) @@ -193,7 +196,7 @@ static audiodriverid_t identifierToDriverId(const char* name) { if(!stricmp(name, driverIdentifier[i])) return (audiodriverid_t) i; } - Con_Message("'%s' is not a valid audio driver name.", name); + LOG_AUDIO_ERROR("'%s' is not a valid audio driver name") << name; return AUDIOD_INVALID; } @@ -212,11 +215,7 @@ static boolean initDriver(audiodriverid_t id) { driver_t* d = &drivers[id]; - if(!VALID_AUDIODRIVER_IDENTIFIER(id)) - { - Con_Error("initDriver: Unknown audio driver id %i.\n", id); - return false; - } + DENG2_ASSERT(VALID_AUDIODRIVER_IDENTIFIER(id)); assert(!isDriverInited(id)); memset(d, 0, sizeof(*d)); @@ -263,8 +262,8 @@ static boolean initDriver(audiodriverid_t id) break; #endif default: - Con_Error("initDriver: Unknown audio driver id %i.\n", id); - return false; // Unreachable. + DENG2_ASSERT(!"initDriver: Unknown audio driver id"); + return false; } // All loaded drivers are automatically initialized so they are ready for use. @@ -313,7 +312,7 @@ static audiodriverid_t initDriverIfNeeded(const char* identifier) { initDriver(drvId); } - assert(VALID_AUDIODRIVER_IDENTIFIER(drvId)); + DENG2_ASSERT(VALID_AUDIODRIVER_IDENTIFIER(drvId)); return drvId; } @@ -375,7 +374,7 @@ static void selectInterfaces(audiodriverid_t defaultDriverId) drvId = initDriverIfNeeded(CommandLine_At(++p)); if(!drivers[drvId].sfx.gen.Init) { - Con_Error("Audio driver '%s' does not provide an SFX interface.\n", getDriverName(drvId)); + LOG_AUDIO_ERROR("Audio driver '%s' does not provide an SFX interface") << getDriverName(drvId); } appendInterface(&pos, AUDIO_ISFX, &drivers[drvId].sfx); continue; @@ -387,7 +386,7 @@ static void selectInterfaces(audiodriverid_t defaultDriverId) drvId = initDriverIfNeeded(CommandLine_At(++p)); if(!drivers[drvId].music.gen.Init) { - Con_Error("Audio driver '%s' does not provide a Music interface.\n", getDriverName(drvId)); + LOG_AUDIO_ERROR("Audio driver '%s' does not provide a Music interface") << getDriverName(drvId); } appendInterface(&pos, AUDIO_IMUSIC, &drivers[drvId].music); continue; @@ -399,7 +398,7 @@ static void selectInterfaces(audiodriverid_t defaultDriverId) drvId = initDriverIfNeeded(CommandLine_At(++p)); if(!drivers[drvId].cd.gen.Init) { - Con_Error("Audio driver '%s' does not provide a CD interface.\n", getDriverName(drvId)); + LOG_AUDIO_ERROR("Audio driver '%s' does not provide a CD interface") << getDriverName(drvId); } appendInterface(&pos, AUDIO_ICD, &drivers[drvId].cd); continue; @@ -467,7 +466,7 @@ boolean AudioDriver_Init(void) ok = initDriver(defaultDriverId); if(!ok) { - Con_Message("Warning: Failed initializing audio driver \"%s\"", getDriverName(defaultDriverId)); + LOG_AUDIO_WARNING("Failed initializing audio driver \"%s\"") << getDriverName(defaultDriverId); } // Fallback option for the default driver. diff --git a/doomsday/client/src/audio/audiodriver_music.cpp b/doomsday/client/src/audio/audiodriver_music.cpp index e633f79843..cc6cd0c0c5 100644 --- a/doomsday/client/src/audio/audiodriver_music.cpp +++ b/doomsday/client/src/audio/audiodriver_music.cpp @@ -155,9 +155,9 @@ void AudioDriver_Music_Set(int property, void const *ptr) if(!fn || !fn[0]) return; // No path. if(F_FileExists(fn)) - Con_Message("Current soundfont set to: \"%s\"", fn); + LOG_AUDIO_MSG("Current soundfont set to: \"%s\"") << fn; else - Con_Message("Warning: Soundfont \"%s\" not found.", fn); + LOG_AUDIO_WARNING("Soundfont \"%s\" not found") << fn; } } diff --git a/doomsday/client/src/audio/m_mus2midi.cpp b/doomsday/client/src/audio/m_mus2midi.cpp index fc0e61f39a..8fd2f946a3 100644 --- a/doomsday/client/src/audio/m_mus2midi.cpp +++ b/doomsday/client/src/audio/m_mus2midi.cpp @@ -194,7 +194,9 @@ static boolean getNextEvent(midi_event_t* ev) return false; default: - Con_Error("MUS_SongPlayer: Unknown MUS event %d.\n", evDesc.ev); + LOG_RES_WARNING("Invalid MUS format music data"); + LOGDEV_RES_WARNING("Unknown MUS event %d while converting MUS to MIDI") << evDesc.ev; + return false; } // Choose the channel. @@ -231,6 +233,7 @@ boolean M_Mus2Midi(void* data, size_t length, const char* outFile) FILE* file; DENG_UNUSED(length); + LOG_AS("M_Mus2Midi"); if(!outFile || !outFile[0]) return false; @@ -241,7 +244,7 @@ boolean M_Mus2Midi(void* data, size_t length, const char* outFile) file = fopen(Str_Text(&nativePath), "wb"); if(!file) { - Con_Message("Warning: M_Mus2Midi: Failed opening output file \"%s\".", F_PrettyPath(Str_Text(&nativePath))); + LOG_RES_WARNING("Failed opening output file \"%s\"") << F_PrettyPath(Str_Text(&nativePath)); Str_Free(&nativePath); return false; } diff --git a/doomsday/client/src/audio/s_main.cpp b/doomsday/client/src/audio/s_main.cpp index dd80e97043..cf00e996cb 100644 --- a/doomsday/client/src/audio/s_main.cpp +++ b/doomsday/client/src/audio/s_main.cpp @@ -127,7 +127,7 @@ boolean S_Init(void) // Try to load the audio driver plugin(s). if(!AudioDriver_Init()) { - Con_Message("Music and Sound Effects disabled."); + LOG_AUDIO_NOTE("Music and sound effects are disabled"); return false; } @@ -136,7 +136,7 @@ boolean S_Init(void) if(!sfxOK || !musOK) { - Con_Message("Errors during audio subsystem initialization."); + LOG_AUDIO_NOTE("Errors during audio subsystem initialization"); return false; } #endif @@ -298,12 +298,12 @@ int S_LocalSoundAtVolumeFrom(int soundIdAndFlags, mobj_t *origin, volume <= 0) return false; // This won't play... -#if _DEBUG + LOG_AS("S_LocalSoundAtVolumeFrom"); + if(volume > 1) { - Con_Message("S_LocalSoundAtVolumeFrom: Warning! Too high volume (%f).", volume); + LOGDEV_AUDIO_WARNING("Volume is too high (%f > 1)") << volume; } -#endif // This is the sound we're going to play. if((info = S_GetSoundInfo(soundId, &freq, &volume)) == NULL) @@ -532,7 +532,7 @@ int S_StartMusicNum(int id, boolean looped) if(id < 0 || id >= defs.count.music.num) return false; ded_music_t *def = &defs.music[id]; - LOG_AUDIO_VERBOSE("Starting music '%s'...") << def->id; + LOG_AUDIO_MSG("Starting music '%s'") << def->id; return Mus_Start(def, looped); @@ -612,10 +612,10 @@ D_CMD(PlaySound) if(argc < 2) { - Con_Printf("Usage: %s (id) (volume) at (x) (y) (z)\n", argv[0]); - Con_Printf("(volume) must be in 0..1, but may be omitted.\n"); - Con_Printf("'at (x) (y) (z)' may also be omitted.\n"); - Con_Printf("The sound is always played locally.\n"); + LOG_SCR_MSG("Usage: %s (id) (volume) at (x) (y) (z)") << argv[0]; + LOG_SCR_MSG("(volume) must be in 0..1, but may be omitted."); + LOG_SCR_MSG("'at (x) (y) (z)' may also be omitted."); + LOG_SCR_MSG("The sound is always played locally."); return true; } diff --git a/doomsday/client/src/audio/s_mus.cpp b/doomsday/client/src/audio/s_mus.cpp index 4b4d81af82..951bb0e683 100644 --- a/doomsday/client/src/audio/s_mus.cpp +++ b/doomsday/client/src/audio/s_mus.cpp @@ -318,18 +318,11 @@ int Mus_StartLump(lumpnum_t lump, boolean looped, boolean canPlayMUS) // expected. lumpLength = F_LumpLength(lump); - buf = (uint8_t*) malloc(lumpLength); - if(!buf) - { - Con_Message("Warning: Mus_Start: Failed on allocation of %lu bytes for " - "temporary MUS to MIDI conversion buffer.", (unsigned long) lumpLength); - return 0; - } - + buf = (uint8_t*) M_Malloc(lumpLength); file = F_FindFileForLumpNum2(lump, &lumpIdx); F_ReadLumpSection(file, lumpIdx, buf, 0, lumpLength); M_Mus2Midi((void*)buf, lumpLength, Str_Text(srcFile)); - free(buf); + M_Free(buf); return AudioDriver_Music_PlayNativeFile(Str_Text(srcFile), looped); } @@ -471,24 +464,24 @@ D_CMD(PlayMusic) if(!musAvail) { - Con_Printf("The Music module is not available.\n"); + LOG_SCR_WARNING("Music subsystem is not available"); return false; } switch(argc) { default: - Con_Printf("Usage:\n %s (music-def)\n", argv[0]); - Con_Printf(" %s lump (lumpname)\n", argv[0]); - Con_Printf(" %s file (filename)\n", argv[0]); - Con_Printf(" %s cd (track)\n", argv[0]); + LOG_SCR_MSG("Usage:\n %s (music-def)") << argv[0]; + LOG_SCR_MSG(" %s lump (lumpname)") << argv[0]; + LOG_SCR_MSG(" %s file (filename)") << argv[0]; + LOG_SCR_MSG(" %s cd (track)") << argv[0]; break; case 2: { int musIdx = Def_GetMusicNum(argv[1]); if(musIdx < 0) { - Con_Printf("Music '%s' not defined.\n", argv[1]); + LOG_SCR_WARNING("Music '%s' not defined") << argv[1]; return false; } @@ -515,7 +508,7 @@ D_CMD(PlayMusic) { if(!AudioDriver_CD()) { - Con_Printf("No CD audio interface available.\n"); + LOG_SCR_WARNING("No CD audio interface available"); return false; } diff --git a/doomsday/client/src/audio/s_sfx.cpp b/doomsday/client/src/audio/s_sfx.cpp index d2a95fd0bf..01a19516aa 100644 --- a/doomsday/client/src/audio/s_sfx.cpp +++ b/doomsday/client/src/audio/s_sfx.cpp @@ -657,7 +657,7 @@ int Sfx_StartSound(sfxsample_t *sample, float volume, float freq, mobj_t *emitte { // The new sound can't be played because we were unable to stop // enough channels to accommodate the limitation. - LOG_AUDIO_XVERBOSE("Not playing %i because all channels are busy") + LOG_AUDIO_XVERBOSE("Not playing #%i because all channels are busy") << sample->id; return false; } @@ -1010,7 +1010,9 @@ void Sfx_StartRefresh() // Start the refresh thread. It will run until the Sfx module is shut down. refreshHandle = Sys_StartThread(Sfx_ChannelRefreshThread, NULL); if(!refreshHandle) - Con_Error("Sfx_StartRefresh: Failed to start refresh.\n"); + { + throw de::Error("Sfx_StartRefresh", "Failed to start refresh thread."); + } } else { diff --git a/doomsday/client/src/audio/s_wav.cpp b/doomsday/client/src/audio/s_wav.cpp index 11661dd352..1ded9223dc 100644 --- a/doomsday/client/src/audio/s_wav.cpp +++ b/doomsday/client/src/audio/s_wav.cpp @@ -80,9 +80,11 @@ void* WAV_MemoryLoad(const byte* data, size_t datalength, int* bits, int* rate, chunk_hdr_t riff_chunk; wav_format_t wave_format; + LOG_AS("WAV_MemoryLoad"); + if(!WAV_CheckFormat((const char*)data)) { - Con_Message("WAV_MemoryLoad: Not a WAV file."); + LOG_RES_WARNING("Not WAV format data"); return NULL; } @@ -123,12 +125,12 @@ void* WAV_MemoryLoad(const byte* data, size_t datalength, int* bits, int* rate, // Check that it's a format we know how to read. if(wave_format.wFormatTag != WAVE_FORMAT_PCM) { - Con_Message("WAV_MemoryLoad: Unsupported format (%i).", wave_format.wFormatTag); + LOG_RES_WARNING("Unsupported format (%i)") << wave_format.wFormatTag; return NULL; } if(wave_format.wChannels != 1) { - Con_Message("WAV_MemoryLoad: Too many channels (only mono supported)."); + LOG_RES_WARNING("Too many channels (only mono supported)"); return NULL; } // Read the extra format information. @@ -144,7 +146,7 @@ void* WAV_MemoryLoad(const byte* data, size_t datalength, int* bits, int* rate, if(wave_format.wBitsPerSample != 8 && wave_format.wBitsPerSample != 16) { - Con_Message("WAV_MemoryLoad: Not a 8/16 bit WAVE."); + LOG_RES_WARNING("Must have 8 or 16 bits per sample"); return NULL; } // Now we know some information about the sample. @@ -155,7 +157,7 @@ void* WAV_MemoryLoad(const byte* data, size_t datalength, int* bits, int* rate, { if(!wave_format.wFormatTag) { - Con_Message("WAV_MemoryLoad: Malformed WAVE data."); + LOG_RES_WARNING("Malformed WAV data"); return NULL; } // Read data chunk. diff --git a/doomsday/client/src/audio/sys_audiod_sdlmixer.cpp b/doomsday/client/src/audio/sys_audiod_sdlmixer.cpp index be3726de92..52a8dc3c78 100644 --- a/doomsday/client/src/audio/sys_audiod_sdlmixer.cpp +++ b/doomsday/client/src/audio/sys_audiod_sdlmixer.cpp @@ -136,7 +136,7 @@ static Mix_Music* lastMusic; #if _DEBUG static void musicPlaybackFinished(void) { - Con_Printf("DS_SDLMixer: Music playback finished.\n"); + LOG_AUDIO_VERBOSE("[SDLMixer] Music playback finished"); } #endif @@ -176,7 +176,7 @@ int DS_SDLMixerInit(void) if(SDL_InitSubSystem(SDL_INIT_AUDIO)) { - Con_Message("Warning:DS_SDLMixerInit: Error initializing SDL AUDIO\n %s", SDL_GetError()); + LOG_AUDIO_ERROR("Error initializing SDL audio: %s") << SDL_GetError(); return false; } @@ -186,27 +186,29 @@ int DS_SDLMixerInit(void) if(SDL_VERSIONNUM(linkVer->major, linkVer->minor, linkVer->patch) > SDL_VERSIONNUM(compVer.major, compVer.minor, compVer.patch)) { - Con_Message("Warning:DS_SDLMixerInit: Linked version of SDLMixer (%u.%u.%u) is " - "newer than expected (%u.%u.%u)", linkVer->major, linkVer->minor, - linkVer->patch, compVer.major, compVer.minor, compVer.patch); + LOG_AUDIO_WARNING("Linked version of SDL_mixer (%u.%u.%u) is " + "newer than expected (%u.%u.%u)", linkVer->major, linkVer->minor, + linkVer->patch, compVer.major, compVer.minor, compVer.patch); } if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024)) { - Con_Message("Warning:DS_SDLMixerInit: Failed opening mixer %s.", Mix_GetError()); + LOG_AUDIO_ERROR("Failed initializing SDL_mixer: %s") << Mix_GetError(); return false; } Mix_QuerySpec(&freq, &format, &channels); - if(verbose) - { // Announce capabilites. - Con_Printf("SDLMixer configuration:\n"); - Con_Printf(" Output: %s\n", channels > 1? "stereo" : "mono"); - Con_Printf(" Format: %#x (%#x)\n", format, (uint16_t) AUDIO_S16LSB); - Con_Printf(" Frequency: %iHz (%iHz)\n", freq, (int) MIX_DEFAULT_FREQUENCY); - Con_Printf(" Initial Channels: %i\n", MIX_CHANNELS); - } + // Announce capabilites. + LOG_AUDIO_VERBOSE("SDLMixer configuration:"); + LOG_AUDIO_VERBOSE(" " _E(>) "Output: %s\n" + "Format: %#x (%#x)\n" + "Frequency: %iHz (%iHz)" + "Initial Channels: %i") + << (channels > 1? "stereo" : "mono") + << format << (uint16_t) AUDIO_S16LSB + << freq << (int) MIX_DEFAULT_FREQUENCY + << MIX_CHANNELS; // Prepare to play simultaneous sounds. /*numChannels =*/ Mix_AllocateChannels(MIX_CHANNELS); @@ -351,8 +353,8 @@ void DS_SDLMixer_SFX_Load(sfxbuffer_t* buf, struct sfxsample_s* sample) buf->ptr = Mix_LoadWAV_RW(SDL_RWFromMem(conv, 44 + sample->size), 1); if(!buf->ptr) { - Con_Message("DS_SDLMixer_SFX_Load: Warning, failed loading sample (%s).", - Mix_GetError()); + LOG_AS("DS_SDLMixer_SFX_Load"); + LOG_AUDIO_WARNING("Failed loading sample: %s") << Mix_GetError(); } if(conv != localBuf) @@ -557,7 +559,8 @@ int DS_SDLMixer_Music_PlayFile(const char* filename, int looped) if(!(lastMusic = Mix_LoadMUS(filename))) { - Con_Message("DS_SDLMixer_Music_PlayFile: Error %s.", Mix_GetError()); + LOG_AS("DS_SDLMixer_Music_PlayFile"); + LOG_AUDIO_ERROR("Failed to load music: %s") << Mix_GetError(); return false; } diff --git a/doomsday/libdeng2/include/de/c_wrapper.h b/doomsday/libdeng2/include/de/c_wrapper.h index a488be2685..63cbb4d480 100644 --- a/doomsday/libdeng2/include/de/c_wrapper.h +++ b/doomsday/libdeng2/include/de/c_wrapper.h @@ -87,12 +87,12 @@ typedef enum logentry_level_e { typedef enum logentry_audience_e { DE2_LOG_GENERIC = 0x10000, DE2_LOG_RES = 0x20000, - DE2_LOG_MAP = 0x40000, ///< Map developer - DE2_LOG_SCR = 0x80000, ///< Script developer + DE2_LOG_MAP = 0x40000, ///< Map developer + DE2_LOG_SCR = 0x80000, ///< Script developer DE2_LOG_GL = 0x100000, ///< GL domain (shaders, etc.) - DE2_LOG_AUDIO = 0x200000, ///< Audio domain - DE2_LOG_INPUT = 0x400000, ///< Input domain - DE2_LOG_NET = 0x800000, ///< Network domain + DE2_LOG_AUDIO = 0x200000, ///< Audio domain + DE2_LOG_INPUT = 0x400000, ///< Input domain + DE2_LOG_NET = 0x800000, ///< Network domain DE2_LOG_DEV = 0x8000000 ///< Native code developer (i.e., the programmer) } logentry_audience_t; diff --git a/doomsday/libdeng2/src/c_wrapper.cpp b/doomsday/libdeng2/src/c_wrapper.cpp index be91170b23..eae889e2e8 100644 --- a/doomsday/libdeng2/src/c_wrapper.cpp +++ b/doomsday/libdeng2/src/c_wrapper.cpp @@ -156,16 +156,17 @@ void LogBuffer_Printf(unsigned int metadata, char const *format, ...) metadata |= de::LogEntry::Generic; } - // If this level is not enabled, just ignore. - if(!de::LogBuffer::appBuffer().isEnabled(metadata)) return; - // Validate the level. de::LogEntry::Level logLevel = de::LogEntry::Level(metadata & de::LogEntry::LevelMask); if(logLevel < de::LogEntry::XVerbose || logLevel > de::LogEntry::Critical) { - logLevel = de::LogEntry::Message; + metadata &= ~de::LogEntry::LevelMask; + metadata |= (logLevel = de::LogEntry::Message); } + // If this level is not enabled, just ignore. + if(!de::LogBuffer::appBuffer().isEnabled(metadata)) return; + char buffer[2048]; va_list args; va_start(args, format); diff --git a/doomsday/plugins/example/src/example.c b/doomsday/plugins/example/src/example.c index f7a4ce37a4..f49e6afebe 100644 --- a/doomsday/plugins/example/src/example.c +++ b/doomsday/plugins/example/src/example.c @@ -18,6 +18,7 @@ */ #include +#include // libdeng2 C API #include "version.h" /* @@ -45,7 +46,7 @@ static int ExampleHook(int hookType, int parm, void *data) DENG_UNUSED(parm); DENG_UNUSED(data); - Con_Message("ExampleHook: Hook successful!"); + LogBuffer_Printf(DE2_LOG_DEV, "ExampleHook: Hook successful!\n"); return true; } diff --git a/doomsday/plugins/fluidsynth/include/driver_fluidsynth.h b/doomsday/plugins/fluidsynth/include/driver_fluidsynth.h index 7fdddcfcf2..172510133d 100644 --- a/doomsday/plugins/fluidsynth/include/driver_fluidsynth.h +++ b/doomsday/plugins/fluidsynth/include/driver_fluidsynth.h @@ -50,7 +50,7 @@ audiointerface_sfx_generic_t* DMFluid_Sfx(); #define MAX_SYNTH_GAIN 0.4 -#define DSFLUIDSYNTH_TRACE(args) LOGDEV_AUDIO_XVERBOSE("[dsFluidSynth] ") << args +#define DSFLUIDSYNTH_TRACE(args) LOGDEV_AUDIO_XVERBOSE("[FluidSynth] ") << args #include "fluidsynth_music.h" diff --git a/doomsday/plugins/fmod/include/driver_fmod.h b/doomsday/plugins/fmod/include/driver_fmod.h index 5c28747698..d58cf5598e 100644 --- a/doomsday/plugins/fmod/include/driver_fmod.h +++ b/doomsday/plugins/fmod/include/driver_fmod.h @@ -65,11 +65,11 @@ int DS_Set(int prop, const void* ptr); } -#define DSFMOD_TRACE(args) LOGDEV_AUDIO_XVERBOSE("[dsFMOD] ") << args +#define DSFMOD_TRACE(args) LOGDEV_AUDIO_XVERBOSE("[FMOD] ") << args #define DSFMOD_ERRCHECK(result) \ if(result != FMOD_OK) { \ - LOGDEV_AUDIO_WARNING("[dsFMOD] Error at %s, line %i: (%d) %s") << __FILE__ << __LINE__ << result << FMOD_ErrorString(result); \ + LOGDEV_AUDIO_WARNING("[FMOD] Error at %s, line %i: (%d) %s") << __FILE__ << __LINE__ << result << FMOD_ErrorString(result); \ } extern FMOD::System* fmodSystem; diff --git a/doomsday/plugins/fmod/src/driver_fmod.cpp b/doomsday/plugins/fmod/src/driver_fmod.cpp index 7cd1098c64..091cfa5490 100644 --- a/doomsday/plugins/fmod/src/driver_fmod.cpp +++ b/doomsday/plugins/fmod/src/driver_fmod.cpp @@ -66,7 +66,7 @@ int DS_Init(void) FMOD_RESULT result; if((result = FMOD::System_Create(&fmodSystem)) != FMOD_OK) { - Con_Message("FMOD::System_Create failed: (%d) %s", result, FMOD_ErrorString(result)); + LOGDEV_AUDIO_ERROR("FMOD::System_Create failed (%d) %s") << result << FMOD_ErrorString(result); fmodSystem = 0; return false; } @@ -98,7 +98,7 @@ int DS_Init(void) // Initialize FMOD. if((result = fmodSystem->init(50, FMOD_INIT_NORMAL | FMOD_INIT_3D_RIGHTHANDED | FMOD_INIT_HRTF_LOWPASS, 0)) != FMOD_OK) { - Con_Message("FMOD init failed: (%d) %s", result, FMOD_ErrorString(result)); + LOGDEV_AUDIO_ERROR("FMOD init failed: (%d) %s") << result << FMOD_ErrorString(result); fmodSystem->release(); fmodSystem = 0; return false; @@ -132,7 +132,7 @@ int DS_Init(void) #endif // Print the credit required by FMOD license. - Con_Message("FMOD Sound System (c) Firelight Technologies Pty, Ltd., 1994-2013."); + LOG_AUDIO_NOTE("FMOD Sound System (c) Firelight Technologies Pty, Ltd., 1994-2013"); DSFMOD_TRACE("DS_Init: FMOD initialized."); return true;