Who manages tracktion Playhead?

I created a tracktion::graph::PlayHead and in constructor of my class that inherit Timer I called:

    startTimer(30);
    playHead.play();

Then in timerCallback()

    DBG((int)playHead.isPlaying());
    DBG(playHead.getPosition());

console print me a list of:
1
0

so… Who manages the playhead increment? I need to subclass an audioDeviceIOCallbackWithContext to do it or there’s something that manages tracktion::graph::PlayHead indipendently?

I think you might be missing the job of PlayHead. It doesn’t just run internally, it’s not a timer. From the docs:

/**
    Converts a monotonically increasing reference range in to a timeline range.
    This can then get converted to a real-time range using the playback sample rate.
    This also handles looping and scrubbing and keeps track of when the play position
    was last set.
*/
class PlayHead

Maybe look at tracktion::engine::EditPlaybackContext::NodePlaybackContext for how we use it there?

1 Like