From: Robin Gareus Date: Sat, 1 Apr 2017 12:37:24 +0000 (+0200) Subject: Properly desensitize various engine-controls. X-Git-Tag: 5.9~503 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=8bed793b487255918d44564a2169a68296374213;p=ardour.git Properly desensitize various engine-controls. MIDI system and channel-count cannot be changed while the engine is running. --- diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 57a30abc99..31738bed15 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -779,6 +779,7 @@ EngineControl::update_sensitivity () bool valid = true; size_t devices_available = 0; + bool engine_running = ARDOUR::AudioEngine::instance()->running(); if (backend->use_separate_input_and_output_devices ()) { devices_available += get_popdown_string_count (input_device_combo); @@ -796,12 +797,12 @@ EngineControl::update_sensitivity () } else { input_latency.set_sensitive (true); output_latency.set_sensitive (true); - input_channels.set_sensitive (true); - output_channels.set_sensitive (true); + input_channels.set_sensitive (!engine_running); + output_channels.set_sensitive (!engine_running); } if (get_popdown_string_count (buffer_size_combo) > 0) { - if (!ARDOUR::AudioEngine::instance()->running()) { + if (!engine_running) { buffer_size_combo.set_sensitive (valid); } else if (backend->can_change_sample_rate_when_running()) { buffer_size_combo.set_sensitive (valid || !_have_control); @@ -827,7 +828,7 @@ EngineControl::update_sensitivity () if (get_popdown_string_count (sample_rate_combo) > 0) { bool allow_to_set_rate = false; - if (!ARDOUR::AudioEngine::instance()->running()) { + if (!engine_running) { if (!ARDOUR_UI::instance()->session_loaded) { // engine is not running, no session loaded -> anything goes. allow_to_set_rate = true; @@ -843,7 +844,7 @@ EngineControl::update_sensitivity () } if (get_popdown_string_count (nperiods_combo) > 0) { - if (!ARDOUR::AudioEngine::instance()->running()) { + if (!engine_running) { nperiods_combo.set_sensitive (true); } else { nperiods_combo.set_sensitive (false); @@ -855,7 +856,7 @@ EngineControl::update_sensitivity () if (_have_control) { start_stop_button.set_sensitive(true); start_stop_button.show(); - if (ARDOUR::AudioEngine::instance()->running()) { + if (engine_running) { start_stop_button.set_text("Stop"); update_devices_button.set_sensitive(false); use_buffered_io_button.set_sensitive(false); @@ -883,7 +884,7 @@ EngineControl::update_sensitivity () start_stop_button.hide(); } - if (ARDOUR::AudioEngine::instance()->running() && _have_control) { + if (engine_running && _have_control) { input_device_combo.set_sensitive (false); output_device_combo.set_sensitive (false); device_combo.set_sensitive (false); @@ -898,6 +899,8 @@ EngineControl::update_sensitivity () driver_combo.set_sensitive (false); } } + + midi_option_combo.set_sensitive (!engine_running); } void