X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.h;h=1d0501ce4d7487d1b61a9ec980f2bcd312c1d0de;hb=6bfda50f36b35a6635e9da7a25f84319ca29d92f;hp=e3a34aed3787f0eebc5d40b81fdc2c74725b54ef;hpb=0985598b244ec2b82714a422e5d8381a08c6da35;p=dcpomatic.git diff --git a/src/lib/config.h b/src/lib/config.h index e3a34aed3..1d0501ce4 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -27,6 +27,7 @@ #include "isdcf_metadata.h" #include "types.h" +#include "state.h" #include "edid.h" #include #include @@ -46,7 +47,7 @@ class DKDMGroup; /** @class Config * @brief A singleton class holding configuration. */ -class Config : public boost::noncopyable +class Config : public State { public: /** @return number of threads which a master DoM should use for J2K encoding on the local machine */ @@ -79,6 +80,7 @@ public: INTERFACE_COMPLEXITY, PLAYER_CONTENT_DIRECTORY, PLAYER_PLAYLIST_DIRECTORY, + PLAYER_DEBUG_LOG, HISTORY, #ifdef DCPOMATIC_VARIANT_SWAROOP PLAYER_BACKGROUND_IMAGE, @@ -115,7 +117,7 @@ public: return _only_servers_encode; } - Protocol tms_protocol () const { + FileTransferProtocol tms_protocol () const { return _tms_protocol; } @@ -228,6 +230,10 @@ public: return _mail_port; } + EmailProtocol mail_protocol () const { + return _mail_protocol; + } + std::string mail_user () const { return _mail_user; } @@ -365,10 +371,12 @@ public: enum Nag { NAG_DKDM_CONFIG, NAG_ENCRYPTED_METADATA, - NAG_REMAKE_DECRYPTION_CHAIN, + NAG_ALTER_DECRYPTION_CHAIN, NAG_BAD_SIGNER_CHAIN, /* Not really a nag but it's the same idea */ NAG_INITIAL_SETUP, + NAG_IMPORT_DECRYPTION_CHAIN, + NAG_DELETE_DKDM, NAG_COUNT }; @@ -484,8 +492,12 @@ public: return _respect_kdm_validity_periods; } - boost::optional player_log_file () const { - return _player_log_file; + boost::optional player_activity_log_file () const { + return _player_activity_log_file; + } + + boost::optional player_debug_log_file () const { + return _player_debug_log_file; } boost::optional player_content_directory () const { @@ -557,7 +569,7 @@ public: maybe_set (_only_servers_encode, o); } - void set_tms_protocol (Protocol p) { + void set_tms_protocol (FileTransferProtocol p) { maybe_set (_tms_protocol, p); } @@ -676,6 +688,10 @@ public: maybe_set (_mail_port, p); } + void set_mail_protocol (EmailProtocol p) { + maybe_set (_mail_protocol, p); + } + void set_mail_user (std::string u) { maybe_set (_mail_user, u); } @@ -856,7 +872,9 @@ public: } void add_to_history (boost::filesystem::path p); + void clean_history (); void add_to_player_history (boost::filesystem::path p); + void clean_player_history (); void set_jump_to_selected (bool j) { maybe_set (_jump_to_selected, j); @@ -940,18 +958,30 @@ public: maybe_set (_respect_kdm_validity_periods, r); } - void set_player_log_file (boost::filesystem::path p) { - maybe_set (_player_log_file, p); + void set_player_activity_log_file (boost::filesystem::path p) { + maybe_set (_player_activity_log_file, p); } - void unset_player_log_file () { - if (!_player_log_file) { + void unset_player_activity_log_file () { + if (!_player_activity_log_file) { return; } - _player_log_file = boost::none; + _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); + } + + void unset_player_debug_log_file () { + if (!_player_debug_log_file) { + return; + } + _player_debug_log_file = boost::none; + changed (PLAYER_DEBUG_LOG); + } + void set_player_content_directory (boost::filesystem::path p) { maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY); } @@ -1066,10 +1096,6 @@ public: static void restore_defaults (); static bool have_existing (std::string); static boost::filesystem::path config_file (); - static boost::filesystem::path path (std::string file, bool create_directories = true); - - /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */ - static boost::optional override_path; private: Config (); @@ -1082,6 +1108,7 @@ private: boost::shared_ptr create_certificate_chain (); boost::filesystem::path directory_or (boost::optional dir, boost::filesystem::path a) const; void add_to_history_internal (std::vector& h, boost::filesystem::path p); + void clean_history_internal (std::vector& h); void backup (); template @@ -1117,7 +1144,7 @@ private: /** J2K encoding servers that should definitely be used */ std::vector _servers; bool _only_servers_encode; - Protocol _tms_protocol; + FileTransferProtocol _tms_protocol; /** The IP address of a TMS that we can copy DCPs to */ std::string _tms_ip; /** The path on a TMS that we should write DCPs to */ @@ -1159,6 +1186,7 @@ private: std::list > _cinemas; std::string _mail_server; int _mail_port; + EmailProtocol _mail_protocol; std::string _mail_user; std::string _mail_password; std::string _kdm_subject; @@ -1227,7 +1255,12 @@ private: PlayerMode _player_mode; int _image_display; bool _respect_kdm_validity_periods; - boost::optional _player_log_file; + /** 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 in the dual-screen player mode. DCPs on the list can be loaded for playback.