fix empty/unset sync source preference.
authorRobin Gareus <robin@gareus.org>
Mon, 23 Mar 2015 22:18:47 +0000 (23:18 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 23 Mar 2015 22:18:47 +0000 (23:18 +0100)
(non JACK backends w/JACK-transport)

gtk2_ardour/rc_option_editor.cc

index b2cf7f0ae42184010765cf16651380ad24fa62cd..4198324b61db2679839ce8125bc097843d3715f9 100644 (file)
@@ -1503,7 +1503,6 @@ RCOptionEditor::RCOptionEditor ()
                sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_source)
                );
 
-       populate_sync_options ();
        add_option (_("Transport"), _sync_source);
 
        _sync_framerate = new BoolOption (
@@ -1575,6 +1574,8 @@ RCOptionEditor::RCOptionEditor ()
        AudioEngine::instance()->get_physical_inputs (DataType::AUDIO, physical_inputs);
        _ltc_port->set_popdown_strings (physical_inputs);
 
+       populate_sync_options ();
+
        add_option (_("Transport"), _ltc_port);
 
        // TODO; rather disable this button than not compile it..
@@ -2508,4 +2509,12 @@ RCOptionEditor::populate_sync_options ()
        for (vector<SyncSource>::iterator i = sync_opts.begin(); i != sync_opts.end(); ++i) {
                _sync_source->add (*i, sync_source_to_string (*i));
        }
+
+       if (sync_opts.empty()) {
+               _sync_source->set_sensitive(false);
+       } else {
+               if (std::find(sync_opts.begin(), sync_opts.end(), _rc_config->get_sync_source()) == sync_opts.end()) {
+                       _rc_config->set_sync_source(sync_opts.front());
+               }
+       }
 }