safety checks
This commit is contained in:
parent
2fd4e51cd0
commit
0890bd8d3f
|
@ -422,7 +422,12 @@ namespace SHADE
|
||||||
if(auto it = eventMap.find(path); it != eventMap.end())
|
if(auto it = eventMap.find(path); it != eventMap.end())
|
||||||
{
|
{
|
||||||
audioClipHandle = audioClipLibrary.Create();
|
audioClipHandle = audioClipLibrary.Create();
|
||||||
it->second->createInstance(&audioClipHandle->instance);
|
result = it->second->createInstance(&audioClipHandle->instance);
|
||||||
|
if(result != FMOD_OK)
|
||||||
|
{
|
||||||
|
SHLOG_ERROR("Failed to create AudioClip with path {}", path)
|
||||||
|
ErrorCheck();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -681,6 +686,7 @@ namespace SHADE
|
||||||
result = fmodStudioSystem->getParameterByName(path, &value);
|
result = fmodStudioSystem->getParameterByName(path, &value);
|
||||||
if(result != FMOD_OK)
|
if(result != FMOD_OK)
|
||||||
{
|
{
|
||||||
|
SHLOG_ERROR("AudioSys_GetParam");
|
||||||
ErrorCheck();
|
ErrorCheck();
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
@ -691,6 +697,7 @@ namespace SHADE
|
||||||
result = fmodStudioSystem->setParameterByName(path, value);
|
result = fmodStudioSystem->setParameterByName(path, value);
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
|
SHLOG_ERROR("AudioSys_SetParam");
|
||||||
ErrorCheck();
|
ErrorCheck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -700,6 +707,7 @@ namespace SHADE
|
||||||
result = fmodStudioSystem->setParameterByNameWithLabel(path, label);
|
result = fmodStudioSystem->setParameterByNameWithLabel(path, label);
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
|
SHLOG_ERROR("AudioSys_SetParamWithLabel");
|
||||||
ErrorCheck();
|
ErrorCheck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -708,9 +716,12 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
if(!instance)
|
if(!instance)
|
||||||
return;
|
return;
|
||||||
|
if(!instance->isValid())
|
||||||
|
return;
|
||||||
FMOD_RESULT result = instance->start();
|
FMOD_RESULT result = instance->start();
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
|
SHLOG_ERROR("AudioClip_Play");
|
||||||
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -746,9 +757,12 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
if (!instance)
|
if (!instance)
|
||||||
return;
|
return;
|
||||||
|
if(!instance->isValid())
|
||||||
|
return;
|
||||||
FMOD_RESULT result = instance->stop(fadeOut ? FMOD_STUDIO_STOP_ALLOWFADEOUT : FMOD_STUDIO_STOP_IMMEDIATE);
|
FMOD_RESULT result = instance->stop(fadeOut ? FMOD_STUDIO_STOP_ALLOWFADEOUT : FMOD_STUDIO_STOP_IMMEDIATE);
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
|
SHLOG_ERROR("AudioClip_Stop");
|
||||||
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -778,7 +792,7 @@ namespace SHADE
|
||||||
FMOD_RESULT result = instance->setParameterByName(paramName, value);
|
FMOD_RESULT result = instance->setParameterByName(paramName, value);
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
SHLOG_ERROR("AudioClip::Play error: {}", FMOD_ErrorString(result))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -789,7 +803,7 @@ namespace SHADE
|
||||||
FMOD_RESULT result = instance->setParameterByNameWithLabel(paramName, label);
|
FMOD_RESULT result = instance->setParameterByNameWithLabel(paramName, label);
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
SHLOG_ERROR("AudioClip::SetParamWithLabel error: {}", FMOD_ErrorString(result))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,7 +815,7 @@ namespace SHADE
|
||||||
auto result = instance->getParameterByName(paramName, &value);
|
auto result = instance->getParameterByName(paramName, &value);
|
||||||
if (result != FMOD_OK)
|
if (result != FMOD_OK)
|
||||||
{
|
{
|
||||||
SHLOG_ERROR("Audio system error: {}", FMOD_ErrorString(result))
|
SHLOG_ERROR("AudioClip::GetParam error: {}", FMOD_ErrorString(result))
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue