In My Plugin project I have a graph with other nodes inside:
My aim is get the plyhead of host and pass it to my graph and to all nodes inside graph.
to do this I wrote this code in processor “prepare to play”:
if (getPlayHead())
{
graph.setPlayHead(getPlayHead());
for (AudioProcessorGraph::Node* node : graph.getNodes())
{
node->getProcessor()->setPlayHead(getPlayHead());
}
}
and to log some infos:
void timerCallback() override
{
if (!audioProcessor.getPlayHead()) { return; }
auto position = audioProcessor.getPlayHead()->getPosition();
if (position.hasValue())
{
bool dawPlaying = position->getIsPlaying();
String isPlayng = dawPlaying ? "is Playing" : "is Stopped";
AudioPlayHead::TimeSignature timeSig = *(position->getTimeSignature());
String timeSignature = " | TimeSignature: " + String(timeSig.numerator) + "/" + String(timeSig.denominator);
String bpm = " | BPM: " + String(*(position->getBpm()));
String timeInSeconds = " | Time in Seconds: " + String(*(position->getTimeInSeconds()));
String quarterNotesPos = " | Position QuarterNotes Based: " + String(*(position->getPpqPosition()));
dawInfosLbl.setText(isPlayng + timeSignature + bpm + timeInSeconds + quarterNotesPos, dontSendNotification);
}
}
But Nothing happens when I instantiate plugin what I’m missing?