first part of NSD changes - if no interface has been identified previously, put the...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 16 Sep 2009 22:13:39 +0000 (22:13 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 16 Sep 2009 22:13:39 +0000 (22:13 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5669 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/engine_dialog.cc
gtk2_ardour/engine_dialog.h
gtk2_ardour/new_session_dialog.cc

index 22dd1e39fd00604389d77159ef0711c4992f3366..90151fb85d516f43a8b1189eff45c35b57fdf83e 100644 (file)
@@ -73,6 +73,7 @@ EngineControl::EngineControl ()
        int row = 0;
 
        _used = false;
+       _interface_chosen = false;
 
        strings.push_back (_("8000Hz"));
        strings.push_back (_("22050Hz"));
@@ -501,6 +502,7 @@ EngineControl::build_command_line (vector<string>& cmd)
 
                        cmd.push_back ("-d");
                        cmd.push_back (device);
+                       _interface_chosen = true;
                } 
 
                if (hw_meter_button.get_active()) {
@@ -1173,16 +1175,21 @@ EngineControl::set_state (const XMLNode& root)
        clist = root.children();
 
        for (citer = clist.begin(); citer != clist.end(); ++citer) {
-               if ( prop && (prop->value() == "FFADO" ))
-                               continue;
+
+               if (prop && (prop->value() == "FFADO" )) {
+                       continue;
+               }
+
                child = *citer;
 
                prop = child->property ("val");
 
                if (!prop || prop->value().empty()) {
 
-                       if ( using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" ))
+                       if (using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" )) {
                                continue;
+                       }
+
                        error << string_compose (_("AudioSetup value for %1 is missing data"), child->name()) << endmsg;
                        continue;
                }
@@ -1282,6 +1289,9 @@ EngineControl::set_state (const XMLNode& root)
                        driver_combo.set_active_text(strval);
                } else if (child->name() == "interface") {
                        interface_combo.set_active_text(strval);
+                       if (!strval.empty()) {
+                               _interface_chosen = true;
+                       }
                } else if (child->name() == "timeout") {
                        timeout_combo.set_active_text(strval);
                } else if (child->name() == "dither") {
index 3a2138e4cc998e2ec782bd2cf04884eb4a6ee3e8..c439719d752f298b6cec2ed1933973ae51130773 100644 (file)
@@ -24,6 +24,7 @@ class EngineControl : public Gtk::VBox {
        int setup_engine ();
        void discover_servers ();
 
+       bool interface_chosen () const { return _interface_chosen; }
        bool was_used() const { return _used; }
        XMLNode& get_state ();
        void set_state (const XMLNode&);
@@ -77,6 +78,7 @@ class EngineControl : public Gtk::VBox {
        Gtk::Notebook notebook;
        
        bool _used;
+       bool _interface_chosen;
 
        void realtime_changed ();
        void driver_changed ();
index f7634c845811482a1b0c23acc27868d64ce76dae..b094e3a635443d726e11ea8a898d744262c6282f 100644 (file)
@@ -495,7 +495,12 @@ NewSessionDialog::set_have_engine (bool yn)
        } else {
                if (!(page_set & EnginePage)) {
                        engine_control.discover_servers ();
-                       m_notebook->append_page (engine_control, _("Audio Setup"));
+                       if (engine_control.interface_chosen()) {
+                               m_notebook->append_page (engine_control, _("Audio Setup"));
+                       } else {
+                               /* no interface ever selected - make it the first page */
+                               m_notebook->prepend_page (engine_control, _("Audio Setup"));
+                       }
                        m_notebook->show_all_children();
                        page_set = Pages (page_set | EnginePage);
                }