Hi team,
I’m working on building a FMOD API framework for C++ and I found a helpful tutorial to get started, but it appears in recent FMOD updates, there have been certain functions removed/changed. For reference, the tutorial was from 2016 and I’m using FMOD 2.02.25.
I attempted to fix using the FMOD API release notes, but was unsuccessful. Could someone with a more seasoned eye help me debug/explain what I did wrong in these two parameter-related functions please?
void CAudioEngine::GetEventParameter(const string& strEventName, const string& strParameterName, float* parameter) {
auto tFoundIt = sgpImplementation->mEvents.find(strEventName);
if (tFoundIt == sgpImplementation->mEvents.end())
return;
FMOD::Studio::EventInstance* pParameter = NULL;
CAudioEngine::ErrorCheck(tFoundIt->second->getParameterByName(strParameterName.c_str(), &pParameter));
CAudioEngine::ErrorCheck(pParameter->getParameterByName(parameter));
}
void CAudioEngine::SetEventParameter(const string& strEventName, const string& strParameterName, float fValue) {
auto tFoundIt = sgpImplementation->mEvents.find(strEventName);
if (tFoundIt == sgpImplementation->mEvents.end())
return;
FMOD::Studio::EventInstance* pParameter = NULL;
CAudioEngine::ErrorCheck(tFoundIt->second->getParameterByName(strParameterName.c_str(), &pParameter));
CAudioEngine::ErrorCheck(pParameter->setParameterByName(fValue));
}
Attaching error list as well.
Thank you!
Brandon