Im scripting a basic wrapper of FMOD for my game engine. Right now I only have Master.bank and Master.strings.bank and I can load both of them in and store them in a map.
What I want to be able to do now is to retrieve Event Description to retrieve the name of all event in a Bank to create a look-up table for easy access to work with tool programmer so that they can create a drop down of all available event name. How should I approach this?
Do I also have to copy the meta data folder to my game engine content?
Here are some screenshots of my code atm
void SoundEngine::LoadBank(const std::string& aBankFileName)
{
//If sound is already exist in mySounds map then dont need to add it in again just return
const auto bankExisted = myFMOD->myBanks.find(aBankFileName);
if(bankExisted != myFMOD->myBanks.end())
{
return;
}
std::string path = AddExtensionIfMissing(aBankFileName, ".bank");
path = GetValidPath(aBankFileName, GetBankPath());
if(path.empty())
{
SoundLogger.Warn("Can not find path " + path);
}
FMOD::Studio::Bank* bank = nullptr;
myFMOD->ErrorCheckWithMessage(myFMOD->myStudioSystem->loadBankFile(path.c_str(), FMOD_STUDIO_LOAD_BANK_NORMAL, &bank), "Can not load in bank " + aBankFileName);
if(bank)
{
myFMOD->myBanks.emplace(aBankFileName, bank);
}
//Check for loading state of a bank then log it out
FMOD_STUDIO_LOADING_STATE loadingState = FMOD_STUDIO_LOADING_STATE_UNLOADED;
myFMOD->ErrorCheckWithMessage(myFMOD->myBanks.at(aBankFileName)->getLoadingState(&loadingState), "Can not get loading state of bank " + aBankFileName);
if(loadingState == FMOD_STUDIO_LOADING_STATE_LOADED)
{
SoundLogger.Succ(aBankFileName + " finished loading in and can now be use");
}
}
void SoundEngine::GetEventList(const std::string& aBankName)
{
const auto bankExisted = myFMOD->myBanks.find(aBankName);
if(bankExisted == myFMOD->myBanks.end())
{
SoundLogger.Warn("There is no bank in bank map recheck the name or you forgot to load in bank, bank name is: " + aBankName);
return;
}
int eventCount = 0;
myFMOD->WarningCheckWithMessage(bankExisted->second->getEventCount(&eventCount), "Can not get event count for bank " + aBankName);
myEventDesList.resize(eventCount);
myFMOD->ErrorCheckWithMessage(bankExisted->second->getEventList(myEventDesList.data(), static_cast<int>(myEventDesList.size()), &eventCount), "Can not get event list from bank " + aBankName);
for(auto& eventDesc : myEventDesList)
{
}
}