How to detect DAW pause playing track from plugin


#1

I just want to detect if DAW pause/stop playing track or not from plugin.
Is there a way to detect the status ?
Please help me.

Thanks,


#2

If the host supports this, you find it in AudioPlayhead::CurrentPositionInfo.
It is only available in processBlock, like this:

AudioPlayHead::CurrentPositionInfo info;
getAudioPlayHead().getCurrentPosition (info);
if (info.isPlaying)
    foo();

Hope that helps


#3

Just to chime on what @daniel wrote,
As this is available only within processBlock you should save your last known struct. Also, when stopped your AudioProcessor::processBlock on many hosts would stop getting called.

For visual feedback you should set some timer on your Editor to check last state. Also, for empty tracks you might won’t even get called. Logic X would stop calling you on silent areas so you won’t know if you’re stopped.


#4

Thanks u, your idea is similar with mine. I did it.