Skip to content

Commit

Permalink
Fix openpanel and savepanel methods to output a symbol instead of a list
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreguillot committed Sep 21, 2018
1 parent e3cea72 commit dedc565
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Source/PluginEditorInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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);
Expand All @@ -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());
Expand All @@ -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);
Expand Down Expand Up @@ -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();
}
Expand Down
3 changes: 3 additions & 0 deletions Source/PluginEditorInteraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ class CamomileEditorMessageManager
ScopedPointer<DocumentWindow> 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)
};
Expand Down

0 comments on commit dedc565

Please sign in to comment.