Config option to disable preview audio.
[dcpomatic.git] / src / lib / config.cc
index b099cbc85c00531bebaf6f0f31c6fea5e2e45584..01a67522f264b8477f812dbbbd73c068d90f8e6b 100644 (file)
@@ -116,7 +116,8 @@ Config::set_defaults ()
        _dcp_metadata_filename_format = dcp::NameFormat ("%t");
        _dcp_asset_filename_format = dcp::NameFormat ("%t");
        _jump_to_selected = true;
-       _sound_output = optional<string> ();
+       _preview_sound = false;
+       _preview_sound_output = optional<string> ();
 
        _allowed_dcp_frame_rates.clear ();
        _allowed_dcp_frame_rates.push_back (24);
@@ -310,7 +311,8 @@ try
        _dcp_metadata_filename_format = dcp::NameFormat (f.optional_string_child("DCPMetadataFilenameFormat").get_value_or ("%t"));
        _dcp_asset_filename_format = dcp::NameFormat (f.optional_string_child("DCPAssetFilenameFormat").get_value_or ("%t"));
        _jump_to_selected = f.optional_bool_child("JumpToSelected").get_value_or (true);
-       _sound_output = f.optional_string_child("SoundOutput");
+       _preview_sound = f.optional_bool_child("PreviewSound").get_value_or (false);
+       _preview_sound_output = f.optional_string_child("PreviewSoundOutput");
 
        /* Replace any cinemas from config.xml with those from the configured file */
        if (boost::filesystem::exists (_cinemas_file)) {
@@ -479,8 +481,9 @@ Config::write_config () const
        root->add_child("DCPMetadataFilenameFormat")->add_child_text (_dcp_metadata_filename_format.specification ());
        root->add_child("DCPAssetFilenameFormat")->add_child_text (_dcp_asset_filename_format.specification ());
        root->add_child("JumpToSelected")->add_child_text (_jump_to_selected ? "1" : "0");
-       if (_sound_output) {
-               root->add_child("SoundOutput")->add_child_text (_sound_output.get());
+       root->add_child("PreviewSound")->add_child_text (_preview_sound ? "1" : "0");
+       if (_preview_sound_output) {
+               root->add_child("PreviewSoundOutput")->add_child_text (_preview_sound_output.get());
        }
 
        try {