From dedc565be2758913a15f5bbc634ebc7335188827 Mon Sep 17 00:00:00 2001 From: pierreguillot Date: Fri, 21 Sep 2018 10:11:39 +0200 Subject: [PATCH] Fix openpanel and savepanel methods to output a symbol instead of a list --- Source/PluginEditorInteraction.cpp | 13 ++++++++----- Source/PluginEditorInteraction.h | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/PluginEditorInteraction.cpp b/Source/PluginEditorInteraction.cpp index ea3b539e..ba97b90a 100644 --- a/Source/PluginEditorInteraction.cpp +++ b/Source/PluginEditorInteraction.cpp @@ -227,8 +227,11 @@ class CamomileEditorMessageWindow : public DocumentWindow const std::string CamomileEditorMessageManager::string_openpanel = std::string("openpanel"); const std::string CamomileEditorMessageManager::string_savepanel = std::string("savepanel"); +const std::string CamomileEditorMessageManager::string_symbol = std::string("symbol"); const std::string CamomileEditorMessageManager::string_array = std::string("array"); const std::string CamomileEditorMessageManager::string_gui = std::string("gui"); +const std::string CamomileEditorMessageManager::string_resize = std::string("resize"); +const std::string CamomileEditorMessageManager::string_redraw = std::string("redraw"); CamomileEditorMessageManager::CamomileEditorMessageManager(CamomileAudioProcessor& processor) : m_processor(processor), m_window(new CamomileEditorMessageWindow()) @@ -255,7 +258,7 @@ bool CamomileEditorMessageManager::processMessages() m_processor.suspendProcessing(true); } auto const path = f.getFullPathName().replaceCharacter('\\', '/').toStdString(); - m_processor.enqueueMessages(string_openpanel, path, {}); + m_processor.enqueueMessages(string_openpanel, string_symbol, {path}); if(!message[2].empty()) { m_processor.suspendProcessing(false); @@ -264,7 +267,7 @@ bool CamomileEditorMessageManager::processMessages() } else if(message[0] == string_savepanel) { - FileChooser fc("Open...", File(message[1])); + FileChooser fc("Save...", File(message[1])); if(fc.browseForFileToSave(true)) { File const f(fc.getResult()); @@ -273,7 +276,7 @@ bool CamomileEditorMessageManager::processMessages() m_processor.suspendProcessing(true); } auto const path = f.getFullPathName().replaceCharacter('\\', '/').toStdString(); - m_processor.enqueueMessages(string_savepanel, path, {}); + m_processor.enqueueMessages(string_savepanel, string_symbol, {path}); if(!message[2].empty()) { m_processor.suspendProcessing(false); @@ -301,11 +304,11 @@ bool CamomileEditorMessageManager::processMessages() } else if(message[0] == string_gui) { - if(message[1] == std::string("resize")) + if(message[1] == string_resize) { guiResize(); } - else if(message[1] == std::string("redraw")) + else if(message[1] == string_redraw) { guiRedraw(); } diff --git a/Source/PluginEditorInteraction.h b/Source/PluginEditorInteraction.h index cf820409..a929b01b 100644 --- a/Source/PluginEditorInteraction.h +++ b/Source/PluginEditorInteraction.h @@ -94,8 +94,11 @@ class CamomileEditorMessageManager ScopedPointer m_window; static const std::string string_openpanel; static const std::string string_savepanel; + static const std::string string_symbol; static const std::string string_array; static const std::string string_gui; + static const std::string string_resize; + static const std::string string_redraw; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CamomileEditorMessageManager) };