added offline render to plugin version. fixed file chooser cancel issue

This commit is contained in:
essej
2022-06-15 14:54:49 -04:00
parent a76068c632
commit 2fe466ec8a
5 changed files with 74 additions and 29 deletions

View File

@ -284,17 +284,22 @@ void RenderSettingsComponent::buttonClicked (Button* buttonThatWasClicked)
else if (buttonThatWasClicked == &buttonSelectFile)
{
File lastexportfolder; // File(g_propsfile->getValue("last_export_file")).getParentDirectory();
Component * parent = nullptr;
#if JUCE_IOS
parent = JUCEApplication::isStandaloneApp() ? nullptr : getActiveEditor();
#endif
m_filechooser = std::make_unique<FileChooser>("Please select audio file to render...",
lastexportfolder,
"*.wav");
"*.wav", true, false, parent);
m_filechooser->launchAsync(FileBrowserComponent::saveMode, [this](const FileChooser &chooser) {
String newpath = chooser.getResult().getFullPathName();
#if JUCE_IOS
// not actually used here, but just in case for later
newpath = chooser.getResult().getFileName();
#endif
outfileNameEditor.setText(newpath, dontSendNotification);
if (newpath.isNotEmpty()) {
outfileNameEditor.setText(newpath, dontSendNotification);
}
if (newpath.isNotEmpty() && pendingRender) {
buttonClicked(&buttonRender);
}