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"
osxSDK="default" osxCompatibility="default" osxArchitecture="default"/>
<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>
<MODULEPATHS>
<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");
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);
}
}


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

@@ -35,11 +35,9 @@ static Array <PluginWindow*> 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<AudioPluginInstance*> (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);
}
}


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

@@ -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;


Loading…
Cancel
Save