Browse Source

AudioProcessorGraph: Ensure graph is rebuilt if any node bus layouts change

v7.0.9
reuk 2 years ago
parent
commit
d30f51ff00
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp

+ 7
- 6
modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp View File

@@ -1566,27 +1566,28 @@ class RenderSequenceSignature
public:
RenderSequenceSignature (const PrepareSettings s, const Nodes& n, const Connections& c)
: settings (s), connections (c), nodes (getNodeIDs (n)) {}
: settings (s), connections (c), nodes (getNodeMap (n)) {}
bool operator== (const RenderSequenceSignature& other) const { return tie() == other.tie(); }
bool operator!= (const RenderSequenceSignature& other) const { return tie() != other.tie(); }
private:
static std::vector<AudioProcessorGraph::NodeID> getNodeIDs (const Nodes& n)
using NodeMap = std::map<AudioProcessorGraph::NodeID, AudioProcessor::BusesLayout>;
static NodeMap getNodeMap (const Nodes& n)
{
const auto& nodeRefs = n.getNodes();
std::vector<AudioProcessorGraph::NodeID> result;
result.reserve ((size_t) nodeRefs.size());
NodeMap result;
for (const auto& node : nodeRefs)
result.push_back (node->nodeID);
result.emplace (node->nodeID, node->getProcessor()->getBusesLayout());
return result;
}
PrepareSettings settings;
Connections connections;
std::vector<AudioProcessorGraph::NodeID> nodes;
NodeMap nodes;
};
//==============================================================================


Loading…
Cancel
Save