예제 #1
0
파일: SF2Sound.cpp 프로젝트: UIKit0/SFZero
void SF2Sound::loadRegions()
{
	SF2Reader reader(this, file);
	reader.read();

	// Sort the presets.
	PresetComparator comparator;
	presets.sort(comparator);

	useSubsound(0);
}
예제 #2
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));
      }
    }
  }
}