Nomenclature has been changed throughout libardour. “Frame” now only refers to timecode and video frames. Audio position is indicated in “Samples”.
The transport position is local playhead_is_at = Session:transport_sample (), and the locate API has two two options: (1) what happens after the locate, and (2) the context that requests the change (relevant when timecode masters are used). e.g.
Next question: Why do I get different results when executing multiple commands from one script, compared to executing them one command per script, multiple scripts after another? Is there some kind of “flush” I miss…?
Example: I’ve got two overlapping regions, I wanna end up with the playhead set to where the first region ends. I thought straight forward: Select the second region, move playhead to beginning of this selected region, then move playhead to next region end. This should be the end result:
It works perfectly well when executing the commands one by one (one command per script run), but done in one script together, the playhead ultimately ends up at the next region seen from where it was located before the script started (as if the first request_locate didn’t happen before).
Even after hours of playing around with this “GUI-based” approach, it is still a mess. I don’t quite get why, because the commands work perfectly well when executed one after another (one command per script run), but when put into one script run, “playhead-to-next-region-end” doesn’t seem to care about the previously repositioned playhead at all - no matter how much “sleep”-time used in between the commands. Even if I send it to sleep for five whole seconds after each and every command, it still doesn’t use the expected playhead positions… I give up here…
So anyways, I’ll have to try a more scripting-oriented approach (without goofing around with these GUI-functions). Next question arises: What would be the command to set the fade-ins/-outs of a region? The class reference only talks about using and showing the fades, but not setting their fade lengths…?