Tidy up logging a bit. Make it configurable from the GUI.
[dcpomatic.git] / src / lib / config.cc
index d7503b848c75dad058e00cde6afaaf6fedffae10..6d029dd1fa1e545f7ebf0d28bac9ed840737f310 100644 (file)
@@ -61,6 +61,7 @@ Config::Config ()
        , _use_any_servers (true)
        , _tms_path (".")
        , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750")))
+       , _allow_any_dcp_frame_rate (false)
        , _default_still_length (10)
        , _default_container (Ratio::from_id ("185"))
        , _default_dcp_content_type (DCPContentType::from_dci_name ("TST"))
@@ -72,6 +73,7 @@ Config::Config ()
        , _check_for_updates (false)
        , _check_for_test_updates (false)
        , _maximum_j2k_bandwidth (250000000)
+       , _log_types (Log::GENERAL | Log::WARNING | Log::ERROR)
 {
        _allowed_dcp_frame_rates.push_back (24);
        _allowed_dcp_frame_rates.push_back (25);
@@ -187,6 +189,9 @@ Config::read ()
        _check_for_test_updates = f.optional_bool_child("CheckForTestUpdates").get_value_or (false);
 
        _maximum_j2k_bandwidth = f.optional_number_child<int> ("MaximumJ2KBandwidth").get_value_or (250000000);
+       _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate");
+
+       _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (Log::GENERAL | Log::WARNING | Log::ERROR);
 }
 
 void
@@ -363,7 +368,9 @@ Config::write () const
        root->add_child("CheckForTestUpdates")->add_child_text (_check_for_test_updates ? "1" : "0");
 
        root->add_child("MaximumJ2KBandwidth")->add_child_text (raw_convert<string> (_maximum_j2k_bandwidth));
-
+       root->add_child("AllowAnyDCPFrameRate")->add_child_text (_allow_any_dcp_frame_rate ? "1" : "0");
+       root->add_child("LogTypes")->add_child_text (raw_convert<string> (_log_types));
+       
        doc.write_to_file_formatted (file(false).string ());
 }