do not look for (and potentially exit) jack servers if jack is already running
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 May 2009 13:44:37 +0000 (13:44 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 May 2009 13:44:37 +0000 (13:44 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5100 d708f5d6-7413-0410-9779-e7cbd77b26cf

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

index cf08f4ad680891d090704a77c435782e616846e0..74e1ab6508bf77095e7d45f30705b5b323586c94 100644 (file)
@@ -276,23 +276,8 @@ EngineControl::EngineControl ()
        ++row;
 #endif
 
-       find_jack_servers (server_strings);
-
-       if (server_strings.empty()) {
-               fatal << _("No JACK server found anywhere on this system. Please install JACK and restart") << endmsg;
-               /*NOTREACHED*/
-       }
-       
-       set_popdown_strings (serverpath_combo, server_strings);
-       serverpath_combo.set_active_text (server_strings.front());
-
-       if (server_strings.size() > 1) {
-               label = manage (new Label (_("Server:")));
-               options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
-               label->set_alignment (0.0, 0.5);
-               options_packer.attach (serverpath_combo, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
-               ++row;
-       }
+       /* defer server stuff till later */
+       server_row = row++;
 
        /* device settings */
 
@@ -353,6 +338,27 @@ EngineControl::~EngineControl ()
 
 }
 
+void
+EngineControl::discover_servers ()
+{
+       find_jack_servers (server_strings);
+
+       if (server_strings.empty()) {
+               fatal << _("No JACK server found anywhere on this system. Please install JACK and restart") << endmsg;
+               /*NOTREACHED*/
+       }
+       
+       set_popdown_strings (serverpath_combo, server_strings);
+       serverpath_combo.set_active_text (server_strings.front());
+
+       if (server_strings.size() > 1) {
+               Gtk::Label* label = manage (new Label (_("Server:")));
+               options_packer.attach (*label, 0, 1, server_row, server_row + 1, FILL|EXPAND, (AttachOptions) 0);
+               label->set_alignment (0.0, 0.5);
+               options_packer.attach (serverpath_combo, 1, 2, server_row, server_row + 1, FILL|EXPAND, (AttachOptions) 0);
+       }
+}
+
 void
 EngineControl::build_command_line (vector<string>& cmd)
 {
index 9e6eaf42d6be4761db0a72dfe4631728fe2598f6..3a2138e4cc998e2ec782bd2cf04884eb4a6ee3e8 100644 (file)
@@ -22,6 +22,7 @@ class EngineControl : public Gtk::VBox {
 
        static bool engine_running ();
        int setup_engine ();
+       void discover_servers ();
 
        bool was_used() const { return _used; }
        XMLNode& get_state ();
@@ -99,6 +100,7 @@ class EngineControl : public Gtk::VBox {
        uint32_t get_rate();
        void audio_mode_changed ();
        std::vector<std::string> server_strings;
+       int server_row;
        void find_jack_servers (std::vector<std::string>&);
        std::string get_device_name (const std::string& driver, const std::string& human_readable_name);
 };
index c02d9b18f6a6e7a8c54ecd1333f99a534531a51f..023b6063ba112dc408b2922b39db6d32d117b8ff 100644 (file)
@@ -493,6 +493,7 @@ NewSessionDialog::set_have_engine (bool yn)
                page_set = Pages (page_set & ~EnginePage);
        } else {
                if (!(page_set & EnginePage)) {
+                       engine_control.discover_servers ();
                        m_notebook->append_page (engine_control, _("Audio Setup"));
                        m_notebook->show_all_children();
                        page_set = Pages (page_set | EnginePage);