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 committed by Paul Davis
parent 71e3f4a72c
commit 8798f8d88a
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 state (new StateStruct);
state.reset(new StateStruct);
state->backend = get_backend ();
} else {
state.reset(new StateStruct);
store_state (state);
}
for (StateList::iterator i = states.begin(); i != states.end();) {
if ((*i)->backend == state->backend &&
@ -1604,7 +1612,6 @@ EngineControl::post_push ()
* necessary
*/
if (_have_control) {
State state = get_saved_state_for_currently_displayed_backend_and_device ();
if (!state) {
@ -1624,6 +1631,7 @@ EngineControl::post_push ()
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)