X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.h;h=29f401755b06cf814db5c1cb2207848099053d9e;hb=d311043bf3c1e3e7f41b314f7ab7c91ed7e5aa7f;hp=5981e799488f0a1dd7ad8a3b2a4a1d13c1d91983;hpb=ccacce39c39d16977ab6c1592fcb6e941b05ddff;p=dcpomatic.git diff --git a/src/lib/config.h b/src/lib/config.h index 5981e7994..29f401755 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2021 Carl Hetherington + Copyright (C) 2012-2022 Carl Hetherington This file is part of DCP-o-matic. @@ -22,12 +22,14 @@ * @brief Class holding configuration. */ + #ifndef DCPOMATIC_CONFIG_H #define DCPOMATIC_CONFIG_H -#include "types.h" -#include "state.h" + #include "audio_mapping.h" +#include "state.h" +#include "types.h" #include #include #include @@ -36,13 +38,18 @@ #include #include + +class Cinema; class CinemaSoundProcessor; class DCPContentType; -class Ratio; -class Cinema; -class Film; class DKDMGroup; class DKDMRecipient; +class Film; +class Ratio; + + +extern void save_all_config_as_zip (boost::filesystem::path zip_file); + /** @class Config * @brief A singleton class holding configuration. @@ -140,11 +147,11 @@ public: return _tms_password; } - std::list > cinemas () const { + std::list> cinemas () const { return _cinemas; } - std::list > dkdm_recipients () const { + std::list> dkdm_recipients () const { return _dkdm_recipients; } @@ -397,11 +404,12 @@ public: NAG_DKDM_CONFIG, NAG_ENCRYPTED_METADATA, NAG_ALTER_DECRYPTION_CHAIN, - NAG_BAD_SIGNER_CHAIN, + NAG_BAD_SIGNER_CHAIN_UTF8, NAG_IMPORT_DECRYPTION_CHAIN, NAG_DELETE_DKDM, NAG_32_ON_64, NAG_TOO_MANY_DROPPED_FRAMES, + NAG_BAD_SIGNER_CHAIN_VALIDITY, NAG_COUNT }; @@ -517,10 +525,6 @@ public: return _respect_kdm_validity_periods; } - boost::optional player_activity_log_file () const { - return _player_activity_log_file; - } - boost::optional player_debug_log_file () const { return _player_debug_log_file; } @@ -547,6 +551,23 @@ public: return _add_files_path; } + bool use_isdcf_name_by_default () const { + return _use_isdcf_name_by_default; + } + + bool write_kdms_to_disk () const { + return _write_kdms_to_disk; + } + + bool email_kdms () const { + return _email_kdms; + } + + dcp::Formulation default_kdm_type () const { + return _default_kdm_type; + } + + /* SET (mostly) */ void set_master_encoding_threads (int n) { @@ -827,8 +848,6 @@ public: void set_cinemas_file (boost::filesystem::path file); - void set_dkdm_recipients_file (boost::filesystem::path file); - void set_show_hints_before_make_dcp (bool s) { maybe_set (_show_hints_before_make_dcp, s); } @@ -995,18 +1014,6 @@ public: maybe_set (_respect_kdm_validity_periods, r); } - void set_player_activity_log_file (boost::filesystem::path p) { - maybe_set (_player_activity_log_file, p); - } - - void unset_player_activity_log_file () { - if (!_player_activity_log_file) { - return; - } - _player_activity_log_file = boost::none; - changed (); - } - void set_player_debug_log_file (boost::filesystem::path p) { maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG); } @@ -1065,6 +1072,22 @@ public: changed (); } + void set_use_isdcf_name_by_default (bool use) { + maybe_set (_use_isdcf_name_by_default, use); + } + + void set_write_kdms_to_disk (bool write) { + maybe_set (_write_kdms_to_disk, write); + } + + void set_email_kdms (bool email) { + maybe_set (_email_kdms, email); + } + + void set_default_kdm_type (dcp::Formulation type) { + maybe_set (_default_kdm_type, type); + } + void changed (Property p = OTHER); boost::signals2::signal Changed; /** Emitted if read() failed on an existing Config file. There is nothing @@ -1077,9 +1100,10 @@ public: * true to ask Config to solve the problem (by discarding and recreating the bad thing) */ enum BadReason { - BAD_SIGNER_UTF8_STRINGS, ///< signer chain contains UTF-8 strings (not PRINTABLESTRING) - BAD_SIGNER_INCONSISTENT, ///< signer chain is somehow inconsistent - BAD_DECRYPTION_INCONSISTENT, ///< KDM decryption chain is somehow inconsistent + BAD_SIGNER_UTF8_STRINGS, ///< signer chain contains UTF-8 strings (not PRINTABLESTRING) + BAD_SIGNER_INCONSISTENT, ///< signer chain is somehow inconsistent + BAD_DECRYPTION_INCONSISTENT, ///< KDM decryption chain is somehow inconsistent + BAD_SIGNER_VALIDITY_TOO_LONG, ///< signer certificate validity periods are >10 years }; static boost::signals2::signal Bad; @@ -1100,6 +1124,8 @@ public: void rename_template (std::string old_name, std::string new_name) const; void delete_template (std::string name) const; + boost::optional check_certificates () const; + static Config* instance (); static void drop (); static void restore_defaults (); @@ -1196,8 +1222,8 @@ private: */ boost::optional _default_kdm_directory; bool _upload_after_make_dcp; - std::list > _cinemas; - std::list > _dkdm_recipients; + std::list> _cinemas; + std::list> _dkdm_recipients; std::string _mail_server; int _mail_port; EmailProtocol _mail_protocol; @@ -1265,10 +1291,6 @@ private: int _image_display; VideoViewType _video_view_type; bool _respect_kdm_validity_periods; - /** Log file containing things the player does (e.g. started, stopped, loaded - playlist etc.) Does not contain debugging information. - */ - boost::optional _player_activity_log_file; /** Log file containing debug information for the player */ boost::optional _player_debug_log_file; /** A directory containing DCPs whose contents are presented to the user @@ -1281,6 +1303,10 @@ private: boost::optional _audio_mapping; std::vector _custom_languages; boost::optional _add_files_path; + bool _use_isdcf_name_by_default; + bool _write_kdms_to_disk; + bool _email_kdms; + dcp::Formulation _default_kdm_type; static int const _current_version;