Hi guys,
I’m porting one of my plugins to iOS and I’m refactoring the presets system.
I’ve been able to get the fileChooser to show and save on both the standalone app and the AUv3 plugin (the file is zero bytes, but I guess the save process is different for iOS compared to desktop).
From a quick glance through similar threads, I understand I’ll get an URLResult and I need to create a stream.
Aynways, I’m wondering how to get these kind of folders (like Animoog, GarageBand and iMS20):
Also, what the path for this location is?
Thanks!
ttg
July 26, 2023, 10:16am
2
For my freebie / open-source I’ve ended up using the share which works well.
This is the sharing/exporting of a preset:
presetsView->renamePreset (file, name.getText(), name.getProperties().getVarPointer ("time") == nullptr);
};
break;
case 2:
jassert (presetsView != nullptr);
presetsView->deleteFileWithConfirmation (presetsView->getFileForIndex (index));
break;
case 3:
#if JUCE_IOS || JUCE_ANDROID
{
ScopedMessageBox messageBox = juce::ContentSharer::shareFilesScoped (
{ presetsView->getFileForIndex (index) }, [this] (bool, String)
{ presetsView->shareBox.close(); },
getTopLevelComponent());
presetsView->shareBox = std::move (messageBox);
}
#endif
break;
default:
break;
};
Here’s the import:
{
aw->enterModalState (true,
juce::ModalCallbackFunction::forComponent (savePresetCallback,
this,
juce::Component::SafePointer<DialogComponent> (aw)),
true);
}
});
});
#if JUCE_IOS || JUCE_ANDROID
menu.addItem ("Import...", TickUtils::canImport(), false, [this] {
fileChooser.launchAsync (FileBrowserComponent::FileChooserFlags::openMode | FileBrowserComponent::FileChooserFlags::canSelectFiles,
[this] (const FileChooser& chooser) {
if (! chooser.getURLResult().isEmpty())
{
#if JUCE_ANDROID
auto stream = AndroidDocument::fromDocument (chooser.getURLResult()).createInputStream();
#else
auto stream (
chooser.getURLResult().createInputStream (
URL::InputStreamOptions (
On iOS especially when I’d guess you’ll end up also with a standalone app,
You’ll have additional tweaks like:
announcing your extension on the plist
add to CMake/Projucer settings your shared files folder (so you’d have access to it on both - Standalone and AUv3).
2 Likes