I’m working on a port to AUv3 and it still has a few problems. One of them is the file chooser.
In the AUv3 version on Mac and iOS it dosen’t work at all. And on the standalone-app on iOS it opens a file chooser, but I can’t load files and if I creat and save a file it’s empty. Maybe it has to that it’s not implemented in an async way?
The gotchas I had when upgrading my plugins to JUCE 6.1 (not for AUv3):
FileChooser must not be stack allocated, else it will go out of scope and then “To abort the file selection, simply delete the FileChooser object.” comes into play.
Thanks for your response, but I still have a few problems implementing it.
This is what I came up with so far
auto presetManager = processor->getPresetManager();
String currentPresetPath = presetManager->getCurrentPresetDirectory() + directorySeparator + presetManager->getCurrentPresetName();
std::unique_ptr<FileChooser> myChooser;
myChooser = std::make_unique<FileChooser> ("Please select the moose you want to save...",
File (currentPresetPath),
presetFileExtensionWildcard);
auto folderChooserFlags = FileBrowserComponent::saveMode; // | FileBrowserComponent::warnAboutOverwriting;
myChooser->launchAsync (folderChooserFlags, [this] (const FileChooser& chooser)
{
presetManager->savePreset (chooser.getResult());
updatePresetComboBox();
});
But I’m getting an error for “presetManager->savePreset (chooser.getResult());”
“Variable ‘presetManager’ cannot be implicitly captured in a lambda with no capture-default specified”
or by moving copying auto presetManager = processor->getPresetManager(); into the lambda. (I hadn’t noticed you use presetManager on the very next line! )
So I got the filechooser running on the standalone app, but it won’t open or save files outside the appfolder and the AUv3 (mac and iOS) dosen’t open or save files at all (Mac AUv3 dosen’t even open the filechooser)
Hi, I’m using the same method for loading a file under iOS AUv3, but I found that if I close the plugin window when the FileChooser is open, the plugin will crush, everyone in the project. Do you have this issue? How do you deal with it? Thanks in advance!