diff --git a/examples/audio plugin host/Plugin Host.jucer b/examples/audio plugin host/Plugin Host.jucer index 49911393b7..dce34b8523 100644 --- a/examples/audio plugin host/Plugin Host.jucer +++ b/examples/audio plugin host/Plugin Host.jucer @@ -11,7 +11,7 @@ + osxSDK="default" osxCompatibility="10.6 SDK" osxArchitecture="default"/> diff --git a/examples/audio plugin host/Source/FilterGraph.cpp b/examples/audio plugin host/Source/FilterGraph.cpp index 02089a7779..a8371e4b32 100644 --- a/examples/audio plugin host/Source/FilterGraph.cpp +++ b/examples/audio plugin host/Source/FilterGraph.cpp @@ -391,7 +391,8 @@ static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcep XmlElement* layouts = new XmlElement ("LAYOUT"); const AudioProcessor::BusesLayout layout = plugin->getBusesLayout(); - for (bool isInput : { true, false }) + const bool isInputChoices[] = { true, false }; + for (bool isInput : isInputChoices) layouts->addChildElement (createBusLayoutXml (layout, isInput)); e->addChildElement (layouts); @@ -420,7 +421,8 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) { AudioProcessor::BusesLayout layout = instance->getBusesLayout(); - for (bool isInput : { true, false }) + const bool isInputChoices[] = { true, false }; + for (bool isInput : isInputChoices) readBusLayoutFromXml (layout, instance, *layoutEntity, isInput); instance->setBusesLayout (layout); @@ -453,7 +455,7 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) { jassert (node->getProcessor() != nullptr); - if (PluginWindow* const w = PluginWindow::getWindowFor (node, type, graph)) + if (PluginWindow* const w = PluginWindow::getWindowFor (node, type)) w->toFront (true); } } diff --git a/examples/audio plugin host/Source/GraphEditorPanel.cpp b/examples/audio plugin host/Source/GraphEditorPanel.cpp index ad5f9492dd..f67b1bc765 100644 --- a/examples/audio plugin host/Source/GraphEditorPanel.cpp +++ b/examples/audio plugin host/Source/GraphEditorPanel.cpp @@ -35,11 +35,9 @@ static Array activePluginWindows; PluginWindow::PluginWindow (Component* const pluginEditor, AudioProcessorGraph::Node* const o, - WindowFormatType t, - AudioProcessorGraph& audioGraph) + WindowFormatType t) : DocumentWindow (pluginEditor->getName(), Colours::lightblue, DocumentWindow::minimiseButton | DocumentWindow::closeButton), - graph (audioGraph), owner (o), type (t) { @@ -82,10 +80,9 @@ class ProcessorProgramPropertyComp : public PropertyComponent, private AudioProcessorListener { public: - ProcessorProgramPropertyComp (const String& name, AudioProcessor& p, int index_) + ProcessorProgramPropertyComp (const String& name, AudioProcessor& p) : PropertyComponent (name), - owner (p), - index (index_) + owner (p) { owner.addListener (this); } @@ -101,7 +98,6 @@ public: private: AudioProcessor& owner; - const int index; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProcessorProgramPropertyComp) }; @@ -129,7 +125,7 @@ public: if (name.isEmpty()) name = "Unnamed"; - ProcessorProgramPropertyComp* const pc = new ProcessorProgramPropertyComp (name, *p, i); + ProcessorProgramPropertyComp* const pc = new ProcessorProgramPropertyComp (name, *p); programs.add (pc); totalHeight += pc->getPreferredHeight(); } @@ -157,8 +153,7 @@ private: //============================================================================== PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* const node, - WindowFormatType type, - AudioProcessorGraph& audioGraph) + WindowFormatType type) { jassert (node != nullptr); @@ -193,7 +188,7 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* const node, if (AudioPluginInstance* const plugin = dynamic_cast (processor)) ui->setName (plugin->getName()); - return new PluginWindow (ui, node, type, audioGraph); + return new PluginWindow (ui, node, type); } return nullptr; @@ -395,7 +390,7 @@ public: default: break; }; - if (PluginWindow* const w = PluginWindow::getWindowFor (f, type, graph.getGraph())) + if (PluginWindow* const w = PluginWindow::getWindowFor (f, type)) w->toFront (true); } } @@ -429,7 +424,7 @@ public: else if (e.getNumberOfClicks() == 2) { if (const AudioProcessorGraph::Node::Ptr f = graph.getNodeForId (filterID)) - if (PluginWindow* const w = PluginWindow::getWindowFor (f, PluginWindow::Normal, graph.getGraph())) + if (PluginWindow* const w = PluginWindow::getWindowFor (f, PluginWindow::Normal)) w->toFront (true); } } diff --git a/examples/audio plugin host/Source/GraphEditorPanel.h b/examples/audio plugin host/Source/GraphEditorPanel.h index a0760f0468..b08379c88f 100644 --- a/examples/audio plugin host/Source/GraphEditorPanel.h +++ b/examples/audio plugin host/Source/GraphEditorPanel.h @@ -132,10 +132,10 @@ public: NumTypes }; - PluginWindow (Component* pluginEditor, AudioProcessorGraph::Node*, WindowFormatType, AudioProcessorGraph&); + PluginWindow (Component* pluginEditor, AudioProcessorGraph::Node*, WindowFormatType); ~PluginWindow(); - static PluginWindow* getWindowFor (AudioProcessorGraph::Node*, WindowFormatType, AudioProcessorGraph&); + static PluginWindow* getWindowFor (AudioProcessorGraph::Node*, WindowFormatType); static void closeCurrentlyOpenWindowsFor (const uint32 nodeId); static void closeAllCurrentlyOpenWindows(); @@ -144,7 +144,6 @@ public: void closeButtonPressed() override; private: - AudioProcessorGraph& graph; AudioProcessorGraph::Node* owner; WindowFormatType type;