This replaces using ARDOUR_UI::disconnect_from_session which is only used by the
EngineControl class. ARDOUR_UI::disconnect_from_session also disconnects from
the AudioEngine::Halted signal which seems unnecessary as Halted is not emitted
when stopping the engine and calling update_sample_rate() which is already
handled when the AudioEngine::Stopped signal is emitted.
Use a single function with the complete logic.
Since the callgraph is complex, there is internal state as well as GUI
state (different pages), do not rely on individual methods to get it
right.
A widget's sensitivity should only be controlled by one function.
Connect to the backend_combo changed signal after setting state as calling
backend_combo.set_active_text() in set_state was triggering backend_changed(),
which would then see the driver_combo had not been set and set it to the
incorrect value.
The value/name of the backend needs to be restored first then we can populate
the driver combo and set the correct active entry from the saved state. After
which backend_changed() will populate the device combo's etc so they can then
be set to the correct active values from the saved state.
Some refactoring was necessary to avoid code duplication
Restoring of device state for input and output devices still doesn't work
correctly. I'm not quite sure what the issue is at this stage.
connect/disconnect button was connected multiple times
Also the button allowed to start a backend with
invalid settings (after changing backend).
Q: does “Connect to” make sense? It’s redundant with
“Apply”.
This makes ardour start directly with external jack without asking if jack
was previously used. It also retains jackd settings if jackd was previously
started by ardour.
every session member is now initialized using C++ constructor syntax
session construction reordered to clarify the split(s) between work
where the engine is not relevant and work where is it is. this
split is still not 100% obvious, but is enormously clearer than
previously.
if engine/backend are not running as session is created, and the SR
of the sample rate is known, attempt to force backend to that value.