void SF2Sound::loadRegions() { SF2Reader reader(this, file); reader.read(); // Sort the presets. PresetComparator comparator; presets.sort(comparator); useSubsound(0); }
void sfzero::SFZeroAudioProcessor::setStateInformation(const void *data, int sizeInBytes) { MemoryInputStream in(data, sizeInBytes, false); var state = JSON::parse(in); var pathVar = state["sfzFilePath"]; if (pathVar.isString()) { auto sfzFilePath = pathVar.toString(); if (!sfzFilePath.isEmpty()) { File file(sfzFilePath); setSfzFile(&file); auto sound = getSound(); if (sound) { var subsoundVar = state["subsound"]; if (subsoundVar.isInt()) sound->useSubsound(int(subsoundVar)); } } } }