Remove ARDOUR::start_jack_server now that jack autostart works on windows

This commit is contained in:
Tim Mayberry 2013-07-25 15:06:49 +10:00
parent d9994c10b4
commit 538a1e79c4
4 changed files with 0 additions and 93 deletions

View 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);
}

View 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;
}

View 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
}

View 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 ();
};