Remove ARDOUR::start_jack_server now that jack autostart works on windows
authorTim Mayberry <mojofunk@gmail.com>
Thu, 25 Jul 2013 05:06:49 +0000 (15:06 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Fri, 6 Sep 2013 04:30:19 +0000 (14:30 +1000)
libs/ardour/ardour/jack_utils.h
libs/ardour/jack_utils.cc
libs/ardour/test/jack_utils_test.cc
libs/ardour/test/jack_utils_test.h

index 353724f0791c2af29d970591fe1a189d2de46d09..40eb30f9ea9c7a18802be6b69690cc713e156c33 100644 (file)
@@ -250,12 +250,4 @@ namespace ARDOUR {
         * We don't need this at the moment because the gui stores all its settings
         */
        //std::string get_jack_command_line_from_config_file (const std::string& config_file_path);
-
-       /**
-        * Temporary for WIN32 only as jack_client_open doesn't start the server on that platform
-        *
-        * @return true if server was able to be started
-        */
-       bool start_jack_server (const std::string& command_line);
-
 }
index ecbf8976fdaf92fb61a7cb0e89e9223df0c645ea..d9e5f00cca4202681b6a3993c5aaaf4bffdd46b7 100644 (file)
@@ -916,43 +916,3 @@ ARDOUR::write_jack_config_file (const std::string& config_file_path, const strin
        jackdrc.close ();
        return true;
 }
-
-bool
-ARDOUR::start_jack_server (const string& command_line)
-{
-#ifdef PLATFORM_WINDOWS
-       STARTUPINFO si;
-       PROCESS_INFORMATION pi;
-       char * cmdline = g_strdup (command_line.c_str());
-
-       memset (&si, 0, sizeof (si));
-       si.cb = sizeof (&si);
-       memset (&pi, 0, sizeof (pi));
-
-       if (!CreateProcess (
-                       NULL,                  // No module name, use command line
-                       cmdline,
-                       NULL,                  // Process handle not inheritable
-                       NULL,                  // Thread handle not inheritable
-                       FALSE,                 // set handle inheritance to false
-                       0,                     // No creation flags
-                       NULL,                  // Use parents environment block
-                       NULL,                  // Use parents starting directory
-                       &si,
-                       &pi))
-       {
-               error << string_compose ("cannot start JACK server: %s", g_win32_error_message (GetLastError ())) << endmsg;
-       }
-
-       g_free (cmdline);
-
-       // wait for 2 seconds for server to start
-       for (int i = 0; i < 8; ++i) {
-               Sleep (250); // 1/4 second
-               if (jack_server_running ()) return true;
-       }
-#else
-        (void) command_line;
-#endif
-       return false;
-}
index ce92955b7d94bf0de8377eb5fa56ef384258166c..9d5e433192e4976cc7404d4cb91e52e90d6e2239 100644 (file)
@@ -270,46 +270,3 @@ JackUtilsTest::test_command_line ()
 
        cout << "Default JACK command line: " << command_line << endl;
 }
-
-void
-JackUtilsTest::test_start_server ()
-{
-#ifdef PLATFORM_WINDOWS
-       cout << endl;
-
-       JackCommandLineOptions options;
-
-       CPPUNIT_ASSERT (get_jack_default_server_path (options.server_path));
-
-       cout << "Starting JACK server at path: " << options.server_path << endl;
-
-       get_jack_default_audio_driver_name (options.driver);
-
-       vector<string> devices = get_jack_device_names_for_audio_driver (options.driver);
-
-       if (!devices.empty()) {
-               options.input_device = devices.front ();
-               options.output_device = devices.front ();
-       } else {
-               cout << "No audio devices available using default JACK driver using Dummy driver" << endl;
-               options.driver = dummy_driver_name;
-               devices = get_jack_device_names_for_audio_driver (options.driver);
-               CPPUNIT_ASSERT (!devices.empty ());
-               options.input_device = devices.front ();
-               options.output_device = devices.front ();
-       }
-
-       string command_line;
-       // this at least should create a valid jack command line
-       CPPUNIT_ASSERT (get_jack_command_line_string (options, command_line));
-
-       cout << "Calling start_jack_server with command line: " << command_line << endl;
-
-       CPPUNIT_ASSERT (start_jack_server (command_line));
-
-       // sleep for 10 seconds
-       Sleep (10*1000);
-
-       CPPUNIT_ASSERT (jack_server_running ());
-#endif
-}
index 6a42d1d015dde4b0ba2d13d407dde4bd32212389..08fad2fc3680fdac24241aa71860e5bce0686441 100644 (file)
@@ -15,7 +15,6 @@ class JackUtilsTest : public CppUnit::TestFixture
        CPPUNIT_TEST (test_server_paths);
        CPPUNIT_TEST (test_config);
        CPPUNIT_TEST (test_command_line);
-       CPPUNIT_TEST (test_start_server);
        CPPUNIT_TEST_SUITE_END ();
 
 public:
@@ -29,5 +28,4 @@ public:
        void test_server_paths ();
        void test_config ();
        void test_command_line ();
-       void test_start_server ();
 };