X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fconfig.cc;h=ca8d0bc53c407182c8b39dc0770648574f1d9e51;hp=1c34619b42beeef2812880ae3001b80845e33c98;hb=854f2e5bbb7ffb9758b823af87034033033f3cb8;hpb=5323e65637177f9003a3a6fc6d16318efef250a6 diff --git a/src/lib/config.cc b/src/lib/config.cc index 1c34619b4..ca8d0bc53 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "config.h" #include "server.h" @@ -63,11 +63,14 @@ Config::Config () , _default_still_length (10) , _default_container (Ratio::from_id ("185")) , _default_dcp_content_type (DCPContentType::from_dci_name ("TST")) - , _default_j2k_bandwidth (200000000) + , _default_j2k_bandwidth (100000000) , _default_audio_delay (0) , _kdm_email ( - "Dear Projectionist\n\nPlease find attached KDMs for $CPL_NAME.\n\nThe KDMs are valid from $START_TIME until $END_TIME.\n\nBest regards,\nDCP-o-matic" + _("Dear Projectionist\n\nPlease find attached KDMs for $CPL_NAME.\n\nThe KDMs are valid from $START_TIME until $END_TIME.\n\nBest regards,\nDCP-o-matic") ) + , _check_for_updates (false) + , _check_for_test_updates (false) + , _maximum_j2k_bandwidth (250000000) { _allowed_dcp_frame_rates.push_back (24); _allowed_dcp_frame_rates.push_back (25); @@ -76,9 +79,9 @@ Config::Config () _allowed_dcp_frame_rates.push_back (50); _allowed_dcp_frame_rates.push_back (60); - _colour_conversions.push_back (PresetColourConversion (_("sRGB"), 2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6)); - _colour_conversions.push_back (PresetColourConversion (_("sRGB non-linearised"), 2.4, false, libdcp::colour_matrix::srgb_to_xyz, 2.6)); - _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, libdcp::colour_matrix::rec709_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("sRGB"), 2.4, true, dcp::colour_matrix::srgb_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("sRGB non-linearised"), 2.4, false, dcp::colour_matrix::srgb_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, dcp::colour_matrix::rec709_to_xyz, 2.6)); } void @@ -162,7 +165,7 @@ Config::read () /* Loading version 0 (before Rec. 709 was added as a preset). Add it in. */ - _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, libdcp::colour_matrix::rec709_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, dcp::colour_matrix::rec709_to_xyz, 2.6)); } list cin = f.node_children ("Cinema"); @@ -180,6 +183,11 @@ Config::read () _mail_password = f.optional_string_child("MailPassword").get_value_or (""); _kdm_from = f.string_child ("KDMFrom"); _kdm_email = f.string_child ("KDMEmail"); + + _check_for_updates = f.optional_bool_child("CheckForUpdates").get_value_or (false); + _check_for_test_updates = f.optional_bool_child("CheckForTestUpdates").get_value_or (false); + + _maximum_j2k_bandwidth = f.optional_number_child ("MaximumJ2KBandwidth").get_value_or (250000000); } void @@ -354,6 +362,11 @@ Config::write () const root->add_child("KDMFrom")->add_child_text (_kdm_from); root->add_child("KDMEmail")->add_child_text (_kdm_email); + root->add_child("CheckForUpdates")->add_child_text (_check_for_updates ? "1" : "0"); + root->add_child("CheckForTestUpdates")->add_child_text (_check_for_test_updates ? "1" : "0"); + + root->add_child("MaximumJ2KBandwidth")->add_child_text (lexical_cast (_maximum_j2k_bandwidth)); + doc.write_to_file_formatted (file(false).string ()); } @@ -379,3 +392,10 @@ Config::drop () delete _instance; _instance = 0; } + +void +Config::changed () +{ + write (); + Changed (); +}