Previously there was a race condition. DiskWriter::run()
cleared the gui_feed_buffer before writing new events.
If the GUI thread had not yet picked up the events by then
they were not displayed. Furthermore due to the try-lock,
some events may have been written to the buffer in the first
place.
This fixes missing events (notably stuck notes) in the red
record box while recording MIDI.
_output latency was not used for those. Processor automation
was not affected.
This also fixes the visual offset of automation vs buttons/slider
when the transport is not running.
When removing instances from some RCU managed list or vector,
they can still live on as shared_ptr references on the
RCU's dead wood stack.
In many cases this is not an issue, in these cases it's prudent.
see also 44610c7877
This riffs off the previous commit, a simple way to replay
ctrl events without re-evaluating plugin automation line.
There may be a better way to handle this (e.g. replicate the
plugin for display only, evaluate on the fly in the UI thread)
Short of redesigning our disk-reader/playlist/region infrastructure
this is likely a sucks-least compromise for the time being.
This still does not work on macOS. closing a session (using
the menu) while the dialog is visible still causes a crash:
`unload_session()` completes and destroys the session
before the dialog's run() method returns and destroys the dialog.
This can happen with VST2s (e.g gvst) and some JUCE based plugins.
Previously that lead to a "programming error: no per-thread pool"
when the DR queues a overwrite buffer session-event.
This is mainly for the benefit of Mixbus, where input_latency
is not propagated upwards from the master bus (no direct
connection).
In Ardour's case _worst_input_latency >= _worst_route_latency
unless a given track with latent plugin is not connected.
Previously looping became out of sync (normal playback was not
affected) when a track had a latent plugin.