From b74398dfdfd32d32e432833de88d532e6a486f32 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Sat, 28 Aug 2010 11:38:48 +0100 Subject: [PATCH] Fixed a compile error in the plugin host demo. --- .../audio plugin host/Source/FilterGraph.cpp | 6 ++-- .../Source/GraphEditorPanel.cpp | 30 +++++++++---------- juce_amalgamated.cpp | 12 ++++---- juce_amalgamated.h | 6 ++-- .../processors/juce_AudioProcessorGraph.cpp | 12 ++++---- .../processors/juce_AudioProcessorGraph.h | 6 ++-- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/extras/audio plugin host/Source/FilterGraph.cpp b/extras/audio plugin host/Source/FilterGraph.cpp index 04356dc35f..281436612d 100644 --- a/extras/audio plugin host/Source/FilterGraph.cpp +++ b/extras/audio plugin host/Source/FilterGraph.cpp @@ -294,7 +294,7 @@ void FilterGraph::setLastDocumentOpened (const File& file) //============================================================================== static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) throw() { - AudioPluginInstance* plugin = dynamic_cast (node->processor); + AudioPluginInstance* plugin = dynamic_cast (node->getProcessor()); if (plugin == 0) { @@ -318,7 +318,7 @@ static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) throw() XmlElement* state = new XmlElement ("STATE"); MemoryBlock m; - node->processor->getStateInformation (m); + node->getProcessor()->getStateInformation (m); state->addTextElement (m.toBase64Encoding()); e->addChildElement (state); @@ -357,7 +357,7 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) MemoryBlock m; m.fromBase64Encoding (state->getAllSubText()); - node->processor->setStateInformation (m.getData(), (int) m.getSize()); + node->getProcessor()->setStateInformation (m.getData(), (int) m.getSize()); } node->properties.set ("x", xml.getDoubleAttribute (T("x"))); diff --git a/extras/audio plugin host/Source/GraphEditorPanel.cpp b/extras/audio plugin host/Source/GraphEditorPanel.cpp index 9ed5d9b61a..94348d94a1 100644 --- a/extras/audio plugin host/Source/GraphEditorPanel.cpp +++ b/extras/audio plugin host/Source/GraphEditorPanel.cpp @@ -77,7 +77,7 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* node, if (! useGenericView) { - ui = node->processor->createEditorIfNeeded(); + ui = node->getProcessor()->createEditorIfNeeded(); if (ui == 0) useGenericView = true; @@ -85,12 +85,12 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* node, if (useGenericView) { - ui = new GenericAudioProcessorEditor (node->processor); + ui = new GenericAudioProcessorEditor (node->getProcessor()); } if (ui != 0) { - AudioPluginInstance* const plugin = dynamic_cast (node->processor); + AudioPluginInstance* const plugin = dynamic_cast (node->getProcessor()); if (plugin != 0) ui->setName (plugin->getName()); @@ -137,9 +137,9 @@ public: String tip; if (isInput) - tip = node->processor->getInputChannelName (index_); + tip = node->getProcessor()->getInputChannelName (index_); else - tip = node->processor->getOutputChannelName (index_); + tip = node->getProcessor()->getOutputChannelName (index_); if (tip.isEmpty()) { @@ -387,12 +387,12 @@ public: return; } - numIns = f->processor->getNumInputChannels(); - if (f->processor->acceptsMidi()) + numIns = f->getProcessor()->getNumInputChannels(); + if (f->getProcessor()->acceptsMidi()) ++numIns; - numOuts = f->processor->getNumOutputChannels(); - if (f->processor->producesMidi()) + numOuts = f->getProcessor()->getNumOutputChannels(); + if (f->getProcessor()->producesMidi()) ++numOuts; int w = 100; @@ -400,14 +400,14 @@ public: w = jmax (w, (jmax (numIns, numOuts) + 1) * 20); - const int textWidth = font.getStringWidth (f->processor->getName()); + const int textWidth = font.getStringWidth (f->getProcessor()->getName()); w = jmax (w, 16 + jmin (textWidth, 300)); if (textWidth > 300) h = 100; setSize (w, h); - setName (f->processor->getName()); + setName (f->getProcessor()->getName()); { double x, y; @@ -423,16 +423,16 @@ public: deleteAllChildren(); int i; - for (i = 0; i < f->processor->getNumInputChannels(); ++i) + for (i = 0; i < f->getProcessor()->getNumInputChannels(); ++i) addAndMakeVisible (new PinComponent (graph, filterID, i, true)); - if (f->processor->acceptsMidi()) + if (f->getProcessor()->acceptsMidi()) addAndMakeVisible (new PinComponent (graph, filterID, FilterGraph::midiChannelNumber, true)); - for (i = 0; i < f->processor->getNumOutputChannels(); ++i) + for (i = 0; i < f->getProcessor()->getNumOutputChannels(); ++i) addAndMakeVisible (new PinComponent (graph, filterID, i, false)); - if (f->processor->producesMidi()) + if (f->getProcessor()->producesMidi()) addAndMakeVisible (new PinComponent (graph, filterID, FilterGraph::midiChannelNumber, false)); resized(); diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 70a48c6ae1..e3eb08e3c3 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -36214,7 +36214,7 @@ public: const int totalChans_, const int midiBufferToUse_) : node (node_), - processor (node_->processor), + processor (node_->getProcessor()), audioChannelsToUse (audioChannelsToUse_), totalChans (jmax (1, totalChans_)), midiBufferToUse (midiBufferToUse_) @@ -36293,8 +36293,8 @@ private: Array& renderingOps, const int ourRenderingIndex) { - const int numIns = node->processor->getNumInputChannels(); - const int numOuts = node->processor->getNumOutputChannels(); + const int numIns = node->getProcessor()->getNumInputChannels(); + const int numOuts = node->getProcessor()->getNumOutputChannels(); const int totalChans = jmax (numIns, numOuts); Array audioChannelsToUse; @@ -36452,7 +36452,7 @@ private: // No midi inputs.. midiBufferToUse = getFreeBuffer (true); // need to pick a buffer even if the processor doesn't use midi - if (node->processor->acceptsMidi() || node->processor->producesMidi()) + if (node->getProcessor()->acceptsMidi() || node->getProcessor()->producesMidi()) renderingOps.add (new ClearMidiBufferOp (midiBufferToUse)); } else if (midiSourceNodes.size() == 1) @@ -36532,7 +36532,7 @@ private: } } - if (node->processor->producesMidi()) + if (node->getProcessor()->producesMidi()) markBufferAsContaining (midiBufferToUse, node->id, AudioProcessorGraph::midiChannelIndex); @@ -36631,7 +36631,7 @@ private: } else { - for (int i = 0; i < node->processor->getNumInputChannels(); ++i) + for (int i = 0; i < node->getProcessor()->getNumInputChannels(); ++i) if (i != inputChannelOfIndexToIgnore && graph.getConnectionBetween (nodeId, outputChanIndex, node->id, i) != 0) diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 8385c5c635..4e57d64f1f 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -40817,9 +40817,8 @@ public: */ const uint32 id; - /** The actual processor object that this node represents. - */ - const ScopedPointer processor; + /** The actual processor object that this node represents. */ + AudioProcessor* getProcessor() const throw() { return processor; } /** A set of user-definable properties that are associated with this node. @@ -40838,6 +40837,7 @@ public: private: friend class AudioProcessorGraph; + const ScopedPointer processor; bool isPrepared; Node (uint32 id, AudioProcessor* processor); diff --git a/src/audio/processors/juce_AudioProcessorGraph.cpp b/src/audio/processors/juce_AudioProcessorGraph.cpp index fc36555e8b..2c532482d8 100644 --- a/src/audio/processors/juce_AudioProcessorGraph.cpp +++ b/src/audio/processors/juce_AudioProcessorGraph.cpp @@ -501,7 +501,7 @@ public: const int totalChans_, const int midiBufferToUse_) : node (node_), - processor (node_->processor), + processor (node_->getProcessor()), audioChannelsToUse (audioChannelsToUse_), totalChans (jmax (1, totalChans_)), midiBufferToUse (midiBufferToUse_) @@ -583,8 +583,8 @@ private: Array& renderingOps, const int ourRenderingIndex) { - const int numIns = node->processor->getNumInputChannels(); - const int numOuts = node->processor->getNumOutputChannels(); + const int numIns = node->getProcessor()->getNumInputChannels(); + const int numOuts = node->getProcessor()->getNumOutputChannels(); const int totalChans = jmax (numIns, numOuts); Array audioChannelsToUse; @@ -742,7 +742,7 @@ private: // No midi inputs.. midiBufferToUse = getFreeBuffer (true); // need to pick a buffer even if the processor doesn't use midi - if (node->processor->acceptsMidi() || node->processor->producesMidi()) + if (node->getProcessor()->acceptsMidi() || node->getProcessor()->producesMidi()) renderingOps.add (new ClearMidiBufferOp (midiBufferToUse)); } else if (midiSourceNodes.size() == 1) @@ -822,7 +822,7 @@ private: } } - if (node->processor->producesMidi()) + if (node->getProcessor()->producesMidi()) markBufferAsContaining (midiBufferToUse, node->id, AudioProcessorGraph::midiChannelIndex); @@ -922,7 +922,7 @@ private: } else { - for (int i = 0; i < node->processor->getNumInputChannels(); ++i) + for (int i = 0; i < node->getProcessor()->getNumInputChannels(); ++i) if (i != inputChannelOfIndexToIgnore && graph.getConnectionBetween (nodeId, outputChanIndex, node->id, i) != 0) diff --git a/src/audio/processors/juce_AudioProcessorGraph.h b/src/audio/processors/juce_AudioProcessorGraph.h index 9e32b03a26..ee722217ba 100644 --- a/src/audio/processors/juce_AudioProcessorGraph.h +++ b/src/audio/processors/juce_AudioProcessorGraph.h @@ -81,9 +81,8 @@ public: */ const uint32 id; - /** The actual processor object that this node represents. - */ - const ScopedPointer processor; + /** The actual processor object that this node represents. */ + AudioProcessor* getProcessor() const throw() { return processor; } /** A set of user-definable properties that are associated with this node. @@ -104,6 +103,7 @@ public: private: friend class AudioProcessorGraph; + const ScopedPointer processor; bool isPrepared; Node (uint32 id, AudioProcessor* processor);