mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
restore last used driver+devices for a given backend.
This commit is contained in:
parent
3c9b71b50e
commit
b754c4341e
2 changed files with 25 additions and 0 deletions
|
|
@ -1021,6 +1021,15 @@ EngineControl::backend_changed ()
|
||||||
set_active_text_if_present (buffer_size_combo, bufsize_as_string (backend->buffer_size()));
|
set_active_text_if_present (buffer_size_combo, bufsize_as_string (backend->buffer_size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_have_control && !ignore_changes) {
|
||||||
|
// set driver & devices
|
||||||
|
State state = get_matching_state (backend_combo.get_active_text());
|
||||||
|
if (state) {
|
||||||
|
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
|
||||||
|
set_current_state (state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!ignore_changes) {
|
if (!ignore_changes) {
|
||||||
maybe_display_saved_state ();
|
maybe_display_saved_state ();
|
||||||
}
|
}
|
||||||
|
|
@ -1270,6 +1279,8 @@ EngineControl::driver_changed ()
|
||||||
backend->set_driver (driver_combo.get_active_text());
|
backend->set_driver (driver_combo.get_active_text());
|
||||||
list_devices ();
|
list_devices ();
|
||||||
|
|
||||||
|
// TODO load LRU device(s) for backend + driver combo
|
||||||
|
|
||||||
if (!ignore_changes) {
|
if (!ignore_changes) {
|
||||||
maybe_display_saved_state ();
|
maybe_display_saved_state ();
|
||||||
}
|
}
|
||||||
|
|
@ -1615,6 +1626,19 @@ EngineControl::parameter_changed ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EngineControl::State
|
||||||
|
EngineControl::get_matching_state (const string& backend)
|
||||||
|
{
|
||||||
|
for (StateList::iterator i = states.begin(); i != states.end(); ++i) {
|
||||||
|
// TODO use LRU for every backend and prefer the active one
|
||||||
|
// uniqueness is only guaranteed for backend + driver + device(s)
|
||||||
|
if ((*i)->backend == backend) {
|
||||||
|
return (*i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return State();
|
||||||
|
}
|
||||||
|
|
||||||
EngineControl::State
|
EngineControl::State
|
||||||
EngineControl::get_matching_state (
|
EngineControl::get_matching_state (
|
||||||
const string& backend,
|
const string& backend,
|
||||||
|
|
|
||||||
|
|
@ -234,6 +234,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
||||||
|
|
||||||
StateList states;
|
StateList states;
|
||||||
|
|
||||||
|
State get_matching_state (const std::string& backend);
|
||||||
State get_matching_state (const std::string& backend,
|
State get_matching_state (const std::string& backend,
|
||||||
const std::string& driver,
|
const std::string& driver,
|
||||||
const std::string& device);
|
const std::string& device);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue