This can be used to ensure that whenever this has a reference to a session, it
also has a session controller set up to use that session. Towards sharing code
between ARDOUR_UI and SessionController.
WIP: SessionHandleRef|Ptr are not safe abstractions, so this isn't either,
since derived types can and do manually mess around with the session pointer.
Probably lifetime bugs here, and probably a good idea to statically prevent
that, but a /lot/ of existing code uses _session directly.
This allows it to be used without including session.h. Using this pointless
cast syntax to make it easy to mechanically convert them all when we can
finally use strong enums.
Control surface lifetime is managed to be shorter than the session lifetime, if
the session does not exist, then the control surface does not exist either.
Control Points should ignore x_constraint which is set in Drag::motion and potentially other places.
The only thing that should prevent CP sliding is can_slide which is false for the points at the ends of a region.
There is no need to connect signals twice, can connect them directly to the
helper UI loop and skip the surface loop. Then let the server decide if it is
necessary to call lws_cancel_service() or not.
Also rename WebsocketsServer::should_request_write() to read_blocks_event_loop()
it makes more sense for the caller now on-demand write logic is completely
implemented by the server class.
In between timespans Ardour disables freewheeling and
only later resumes freewheel. It can happen that
Session::process can summon the butler while start_audio_export()
calls Track::seek.
Just waiting for an earlier Butler::wait_until_finished() does
not prevent the butler from running again later.
This can lead to concurrent calls of DR::refill_audio from both
the butler and start_audio_export(), leading to garbled buffers.
ExportHandler::start_timespan() is also used to stop export
when there are no more timespans to be processed.
This is done because freewheeling has to be stopped from
outside the process cycle.
This is an update to the surface ArdourFeedback class that is needed to support
the new event loop integration method.
The various session event callbacks cannot be queued in the surface event loop
because that would create a delay between the time such events are fired and
the time for writing to clients arrive, due to lws_service() blocking while
it waits to read. To solve this issue a helper AbstractUI is created for
catching events as soon as possible and issuing a call to lws_cancel_service().
See WebsocketsServer::glib_idle_callback()