Previously Editor::instant_save() returned if no session was loaded,
effectively Config->add_instant_xml(get_state()); was never called.
instant save() is called early on, in Editor's c'tor before the editor
is realized and saves invalid window-size and window-state, which
are used later.
under some circumstances, e.g. session-exit it is possible to to have
inconsistent information
ARDOUR_UI::instance()->session_loaded == true
&& ARDOUR_UI::instance()->the_session() == NULL
This lead to a crash on MacOS/X. stopping the engine at exit may destory
an Aggregate Device, leading to DeviceListChanged which in turn updates
the engine-dialog..
else if (ARDOUR_UI::instance()->session_loaded) {
float active_sr = ARDOUR_UI::instance()->the_session()->nominal_sample_rate ();
There are two cases:
(A) Proxy is created first, dialog is created later on demand
(B) Dialog is created and directly registers its window as proxy
In (B) the dialog is usually on the stack and destroyed when the
ArdourDialog instances leaves scope. In that case ~ArdourDialog()
is called and the proxy remained.
Destroying the proxy does destroy the registered window in ~WindowProxy()
If ArdourDialog's d'tor itself deletes the proxy it would recurse into
itself. Existing APIs e.g. drop_window() likewise delete the window and
cannot be safely called from ~ArdourDialog.
Previously the ExportFormatDialog saved changes to disk on "save" but
did nothing on "cancel". The format changed *remained* modified in
memory, just not saved (until the ExportProfileManager is re-instantiated)
* callbacks are unregistered during session-deletion, skip saving them
during session destruction.
* prevent duplicate state restore, re-load script with the session, not
window instance.
Honor the sesssion's sample-rate when showing the dialog with the engine
stopped. This can happen when then engine dies or hide/show the dialog
after manually stopping the engine.
Previously EditorAction and ExitorHook scripts were saved with
instant.xml. The were saved with each session and in the config
dir (for new sessions). This allowed inconsistent UI setups, especially
when loading old sessions that had no or different scripts.
Now Editor scripts (actions and hooks) are saved in a dedicated file,
session-independently. This goes along with ui_config in general
e.g. action-table-columns
The scripts are not saved with ui_config file for two reasons:
ui_config settings related to built-in ui_config_vars.h,
and in the future there may be further indirection like "ui-rc-file".
Note: previously loaded editor scripts are lost with this change.