Fix to ensure there are always sample rates and buffer sizes in the dropdown
authorTim Mayberry <mojofunk@gmail.com>
Tue, 11 Aug 2015 04:20:43 +0000 (14:20 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 11 Aug 2015 04:20:43 +0000 (14:20 +1000)
This can happen if both input and output devices are set to None for instance
on backends that report no supported SR or buffer size for the None device.

gtk2_ardour/engine_dialog.cc

index d3c1e14d08eb624d51abb210a9f88905b1fa481c..01450ecb0b3a0b561442e84ed6ef96cb936792b9 100644 (file)
@@ -1172,6 +1172,11 @@ EngineControl::set_samplerate_popdown_strings ()
 
        if (_have_control) {
                sr = get_sample_rates_for_all_devices ();
+               // currently possible if both devices are set to "None" and the backend
+               // returns no supported rates for both devices
+               if (sr.empty()) {
+                       sr = get_default_sample_rates ();
+               }
        } else {
                sr = get_default_sample_rates ();
        }
@@ -1257,6 +1262,11 @@ EngineControl::set_buffersize_popdown_strings ()
 
        if (_have_control) {
                bs = get_buffer_sizes_for_all_devices ();
+               // currently possible if both devices are set to "None" and the backend
+               // returns no supported sizes for both devices
+               if (bs.empty()) {
+                       bs = get_default_buffer_sizes ();
+               }
        } else if (backend->can_change_buffer_size_when_running()) {
                bs = get_default_buffer_sizes ();
        }