for backends w/o control, save a fake state with only the "active" attribute.

This makes ardour start directly with external jack without asking if jack
was previously used. It also retains jackd settings if jackd was previously
started by ardour.
This commit is contained in:
Robin Gareus 2014-06-23 04:26:53 +02:00
parent c13b74cd76
commit 371bf59a94
2 changed files with 30 additions and 20 deletions

View File

@ -1053,8 +1053,8 @@ EngineControl::get_matching_state (
{
for (StateList::iterator i = states.begin(); i != states.end(); ++i) {
if ((*i)->backend == backend &&
(*i)->driver == driver &&
(*i)->device == device) {
(!_have_control || ((*i)->driver == driver && (*i)->device == device)))
{
return (*i);
}
}
@ -1081,11 +1081,19 @@ EngineControl::get_saved_state_for_currently_displayed_backend_and_device ()
EngineControl::State
EngineControl::save_state ()
{
State state;
if (!_have_control) {
return State();
state = get_matching_state (backend_combo.get_active_text(), string(), string());
if (state) {
return state;
}
state.reset(new StateStruct);
state->backend = get_backend ();
} else {
state.reset(new StateStruct);
store_state (state);
}
State state (new StateStruct);
store_state (state);
for (StateList::iterator i = states.begin(); i != states.end();) {
if ((*i)->backend == state->backend &&
@ -1604,26 +1612,26 @@ EngineControl::post_push ()
* necessary
*/
if (_have_control) {
State state = get_saved_state_for_currently_displayed_backend_and_device ();
State state = get_saved_state_for_currently_displayed_backend_and_device ();
if (!state) {
state = save_state ();
assert (state);
}
if (!state) {
state = save_state ();
assert (state);
}
/* all off */
/* all off */
for (StateList::iterator i = states.begin(); i != states.end(); ++i) {
(*i)->active = false;
}
for (StateList::iterator i = states.begin(); i != states.end(); ++i) {
(*i)->active = false;
}
/* mark this one active (to be used next time the dialog is
* shown)
*/
/* mark this one active (to be used next time the dialog is
* shown)
*/
state->active = true;
state->active = true;
if (_have_control) { // XXX
manage_control_app_sensitivity ();
}

View File

@ -190,7 +190,9 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
std::vector<MidiDeviceSettings> midi_devices;
StateStruct()
: input_latency (0)
: sample_rate (48000)
, buffer_size (1024)
, input_latency (0)
, output_latency (0)
, input_channels (0)
, output_channels (0)