More unicode fixes.

Fixed more unicode stuff I missed the first time around.
This commit is contained in:
John Norman 2012-07-04 11:27:58 -07:00
parent 6e02974b10
commit 3397d41ba8
2 changed files with 18 additions and 18 deletions

View File

@ -240,15 +240,15 @@ namespace cAudio
audioIndex[audioName] = audio; audioIndex[audioName] = audio;
audioSources.push_back(audio); audioSources.push_back(audio);
getLogger()->logInfo("AudioManager", "Audio Source (%s) created from Data Source %s.", audioName.c_str(), dataSource.c_str()); getLogger()->logInfo("AudioManager", "Audio Source (%s) created from Data Source %s.", toUTF8(audioName), toUTF8(dataSource));
return audio; return audio;
} }
getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Error creating audio source.", audioName.c_str()); getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Error creating audio source.", toUTF8(audioName));
audio->drop(); audio->drop();
return NULL; return NULL;
} }
getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Audio data could not be decoded by (.%s) decoder.", audioName.c_str(), decoder->getType().c_str()); getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Audio data could not be decoded by (.%s) decoder.", toUTF8(audioName), toUTF8(decoder->getType()));
decoder->drop(); decoder->drop();
return NULL; return NULL;
} }
@ -264,7 +264,7 @@ namespace cAudio
IAudioDecoderFactory* factory = getAudioDecoderFactory(toUTF8(ext)); IAudioDecoderFactory* factory = getAudioDecoderFactory(toUTF8(ext));
if(!factory) { if(!factory) {
getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): No decoder could be found for (.%s).", audioName.c_str(), ext.c_str()); getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): No decoder could be found for (.%s).", toUTF8(audioName), toUTF8(ext));
return NULL; return NULL;
} }
@ -304,7 +304,7 @@ namespace cAudio
IAudioDecoderFactory* factory = getAudioDecoderFactory(toUTF8(ext)); IAudioDecoderFactory* factory = getAudioDecoderFactory(toUTF8(ext));
if(!factory) { if(!factory) {
getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Codec (.%s) is not supported.", audioName.c_str(), ext.c_str()); getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Codec (.%s) is not supported.", toUTF8(audioName), toUTF8(ext));
return NULL; return NULL;
} }
@ -338,7 +338,7 @@ namespace cAudio
IAudioDecoderFactory* factory = getAudioDecoderFactory("raw"); IAudioDecoderFactory* factory = getAudioDecoderFactory("raw");
if(!factory) { if(!factory) {
getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Codec (.raw) is not supported.", audioName.c_str()); getLogger()->logError("AudioManager", "Failed to create Audio Source (%s): Codec (.raw) is not supported.", toUTF8(audioName));
return NULL; return NULL;
} }
@ -363,7 +363,7 @@ namespace cAudio
cAudioMutexBasicLock lock(Mutex); cAudioMutexBasicLock lock(Mutex);
cAudioString ext = fromUTF8(extension); cAudioString ext = fromUTF8(extension);
decodermap[ext] = factory; decodermap[ext] = factory;
getLogger()->logInfo("AudioManager", "Audio Decoder for extension .%s registered.", ext.c_str()); getLogger()->logInfo("AudioManager", "Audio Decoder for extension .%s registered.", toUTF8(ext));
return true; return true;
} }
@ -375,7 +375,7 @@ namespace cAudio
if(it != decodermap.end()) if(it != decodermap.end())
{ {
decodermap.erase(it); decodermap.erase(it);
getLogger()->logInfo("AudioManager", "Audio Decoder for extension .%s unregistered.", ext.c_str()); getLogger()->logInfo("AudioManager", "Audio Decoder for extension .%s unregistered.", toUTF8(ext));
} }
} }
@ -418,7 +418,7 @@ namespace cAudio
dataSourcePriorityList.push_back(std::pair<int, cAudioString>(priority, safeName)); dataSourcePriorityList.push_back(std::pair<int, cAudioString>(priority, safeName));
std::sort(dataSourcePriorityList.begin(), dataSourcePriorityList.end(), compareDataSourcePriorities); std::sort(dataSourcePriorityList.begin(), dataSourcePriorityList.end(), compareDataSourcePriorities);
getLogger()->logInfo("AudioManager", "Data Source named %s registered (Priority %i).", safeName.c_str(), priority); getLogger()->logInfo("AudioManager", "Data Source named %s registered (Priority %i).", toUTF8(safeName), priority);
return true; return true;
} }
@ -430,7 +430,7 @@ namespace cAudio
if(it != datasourcemap.end()) if(it != datasourcemap.end())
{ {
datasourcemap.erase(it); datasourcemap.erase(it);
getLogger()->logInfo("AudioManager", "Data Source named %s unregistered.", safeName.c_str()); getLogger()->logInfo("AudioManager", "Data Source named %s unregistered.", toUTF8(safeName));
} }
for(size_t i=0; i<dataSourcePriorityList.size(); ++i) for(size_t i=0; i<dataSourcePriorityList.size(); ++i)

View File

@ -29,7 +29,7 @@ namespace cAudio
it->first->drop(); it->first->drop();
if(DYNLIB_UNLOAD(it->second)) if(DYNLIB_UNLOAD(it->second))
{ {
getLogger()->logError("cPluginManager", "Plugin Error: %s.", getError().c_str()); getLogger()->logError("cPluginManager", "Plugin Error: %s.", toUTF8(getError()));
} }
} }
} }
@ -38,7 +38,7 @@ namespace cAudio
{ {
if(plugin) if(plugin)
{ {
cAudioString theName = safeCStr(name); cAudioString theName = fromUTF8(name);
if(theName.empty()) if(theName.empty())
theName = plugin->getPluginName(); theName = plugin->getPluginName();
@ -70,7 +70,7 @@ namespace cAudio
} }
} }
else else
getLogger()->logError("cPluginManager", "installPlugin Error: %s.", getError().c_str()); getLogger()->logError("cPluginManager", "installPlugin Error: %s.", toUTF8(getError()));
} }
return false; return false;
} }
@ -126,7 +126,7 @@ namespace cAudio
it2->first->drop(); it2->first->drop();
if(DYNLIB_UNLOAD(it2->second)) if(DYNLIB_UNLOAD(it2->second))
{ {
getLogger()->logError("cPluginManager", "Plugin Error: %s.", getError().c_str()); getLogger()->logError("cPluginManager", "Plugin Error: %s.", fromUTF8(getError()));
} }
DynamicallyLoadedPlugins.erase(it2->first); DynamicallyLoadedPlugins.erase(it2->first);
} }
@ -146,10 +146,10 @@ namespace cAudio
cAudioVector<cAudioString>::Type fileList = getFilesInDirectory("."); cAudioVector<cAudioString>::Type fileList = getFilesInDirectory(".");
for(size_t i=0; i<fileList.size(); ++i) for(size_t i=0; i<fileList.size(); ++i)
{ {
if(fileList[i].substr(0, 4) == "cAp_") if(fileList[i].substr(0, 4) == _CTEXT("cAp_"))
{ {
#ifdef CAUDIO_PLATFORM_WIN #ifdef CAUDIO_PLATFORM_WIN
if(fileList[i].substr(fileList[i].length()-4, 4) == ".dll") if(fileList[i].substr(fileList[i].length()-4, 4) == _CTEXT(".dll"))
#elif defined(CAUDIO_PLATFORM_LINUX) #elif defined(CAUDIO_PLATFORM_LINUX)
if(fileList[i].substr(fileList[i].length()-3, 3) == ".so") if(fileList[i].substr(fileList[i].length()-3, 3) == ".so")
#elif defined(CAUDIO_PLATFORM_MAC) #elif defined(CAUDIO_PLATFORM_MAC)
@ -157,7 +157,7 @@ namespace cAudio
#endif #endif
{ {
//Found a plugin, load it //Found a plugin, load it
installPlugin(cAudioString("./" + fileList[i]).c_str(), NULL); installPlugin(toUTF8(cAudioString(_CTEXT("./") + fileList[i])), NULL);
} }
} }
} }
@ -179,7 +179,7 @@ namespace cAudio
NULL NULL
); );
cAudioString ret = (char*)lpMsgBuf; cAudioString ret = fromUTF8((char*)lpMsgBuf);
// remove line break // remove line break
ret = ret.substr(0, ret.length()-2); ret = ret.substr(0, ret.length()-2);
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);