Hi Jules… Sorry went to bed just before you posted… and I’ve had to make a branch and change a bunch of my code… the biggest issue I’ve run into is your change to using AudioProcessorGraph::Connection as a single parameter for addConnection() and addConnection()… the first thing I’ve had to do so far is add a constructor for the NodeAndChannel struct:
struct NodeAndChannel
{
NodeAndChannel() : nodeID (0), channelIndex (0) {}
NodeAndChannel (NodeID theNodeID, int chIndex) : nodeID (theNodeID), channelIndex (chIndex) {}
NodeID nodeID;
int channelIndex;
bool isMIDI() const noexcept { return channelIndex == midiChannelIndex; }
bool operator== (const NodeAndChannel& other) const noexcept { return nodeID == other.nodeID && channelIndex == other.channelIndex; }
bool operator!= (const NodeAndChannel& other) const noexcept { return ! operator== (other); }
};
That way I can change my helper functions from:
bool canMakeStereoConnection (AudioProcessorGraph* graph, AudioProcessorGraph::Node::Ptr from, AudioProcessorGraph::Node::Ptr to)
{
return graph->canConnect (from->nodeId, 0, to->nodeId, 0) && graph->canConnect (from->nodeId, 1, to->nodeId, 1);
}
bool addStereoConnection (AudioProcessorGraph* graph, AudioProcessorGraph::Node::Ptr from, AudioProcessorGraph::Node::Ptr to, int iChanIndex1 /* = 0 */, int iChanIndex2 /* = 1 */)
{
return graph->addConnection (from->nodeId, 0, to->nodeId, iChanIndex1) && graph->addConnection (from->nodeId, 1, to->nodeId, iChanIndex2);
}
to:
bool canMakeStereoConnection (AudioProcessorGraph* graph, AudioProcessorGraph::Node::Ptr from, AudioProcessorGraph::Node::Ptr to)
{
return graph->canConnect ({ { from->nodeId, 0 }, { to->nodeId, 0 } }) && graph->canConnect ( { { from->nodeId, 1 }, { to->nodeId, 1 } });
}
bool addStereoConnection (AudioProcessorGraph* graph, AudioProcessorGraph::Node::Ptr from, AudioProcessorGraph::Node::Ptr to, int iChanIndex1 /* = 0 */, int iChanIndex2 /* = 1 */)
{
return graph->addConnection ( { { from->nodeId, 0 }, { to->nodeId, iChanIndex1 } }) && graph->addConnection ( { { from->nodeId, 1 }, { to->nodeId, iChanIndex2 } });
}
Also had to add:
/** Returns the number of connections in the graph. */
int getNumConnections() const { return (int) connections.size(); }
and
/** Returns a pointer to one of the connections in the graph. */
const Connection* getConnection (int index) const { return connections.data() + index; }
I’ll report more after I get all the changes done… and I’ll add more to this post as I progress in making this work with my code…
Thanks,
Rail