diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-22 01:28:33 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-22 01:28:33 +0100 |
commit | 675444c7ddcf244e7f9685bfbc1cf819eb6eb653 (patch) | |
tree | 56cc4fe2fe862aa0ddb4cb1341754c8433f88f56 /gtk2_ardour/engine_dialog.cc | |
parent | 7e2f8bd872bed822193fc84d7afb682fdef33383 (diff) |
Engine: remember state only on “Apply” and “OK”
filed under “another scary engine dialog change”
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 742dce03f8..3f539a87bc 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -285,14 +285,11 @@ EngineControl::EngineControl () } if (backend_combo.get_active_text().empty()) { + PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1); backend_combo.set_active_text (backend_names.front()); } - { - /* ignore: don't save state */ - PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1); - backend_changed (); - } + backend_changed (); /* in case the setting the backend failed, e.g. stale config, from set_state(), try again */ if (0 == ARDOUR::AudioEngine::instance()->current_backend()) { @@ -1051,9 +1048,6 @@ EngineControl::sample_rate_changed () */ show_buffer_duration (); - if (!ignore_changes) { - save_state (); - } } @@ -1061,9 +1055,6 @@ void EngineControl::buffer_size_changed () { show_buffer_duration (); - if (!ignore_changes) { - save_state (); - } } void @@ -1137,18 +1128,11 @@ EngineControl::midi_option_changed () } else { midi_devices_button.set_sensitive (true); } - - if (!ignore_changes) { - save_state (); - } } void EngineControl::parameter_changed () { - if (!ignore_changes) { - save_state (); - } } EngineControl::State @@ -1460,7 +1444,7 @@ EngineControl::set_state (const XMLNode& root) for (StateList::const_iterator i = states.begin(); i != states.end(); ++i) { if ((*i)->active) { - ignore_changes++; + PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1); backend_combo.set_active_text ((*i)->backend); driver_combo.set_active_text ((*i)->driver); device_combo.set_active_text ((*i)->device); @@ -1469,7 +1453,6 @@ EngineControl::set_state (const XMLNode& root) input_latency.set_value ((*i)->input_latency); output_latency.set_value ((*i)->output_latency); midi_option_combo.set_active_text ((*i)->midi_option); - ignore_changes--; break; } } @@ -1740,6 +1723,8 @@ EngineControl::post_push () if (!state) { state = save_state (); assert (state); + } else { + store_state(state); } /* all off */ @@ -2208,7 +2193,7 @@ EngineControl::engine_stopped () void EngineControl::device_list_changed () { - PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1); + PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1); // ?? list_devices (); midi_option_changed(); } |