Browse Source

Fixed some MacOS compiler warnings in the JUCE demo host

tags/2021-05-28
tpoole 8 years ago
parent
commit
00673ec3bc
4 changed files with 16 additions and 20 deletions
  1. +1
    -1
      examples/audio plugin host/Plugin Host.jucer
  2. +5
    -3
      examples/audio plugin host/Source/FilterGraph.cpp
  3. +8
    -13
      examples/audio plugin host/Source/GraphEditorPanel.cpp
  4. +2
    -3
      examples/audio plugin host/Source/GraphEditorPanel.h

+ 1
- 1
examples/audio plugin host/Plugin Host.jucer View File

@@ -11,7 +11,7 @@
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Plugin Host" <CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="Plugin Host"
osxSDK="default" osxCompatibility="default" osxArchitecture="default"/> osxSDK="default" osxCompatibility="default" osxArchitecture="default"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Plugin Host" <CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="Plugin Host"
osxSDK="default" osxCompatibility="10.5 SDK" osxArchitecture="default"/>
osxSDK="default" osxCompatibility="10.6 SDK" osxArchitecture="default"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/> <MODULEPATH id="juce_video" path="../../modules"/>


+ 5
- 3
examples/audio plugin host/Source/FilterGraph.cpp View File

@@ -391,7 +391,8 @@ static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcep
XmlElement* layouts = new XmlElement ("LAYOUT"); XmlElement* layouts = new XmlElement ("LAYOUT");
const AudioProcessor::BusesLayout layout = plugin->getBusesLayout(); 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)); layouts->addChildElement (createBusLayoutXml (layout, isInput));
e->addChildElement (layouts); e->addChildElement (layouts);
@@ -420,7 +421,8 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml)
{ {
AudioProcessor::BusesLayout layout = instance->getBusesLayout(); AudioProcessor::BusesLayout layout = instance->getBusesLayout();
for (bool isInput : { true, false })
const bool isInputChoices[] = { true, false };
for (bool isInput : isInputChoices)
readBusLayoutFromXml (layout, instance, *layoutEntity, isInput); readBusLayoutFromXml (layout, instance, *layoutEntity, isInput);
instance->setBusesLayout (layout); instance->setBusesLayout (layout);
@@ -453,7 +455,7 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml)
{ {
jassert (node->getProcessor() != nullptr); jassert (node->getProcessor() != nullptr);
if (PluginWindow* const w = PluginWindow::getWindowFor (node, type, graph))
if (PluginWindow* const w = PluginWindow::getWindowFor (node, type))
w->toFront (true); w->toFront (true);
} }
} }


+ 8
- 13
examples/audio plugin host/Source/GraphEditorPanel.cpp View File

@@ -35,11 +35,9 @@ static Array <PluginWindow*> activePluginWindows;
PluginWindow::PluginWindow (Component* const pluginEditor, PluginWindow::PluginWindow (Component* const pluginEditor,
AudioProcessorGraph::Node* const o, AudioProcessorGraph::Node* const o,
WindowFormatType t,
AudioProcessorGraph& audioGraph)
WindowFormatType t)
: DocumentWindow (pluginEditor->getName(), Colours::lightblue, : DocumentWindow (pluginEditor->getName(), Colours::lightblue,
DocumentWindow::minimiseButton | DocumentWindow::closeButton), DocumentWindow::minimiseButton | DocumentWindow::closeButton),
graph (audioGraph),
owner (o), owner (o),
type (t) type (t)
{ {
@@ -82,10 +80,9 @@ class ProcessorProgramPropertyComp : public PropertyComponent,
private AudioProcessorListener private AudioProcessorListener
{ {
public: public:
ProcessorProgramPropertyComp (const String& name, AudioProcessor& p, int index_)
ProcessorProgramPropertyComp (const String& name, AudioProcessor& p)
: PropertyComponent (name), : PropertyComponent (name),
owner (p),
index (index_)
owner (p)
{ {
owner.addListener (this); owner.addListener (this);
} }
@@ -101,7 +98,6 @@ public:
private: private:
AudioProcessor& owner; AudioProcessor& owner;
const int index;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProcessorProgramPropertyComp) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProcessorProgramPropertyComp)
}; };
@@ -129,7 +125,7 @@ public:
if (name.isEmpty()) if (name.isEmpty())
name = "Unnamed"; name = "Unnamed";
ProcessorProgramPropertyComp* const pc = new ProcessorProgramPropertyComp (name, *p, i);
ProcessorProgramPropertyComp* const pc = new ProcessorProgramPropertyComp (name, *p);
programs.add (pc); programs.add (pc);
totalHeight += pc->getPreferredHeight(); totalHeight += pc->getPreferredHeight();
} }
@@ -157,8 +153,7 @@ private:
//============================================================================== //==============================================================================
PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* const node, PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* const node,
WindowFormatType type,
AudioProcessorGraph& audioGraph)
WindowFormatType type)
{ {
jassert (node != nullptr); jassert (node != nullptr);
@@ -193,7 +188,7 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* const node,
if (AudioPluginInstance* const plugin = dynamic_cast<AudioPluginInstance*> (processor)) if (AudioPluginInstance* const plugin = dynamic_cast<AudioPluginInstance*> (processor))
ui->setName (plugin->getName()); ui->setName (plugin->getName());
return new PluginWindow (ui, node, type, audioGraph);
return new PluginWindow (ui, node, type);
} }
return nullptr; return nullptr;
@@ -395,7 +390,7 @@ public:
default: break; default: break;
}; };
if (PluginWindow* const w = PluginWindow::getWindowFor (f, type, graph.getGraph()))
if (PluginWindow* const w = PluginWindow::getWindowFor (f, type))
w->toFront (true); w->toFront (true);
} }
} }
@@ -429,7 +424,7 @@ public:
else if (e.getNumberOfClicks() == 2) else if (e.getNumberOfClicks() == 2)
{ {
if (const AudioProcessorGraph::Node::Ptr f = graph.getNodeForId (filterID)) 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); w->toFront (true);
} }
} }


+ 2
- 3
examples/audio plugin host/Source/GraphEditorPanel.h View File

@@ -132,10 +132,10 @@ public:
NumTypes NumTypes
}; };
PluginWindow (Component* pluginEditor, AudioProcessorGraph::Node*, WindowFormatType, AudioProcessorGraph&);
PluginWindow (Component* pluginEditor, AudioProcessorGraph::Node*, WindowFormatType);
~PluginWindow(); ~PluginWindow();
static PluginWindow* getWindowFor (AudioProcessorGraph::Node*, WindowFormatType, AudioProcessorGraph&);
static PluginWindow* getWindowFor (AudioProcessorGraph::Node*, WindowFormatType);
static void closeCurrentlyOpenWindowsFor (const uint32 nodeId); static void closeCurrentlyOpenWindowsFor (const uint32 nodeId);
static void closeAllCurrentlyOpenWindows(); static void closeAllCurrentlyOpenWindows();
@@ -144,7 +144,6 @@ public:
void closeButtonPressed() override; void closeButtonPressed() override;
private: private:
AudioProcessorGraph& graph;
AudioProcessorGraph::Node* owner; AudioProcessorGraph::Node* owner;
WindowFormatType type; WindowFormatType type;


Loading…
Cancel
Save