Properly desensitize various engine-controls.
MIDI system and channel-count cannot be changed while the engine is running.
This commit is contained in:
parent
752706911e
commit
8bed793b48
|
@ -779,6 +779,7 @@ EngineControl::update_sensitivity ()
|
||||||
|
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
size_t devices_available = 0;
|
size_t devices_available = 0;
|
||||||
|
bool engine_running = ARDOUR::AudioEngine::instance()->running();
|
||||||
|
|
||||||
if (backend->use_separate_input_and_output_devices ()) {
|
if (backend->use_separate_input_and_output_devices ()) {
|
||||||
devices_available += get_popdown_string_count (input_device_combo);
|
devices_available += get_popdown_string_count (input_device_combo);
|
||||||
|
@ -796,12 +797,12 @@ EngineControl::update_sensitivity ()
|
||||||
} else {
|
} else {
|
||||||
input_latency.set_sensitive (true);
|
input_latency.set_sensitive (true);
|
||||||
output_latency.set_sensitive (true);
|
output_latency.set_sensitive (true);
|
||||||
input_channels.set_sensitive (true);
|
input_channels.set_sensitive (!engine_running);
|
||||||
output_channels.set_sensitive (true);
|
output_channels.set_sensitive (!engine_running);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_popdown_string_count (buffer_size_combo) > 0) {
|
if (get_popdown_string_count (buffer_size_combo) > 0) {
|
||||||
if (!ARDOUR::AudioEngine::instance()->running()) {
|
if (!engine_running) {
|
||||||
buffer_size_combo.set_sensitive (valid);
|
buffer_size_combo.set_sensitive (valid);
|
||||||
} else if (backend->can_change_sample_rate_when_running()) {
|
} else if (backend->can_change_sample_rate_when_running()) {
|
||||||
buffer_size_combo.set_sensitive (valid || !_have_control);
|
buffer_size_combo.set_sensitive (valid || !_have_control);
|
||||||
|
@ -827,7 +828,7 @@ EngineControl::update_sensitivity ()
|
||||||
|
|
||||||
if (get_popdown_string_count (sample_rate_combo) > 0) {
|
if (get_popdown_string_count (sample_rate_combo) > 0) {
|
||||||
bool allow_to_set_rate = false;
|
bool allow_to_set_rate = false;
|
||||||
if (!ARDOUR::AudioEngine::instance()->running()) {
|
if (!engine_running) {
|
||||||
if (!ARDOUR_UI::instance()->session_loaded) {
|
if (!ARDOUR_UI::instance()->session_loaded) {
|
||||||
// engine is not running, no session loaded -> anything goes.
|
// engine is not running, no session loaded -> anything goes.
|
||||||
allow_to_set_rate = true;
|
allow_to_set_rate = true;
|
||||||
|
@ -843,7 +844,7 @@ EngineControl::update_sensitivity ()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_popdown_string_count (nperiods_combo) > 0) {
|
if (get_popdown_string_count (nperiods_combo) > 0) {
|
||||||
if (!ARDOUR::AudioEngine::instance()->running()) {
|
if (!engine_running) {
|
||||||
nperiods_combo.set_sensitive (true);
|
nperiods_combo.set_sensitive (true);
|
||||||
} else {
|
} else {
|
||||||
nperiods_combo.set_sensitive (false);
|
nperiods_combo.set_sensitive (false);
|
||||||
|
@ -855,7 +856,7 @@ EngineControl::update_sensitivity ()
|
||||||
if (_have_control) {
|
if (_have_control) {
|
||||||
start_stop_button.set_sensitive(true);
|
start_stop_button.set_sensitive(true);
|
||||||
start_stop_button.show();
|
start_stop_button.show();
|
||||||
if (ARDOUR::AudioEngine::instance()->running()) {
|
if (engine_running) {
|
||||||
start_stop_button.set_text("Stop");
|
start_stop_button.set_text("Stop");
|
||||||
update_devices_button.set_sensitive(false);
|
update_devices_button.set_sensitive(false);
|
||||||
use_buffered_io_button.set_sensitive(false);
|
use_buffered_io_button.set_sensitive(false);
|
||||||
|
@ -883,7 +884,7 @@ EngineControl::update_sensitivity ()
|
||||||
start_stop_button.hide();
|
start_stop_button.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ARDOUR::AudioEngine::instance()->running() && _have_control) {
|
if (engine_running && _have_control) {
|
||||||
input_device_combo.set_sensitive (false);
|
input_device_combo.set_sensitive (false);
|
||||||
output_device_combo.set_sensitive (false);
|
output_device_combo.set_sensitive (false);
|
||||||
device_combo.set_sensitive (false);
|
device_combo.set_sensitive (false);
|
||||||
|
@ -898,6 +899,8 @@ EngineControl::update_sensitivity ()
|
||||||
driver_combo.set_sensitive (false);
|
driver_combo.set_sensitive (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
midi_option_combo.set_sensitive (!engine_running);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user