X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.h;h=2fca9699c786006d5819064ecb0acb4b1e5a49c5;hb=6d770c4c8c79569871edc20253f29f9ea00539e6;hp=dae1924a86c50ea1948e65878f2cf1432a19d511;hpb=0ca36c0d2b238a9e2165b5d113c22f144835a672;p=dcpomatic.git diff --git a/src/lib/config.h b/src/lib/config.h index dae1924a8..2fca9699c 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -286,6 +286,10 @@ public: return _history; } + std::vector player_history () const { + return _player_history; + } + boost::shared_ptr dkdms () const { return _dkdms; } @@ -326,6 +330,7 @@ public: NAG_DKDM_CONFIG, NAG_ENCRYPTED_METADATA, NAG_REMAKE_DECRYPTION_CHAIN, + NAG_BAD_SIGNER_CHAIN, NAG_COUNT }; @@ -359,10 +364,25 @@ public: return _last_kdm_write_type; } + enum DKDMWriteType { + DKDM_WRITE_INTERNAL, + DKDM_WRITE_FILE + }; + + boost::optional last_dkdm_write_type () const { + return _last_dkdm_write_type; + } + int frames_in_memory_multiplier () const { return _frames_in_memory_multiplier; } + boost::optional decode_reduction () const { + return _decode_reduction; + } + + /* SET (mostly) */ + void set_master_encoding_threads (int n) { maybe_set (_master_encoding_threads, n); } @@ -605,6 +625,10 @@ public: maybe_set (_last_kdm_write_type, t); } + void set_last_dkdm_write_type (DKDMWriteType t) { + maybe_set (_last_dkdm_write_type, t); + } + void unset_sound_output () { if (!_sound_output) { return; @@ -634,12 +658,22 @@ public: maybe_set (_frames_in_memory_multiplier, m); } + void set_decode_reduction (boost::optional r) { + maybe_set (_decode_reduction, r); + } + void clear_history () { _history.clear (); changed (); } + void clear_player_history () { + _player_history.clear (); + changed (); + } + void add_to_history (boost::filesystem::path p); + void add_to_player_history (boost::filesystem::path p); void set_jump_to_selected (bool j) { maybe_set (_jump_to_selected, j); @@ -663,6 +697,10 @@ public: static boost::signals2::signal FailedToLoad; /** Emitted if read() issued a warning which the user might want to know about */ static boost::signals2::signal Warning; + /** Emitted if there is a bad certificate in the signer chain. Handler can call + * true to ask Config to re-create the chain. + */ + static boost::signals2::signal BadSignerChain; void write () const; void write_config () const; @@ -695,6 +733,8 @@ private: void read_cinemas (cxml::Document const & f); 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 backup (); template void maybe_set (T& member, T new_value, Property prop = OTHER) { @@ -789,6 +829,7 @@ private: bool _win32_console; #endif std::vector _history; + std::vector _player_history; boost::shared_ptr _dkdms; boost::filesystem::path _cinemas_file; bool _show_hints_before_make_dcp; @@ -805,7 +846,11 @@ private: std::string _cover_sheet; boost::optional _last_player_load_directory; boost::optional _last_kdm_write_type; + boost::optional _last_dkdm_write_type; int _frames_in_memory_multiplier; + boost::optional _decode_reduction; + + static int const _current_version; /** Singleton instance, or 0 */ static Config* _instance;