Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / lib / config.h
index dae1924a86c50ea1948e65878f2cf1432a19d511..90ebb0b33c3518022837d033fda1d95ca56b74e8 100644 (file)
@@ -286,6 +286,10 @@ public:
                return _history;
        }
 
+       std::vector<boost::filesystem::path> player_history () const {
+               return _player_history;
+       }
+
        boost::shared_ptr<DKDMGroup> dkdms () const {
                return _dkdms;
        }
@@ -359,10 +363,25 @@ public:
                return _last_kdm_write_type;
        }
 
+       enum DKDMWriteType {
+               DKDM_WRITE_INTERNAL,
+               DKDM_WRITE_FILE
+       };
+
+       boost::optional<DKDMWriteType> last_dkdm_write_type () const {
+               return _last_dkdm_write_type;
+       }
+
        int frames_in_memory_multiplier () const {
                return _frames_in_memory_multiplier;
        }
 
+       boost::optional<int> decode_reduction () const {
+               return _decode_reduction;
+       }
+
+       /* SET (mostly) */
+
        void set_master_encoding_threads (int n) {
                maybe_set (_master_encoding_threads, n);
        }
@@ -605,6 +624,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 +657,22 @@ public:
                maybe_set (_frames_in_memory_multiplier, m);
        }
 
+       void set_decode_reduction (boost::optional<int> 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);
@@ -695,6 +728,8 @@ private:
        void read_cinemas (cxml::Document const & f);
        boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
        boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
+       void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
+       void backup ();
 
        template <class T>
        void maybe_set (T& member, T new_value, Property prop = OTHER) {
@@ -789,6 +824,7 @@ private:
        bool _win32_console;
 #endif
        std::vector<boost::filesystem::path> _history;
+       std::vector<boost::filesystem::path> _player_history;
        boost::shared_ptr<DKDMGroup> _dkdms;
        boost::filesystem::path _cinemas_file;
        bool _show_hints_before_make_dcp;
@@ -805,7 +841,11 @@ private:
        std::string _cover_sheet;
        boost::optional<boost::filesystem::path> _last_player_load_directory;
        boost::optional<KDMWriteType> _last_kdm_write_type;
+       boost::optional<DKDMWriteType> _last_dkdm_write_type;
        int _frames_in_memory_multiplier;
+       boost::optional<int> _decode_reduction;
+
+       static int const _current_version;
 
        /** Singleton instance, or 0 */
        static Config* _instance;