From 49f58cd07952feaf28b6358c2e1cf633b6d453ae Mon Sep 17 00:00:00 2001 From: Rolando Islas Date: Sat, 28 May 2016 15:21:41 -0700 Subject: [PATCH 1/3] Missing limits header --- Source/IconMenu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/IconMenu.cpp b/Source/IconMenu.cpp index ac66b44..9aad31f 100644 --- a/Source/IconMenu.cpp +++ b/Source/IconMenu.cpp @@ -10,6 +10,7 @@ #include "IconMenu.hpp" #include "PluginWindow.h" #include +#include #if JUCE_WINDOWS #include "Windows.h" #endif From 7c5332e79eb500fca74dd6dc810f9ef6b6d23621 Mon Sep 17 00:00:00 2001 From: Rolando Islas Date: Thu, 22 Sep 2016 19:32:30 -0700 Subject: [PATCH 2/3] Update to Juce 4.2.4 --- LightHost.jucer | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/LightHost.jucer b/LightHost.jucer index 83acad4..ea8d6e4 100644 --- a/LightHost.jucer +++ b/LightHost.jucer @@ -10,7 +10,7 @@ pluginSilenceInIsSilenceOut="0" pluginTailLength="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="JuceProjectAU" pluginAUViewClass="JuceProjectAU_V1" pluginRTASCategory="" bundleIdentifier="com.rolandoislas.lighthost" - jucerVersion="4.2.1" companyName="Rolando Islas" includeBinaryInAppConfig="1" + jucerVersion="4.2.4" companyName="Rolando Islas" includeBinaryInAppConfig="1" companyWebsite="https://www.rolandoislas.com" companyEmail="admin@rolandoislas.com"> - - - - - - - - - - - - - - + + + + + + + + + + + + + + From cb69f21c5c92f450acf22ed2a6d7ef6b837477ae Mon Sep 17 00:00:00 2001 From: Rolando Islas Date: Thu, 22 Sep 2016 22:02:46 -0700 Subject: [PATCH 3/3] Allow multiple instances of Light Host - Requires argument `-multi-instance=profileName` where profileName should be changed for each instance --- Source/HostStartup.cpp | 46 ++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/Source/HostStartup.cpp b/Source/HostStartup.cpp index b86a476..b1ba629 100644 --- a/Source/HostStartup.cpp +++ b/Source/HostStartup.cpp @@ -7,6 +7,7 @@ class PluginHostApp : public JUCEApplication { + public: PluginHostApp() {} @@ -17,6 +18,8 @@ class PluginHostApp : public JUCEApplication options.filenameSuffix = "settings"; options.osxLibrarySubFolder = "Preferences"; + checkArguments(&options); + appProperties = new ApplicationProperties(); appProperties->setStorageParameters (options); @@ -26,16 +29,6 @@ class PluginHostApp : public JUCEApplication #if JUCE_MAC Process::setDockIconVisible(false); #endif - - File fileToOpen; - - for (int i = 0; i < getCommandLineParameterArray().size(); ++i) - { - fileToOpen = File::getCurrentWorkingDirectory().getChildFile (getCommandLineParameterArray()[i]); - - if (fileToOpen.existsAsFile()) - break; - } } void shutdown() override @@ -52,15 +45,42 @@ class PluginHostApp : public JUCEApplication const String getApplicationName() override { return "Light Host"; } const String getApplicationVersion() override { return ProjectInfo::versionString; } - bool moreThanOneInstanceAllowed() override { return false; } + bool moreThanOneInstanceAllowed() override { + StringArray multiInstance = getParameter("-multi-instance"); + return multiInstance.size() == 2; + } ApplicationCommandManager commandManager; ScopedPointer appProperties; LookAndFeel_V3 lookAndFeel; private: - ScopedPointer mainWindow; -}; + ScopedPointer mainWindow; + + StringArray getParameter(String lookFor) { + StringArray parameters = getCommandLineParameterArray(); + StringArray found; + for (int i = 0; i < parameters.size(); ++i) + { + String param = parameters[i]; + if (param.contains(lookFor)) + { + found.add(lookFor); + int delimiter = param.indexOf(0, "=") + 1; + String val = param.substring(delimiter); + found.add(val); + return found; + } + } + return found; + } + + void checkArguments(PropertiesFile::Options *options) { + StringArray multiInstance = getParameter("-multi-instance"); + if (multiInstance.size() == 2) + options->filenameSuffix = multiInstance[1] + "." + options->filenameSuffix; + } +}; static PluginHostApp& getApp() { return *dynamic_cast(JUCEApplication::getInstance()); } ApplicationCommandManager& getCommandManager() { return getApp().commandManager; }