Build rest of sound sheets

hg/develop
kaetemi 5 years ago committed by Jan Boon
parent 255c6956c7
commit c15e75ecc8

@ -189,7 +189,7 @@ public:
const std::vector<std::pair<NLMISC::CVector, NLMISC::CVector> > &getAudioPath() { return _AudioPath;} const std::vector<std::pair<NLMISC::CVector, NLMISC::CVector> > &getAudioPath() { return _AudioPath;}
static void buildSheets(const std::string &packedSheetPath);
private: private:

@ -169,6 +169,10 @@ public:
static std::string buildSampleBank(const std::vector<std::string> &sampleList, const std::string &bankDir, const std::string &bankName); static std::string buildSampleBank(const std::vector<std::string> &sampleList, const std::string &bankDir, const std::string &bankName);
/// Build the sound bank packed sheets file from georges sound sheet files with .sound extension in the search path, and return the path to the written file. /// Build the sound bank packed sheets file from georges sound sheet files with .sound extension in the search path, and return the path to the written file.
static std::string buildSoundBank(const std::string &packedSheetDir); static std::string buildSoundBank(const std::string &packedSheetDir);
/// Build the cluster sound_group sheets.
static std::string buildClusteredSoundGroupSheets(const std::string &packedSheetDir);
/// Build the user var binding sheets.
static std::string buildUserVarBindingSheets(const std::string &packedSheetDir);
/** Set the global path to the sample banks /** Set the global path to the sample banks
* If you have specified some sample bank to load in the * If you have specified some sample bank to load in the
* mixer config file, you MUST set the sample path * mixer config file, you MUST set the sample path

@ -988,6 +988,23 @@ std::string UAudioMixer::buildSoundBank(const std::string &packedSheetDir)
return dir + "sounds.packed_sheets"; return dir + "sounds.packed_sheets";
} }
/// Build the cluster sound_group sheets.
std::string UAudioMixer::buildClusteredSoundGroupSheets(const std::string &packedSheetDir)
{
std::string dir = CPath::standardizePath(packedSheetDir, true);
CClusteredSound::buildSheets(dir);
return dir + "sound_groups.packed_sheets";
}
/// Build the user var binding sheets.
std::string UAudioMixer::buildUserVarBindingSheets(const std::string &packedSheetDir)
{
std::string dir = CPath::standardizePath(packedSheetDir, true);
std::map<std::string, CUserVarSerializer> container;
::loadForm("user_var_binding", dir + "user_var_binding.packed_sheets", container, true, false);
return dir + "user_var_binding.packed_sheets";
}
void CAudioMixerUser::setBackgroundFlagName(uint flagIndex, const std::string &flagName) void CAudioMixerUser::setBackgroundFlagName(uint flagIndex, const std::string &flagName)
{ {
if (flagIndex < TBackgroundFlags::NB_BACKGROUND_FLAGS) if (flagIndex < TBackgroundFlags::NB_BACKGROUND_FLAGS)

@ -160,10 +160,6 @@ public:
}; };
// this structure is fill by the loadForm() function and will contain all you need
std::map<std::string, CSoundGroupSerializer> Container;
CClusteredSound::CClusteredSound() CClusteredSound::CClusteredSound()
: _Scene(0), : _Scene(0),
_RootCluster(0), _RootCluster(0),
@ -173,21 +169,27 @@ CClusteredSound::CClusteredSound()
} }
void CClusteredSound::buildSheets(const std::string &packedSheetPath)
{
std::map<std::string, CSoundGroupSerializer> container;
::loadForm("sound_group", packedSheetPath + "sound_groups.packed_sheets", container, true, false);
}
void CClusteredSound::init(NL3D::CScene *scene, float portalInterpolate, float maxEarDist, float minGain) void CClusteredSound::init(NL3D::CScene *scene, float portalInterpolate, float maxEarDist, float minGain)
{ {
// load the sound_group sheets // load the sound_group sheets
::loadForm("sound_group", CAudioMixerUser::instance()->getPackedSheetPath()+"sound_groups.packed_sheets", Container, CAudioMixerUser::instance()->getPackedSheetUpdate(), false); std::map<std::string, CSoundGroupSerializer> container;
::loadForm("sound_group", CAudioMixerUser::instance()->getPackedSheetPath()+"sound_groups.packed_sheets", container, CAudioMixerUser::instance()->getPackedSheetUpdate(), false);
// copy the container data into internal structure // copy the container data into internal structure
std::map<std::string, CSoundGroupSerializer>::iterator first(Container.begin()), last(Container.end()); std::map<std::string, CSoundGroupSerializer>::iterator first(container.begin()), last(container.end());
for (; first != last; ++first) for (; first != last; ++first)
{ {
_SoundGroupToSound.insert(first->second._SoundGroupAssoc.begin(), first->second._SoundGroupAssoc.end()); _SoundGroupToSound.insert(first->second._SoundGroupAssoc.begin(), first->second._SoundGroupAssoc.end());
} }
// and clear the temporary Container // and clear the temporary Container
Container.clear(); container.clear();
_Scene = scene; _Scene = scene;

@ -88,6 +88,8 @@ int main(int nNbArg, char **ppArgs)
// build the sound bank // build the sound bank
UAudioMixer::buildSoundBank(exportDir); UAudioMixer::buildSoundBank(exportDir);
UAudioMixer::buildClusteredSoundGroupSheets(exportDir);
UAudioMixer::buildUserVarBindingSheets(exportDir);
// and that's all folks // and that's all folks
return EXIT_SUCCESS; return EXIT_SUCCESS;

Loading…
Cancel
Save