VST / kVstTransportChanged


#1

For some reason Juce does not use VstTimeInfo::kVstTransportChanged flag at all.

This is necessary to get proper song playback position without polling the position all the time.

 

I added these changes to Juce source code:

AudioPlayHead::CurrentPositionInfo:

bool hasTransportChanged;

JuceVSTWrapper::getCurrentPosition:

info.hasTransportChanged = (ti->flags & kVstTransportChanged) != 0;

Now it's easy to detect playback state change (play->stop, stop->play, playback position change) in the plugin by simply checking the hasTransportChanged flag.

. jussi


#2

Thanks, but there's no point in adding a flag unless all the formats support it!

This would only be useful to people who are only targeting VST (i.e. very few people!). And even for them, the amount of effort it'd save is trivial. For everyone else, it'd just make the class more cluttered without actually helping, which is why I never added it before.


#3

FWIW, you can get that in AU as well.

playchanged line 590

 


#4

What would be the proper Juce way of detecting playback position change while playing?

- jussi