fixup! Lay things out better with long audio output names.
[dcpomatic.git] / src / lib / config.cc
index 81daff5b6bed8e2eee19ee743ec56391ab0f7489..c51f729b8dc7990fe69ad4803a13391e04492204 100644 (file)
@@ -94,6 +94,7 @@ Config::set_defaults ()
        _servers.clear ();
        _only_servers_encode = false;
        _tms_protocol = FileTransferProtocol::SCP;
+       _tms_passive = true;
        _tms_ip = "";
        _tms_path = ".";
        _tms_user = "";
@@ -151,6 +152,7 @@ Config::set_defaults ()
                _nagged[i] = false;
        }
        _sound = true;
+       _sound_api = boost::none;
        _sound_output = optional<string> ();
        _last_kdm_write_type = KDM_WRITE_FLAT;
        _last_dkdm_write_type = DKDM_WRITE_INTERNAL;
@@ -325,6 +327,7 @@ try
 
        _only_servers_encode = f.optional_bool_child ("OnlyServersEncode").get_value_or (false);
        _tms_protocol = static_cast<FileTransferProtocol>(f.optional_number_child<int>("TMSProtocol").get_value_or(static_cast<int>(FileTransferProtocol::SCP)));
+       _tms_passive = f.optional_bool_child("TMSPassive").get_value_or(true);
        _tms_ip = f.string_child ("TMSIP");
        _tms_path = f.string_child ("TMSPath");
        _tms_user = f.string_child ("TMSUser");
@@ -521,6 +524,7 @@ try
        _jump_to_selected = f.optional_bool_child("JumpToSelected").get_value_or (true);
        /* The variable was renamed but not the XML tag */
        _sound = f.optional_bool_child("PreviewSound").get_value_or (true);
+       _sound_api = f.optional_string_child("PreviewSoundAPI");
        _sound_output = f.optional_string_child("PreviewSoundOutput");
        if (f.optional_string_child("CoverSheet")) {
                _cover_sheet = f.optional_string_child("CoverSheet").get();
@@ -719,6 +723,8 @@ Config::write_config () const
        root->add_child("OnlyServersEncode")->add_child_text (_only_servers_encode ? "1" : "0");
        /* [XML] TMSProtocol Protocol to use to copy files to a TMS; 0 to use SCP, 1 for FTP. */
        root->add_child("TMSProtocol")->add_child_text (raw_convert<string> (static_cast<int> (_tms_protocol)));
+       /* [XML] TMSPassive True to use PASV mode with TMS FTP connections. */
+       root->add_child("TMSPassive")->add_child_text(_tms_passive ? "1" : "0");
        /* [XML] TMSIP IP address of TMS. */
        root->add_child("TMSIP")->add_child_text (_tms_ip);
        /* [XML] TMSPath Path on the TMS to copy files to. */
@@ -934,6 +940,10 @@ Config::write_config () const
        }
        /* [XML] PreviewSound 1 to use sound in the GUI preview and player, otherwise 0. */
        root->add_child("PreviewSound")->add_child_text (_sound ? "1" : "0");
+       if (_sound_api) {
+               /* [XML:opt] PreviewSoundAPI Name of the audio API to use. */
+               root->add_child("PreviewSoundAPI")->add_child_text(_sound_api.get());
+       }
        if (_sound_output) {
                /* [XML:opt] PreviewSoundOutput Name of the audio output to use. */
                root->add_child("PreviewSoundOutput")->add_child_text (_sound_output.get());