//CONSTRUCTOR KitList::KitList(std::string path) { boost::filesystem::directory_iterator it (path); for(it; it != boost::filesystem::directory_iterator(); ++it) { Kit tempKit = Kit(it->path().generic_string()); this->kits.insert(make_pair(tempKit.getKitNo(), tempKit)); } }
void Module::LoadKits() { // Clear kits list kits.clear(); // Get all kits locations std::vector<std::string> kitsPaths = kitManager.GetKitsLocations(); std::transform(kitsPaths.cbegin(), kitsPaths.cend(), std::back_inserter(kits), [this](std::string const& kitPath) { KitParameters kitParams; KitManager::LoadKit(kitPath, kitParams); return Kit(kitParams, this->triggers, this->soundBank); }); return; }
//The function addKit() creates a kit object in the kits map with the passed name. void KitList::addKit(std::string kitNo) { Kit tempKit = Kit(); tempKit.setKitNo(kitNo); this->kits.insert(std::pair<std::string, Kit>(kitNo, tempKit)); }