Remove an unnecessary boolean argument in jack utils
[ardour.git] / libs / backends / jack / jack_utils.cc
index 029b922f7343e7d7658dd37a24e3c2888f54d903..6fb3201c99802fb0b859f18646ee2d034db45c81 100644 (file)
 #include <portaudio.h>
 #endif
 
-#include <fstream>
-
 #include <boost/scoped_ptr.hpp>
 
+#include "pbd/gstdio_compat.h"
 #include <glibmm/miscutils.h>
 
 #include "pbd/epa.h"
@@ -689,7 +688,7 @@ ARDOUR::JackCommandLineOptions::JackCommandLineOptions ()
 }
 
 bool
-ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& command_line, bool for_latency_measurement)
+ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& command_line)
 {
        vector<string> args;
 
@@ -842,7 +841,7 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
        args.push_back ("-p");
        args.push_back (to_string (options.period_size, std::dec));
 
-       if (!for_latency_measurement && get_jack_audio_driver_supports_latency_adjustment (options.driver)) {
+       if (get_jack_audio_driver_supports_latency_adjustment (options.driver)) {
                if (options.input_latency) {
                        args.push_back ("-I");
                        args.push_back (to_string (options.input_latency, std::dec));
@@ -927,15 +926,10 @@ ARDOUR::get_jack_server_user_config_file_path ()
 bool
 ARDOUR::write_jack_config_file (const std::string& config_file_path, const string& command_line)
 {
-       ofstream jackdrc (config_file_path.c_str());
-
-       if (!jackdrc) {
+       if (!g_file_set_contents (config_file_path.c_str(), command_line.c_str(), -1, NULL)) {
                error << string_compose (_("cannot open JACK rc file %1 to store parameters"), config_file_path) << endmsg;
                return false;
        }
-
-       jackdrc << command_line << endl;
-       jackdrc.close ();
        return true;
 }