1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

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

This commit is contained in:
reuk 2023-04-06 18:44:00 +01:00
parent 221d1aa6cf
commit d30f51ff00
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

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;
};
//==============================================================================