mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
Engine Dialog: Don't save duplicate states (and remove old dups)
This commit is contained in:
parent
ff39a42581
commit
f2404a522d
1 changed files with 31 additions and 12 deletions
|
|
@ -1068,20 +1068,20 @@ 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
|
||||
{
|
||||
if (driver_combo.get_sensitive() && driver_combo.get_parent()) {
|
||||
return driver_combo.get_active_text ();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue