Various backends have different strategies for updating latencies,
and different thread semantics for latency update callbacks.
With jack2 it is possible that processing happens concurrently
while port latencies are being changed.
Ardour internal backends emit the latency callback from the
main process thread, serializing latency changes with processing.
Various user actions can also trigger latency changes. e.g.
with a stopped engine it is possible to re-order plugins.
When editing a sends, this allows to unlink send panner via
the panner's context menu.
NB. After 6.0-rc string freeze the context menu needs an update.
So far the text from the Processor Box context menu is reused.
The semantics are that if the user configures things to allow transport commands while
using a transport master, issuing such commands first stops using the master
Auditioner seek calls are explicitly handled by the butler,
and DR:overwrite_existing_buffers() is called explicitly
to read MIDI data for audition.
Session::non_realtime_overwrite is no longer required.
This reverts commit 6fbcf83779
and parts of 2d11667ce3.
The options ForwardSlow, Forward and ForwardFast and their
respective Rewind options were not honoured in the execution
of forward/rewind operations when the transport was already
rolling at a slower speed than the forward or rewind option's
speed with same direction as the requested direction.
The Auditioner is not part of the session route-list and the
auditioner route's I/O latency is never updated.
Session::process_audition() does not handle pre-roll either,
so it need to be zeroed, otherwise Route::roll skips samples.
This has lead to initial samples being skipped, IFF the
auditioner's output-port had non-zero latency.
Since private port-latencies are usually only set for routes
in the route-list, and _remaining_latency_preroll is reset
at transport-stop, this *usually* worked...
Last but not least, MIDI notes need to be resolved when seeking.
IO::latency iterates over the port-set retrieving the
private_latency_range of each port. Since it can only change
when connections and latency changes, we can instead cache the value.
This is also in preparation to allow the auditioner to override it.
When the cursor position is after the last item in the vector,
upper_bound returns the last given iterator, here:
`region_boundary_cache.end()`, which is invalid to dereference.
Furthermore prevent possible duplicate prev/next pair at zero,
when using the video-timelime.