diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index a5accc6e9b..b2a60dca91 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -1068,21 +1068,21 @@ EngineControl::save_state () if (!_have_control) { return 0; } - - bool existing = true; - State* state = get_saved_state_for_currently_displayed_backend_and_device (); - - if (!state) { - existing = false; - state = new State; - } - + State* state = new State; store_state (*state); - if (!existing) { - states.push_back (*state); + for (StateList::iterator i = states.begin(); i != states.end();) { + if ((*i).backend == state->backend && + (*i).driver == state->driver && + (*i).device == state->device) { + i = states.erase(i); + } else { + ++i; + } } + states.push_back (*state); + return state; } @@ -1291,6 +1291,21 @@ EngineControl::set_state (const XMLNode& root) } } +#if 1 + /* remove accumulated duplicates (due to bug in ealier version) + * this can be removed again before release + */ + for (StateList::iterator i = states.begin(); i != states.end();) { + if ((*i).backend == state.backend && + (*i).driver == state.driver && + (*i).device == state.device) { + i = states.erase(i); + } else { + ++i; + } + } +#endif + states.push_back (state); } } @@ -1667,7 +1682,11 @@ EngineControl::get_backend () const string EngineControl::get_driver () const { - return driver_combo.get_active_text (); + if (driver_combo.get_sensitive() && driver_combo.get_parent()) { + return driver_combo.get_active_text (); + } else { + return ""; + } } string