MCPcopy Create free account
hub / github.com/Tracktion/tracktion_engine / browseForAudioFile

Function browseForAudioFile

examples/common/Utilities.h:118–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 }
117
118 inline void browseForAudioFile (te::Engine& engine, std::function<void (const File&)> fileChosenCallback)
119 {
120 auto fc = std::make_shared<FileChooser> ("Please select an audio file to load...",
121 engine.getPropertyStorage().getDefaultLoadSaveDirectory ("pitchAndTimeExample"),
122 engine.getAudioFileFormatManager().readFormatManager.getWildcardForAllFormats());
123
124 fc->launchAsync (FileBrowserComponent::openMode + FileBrowserComponent::canSelectFiles,
125 [fc, &engine, callback = std::move (fileChosenCallback)] (const FileChooser&)
126 {
127 const auto f = fc->getResult();
128
129 if (f.existsAsFile())
130 engine.getPropertyStorage().setDefaultLoadSaveDirectory ("pitchAndTimeExample", f.getParentDirectory());
131
132 callback (f);
133 });
134 }
135
136 inline void removeAllClips (te::AudioTrack& track)
137 {

Callers 3

PitchAndTimeComponentMethod · 0.85

Calls 3

getResultMethod · 0.80

Tested by

no test coverage detected