MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / LoadFile

Method LoadFile

Source/SamplePlayer.cpp:744–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744void SamplePlayer::LoadFile()
745{
746 auto file_pattern = TheSynth->GetAudioFormatManager().getWildcardForAllFormats();
747 if (File::areFileNamesCaseSensitive())
748 file_pattern += ";" + file_pattern.toUpperCase();
749 FileChooser chooser("Load sample", File(ofToSamplePath("")),
750 file_pattern, true, false, TheSynth->GetFileChooserParent());
751 if (chooser.browseForFileToOpen())
752 {
753 auto file = chooser.getResult();
754
755 Sample* sample = new Sample();
756 if (file.existsAsFile())
757 sample->Read(file.getFullPathName().toStdString().c_str());
758 UpdateSample(sample, true);
759 }
760}
761
762void SamplePlayer::SaveFile()
763{

Callers

nothing calls this directly

Calls 3

ofToSamplePathFunction · 0.85
GetFileChooserParentMethod · 0.80
ReadMethod · 0.45

Tested by

no test coverage detected