Add recent files list to player.
[dcpomatic.git] / src / lib / config.h
index afa362a4ccce96acc4fea792952ed0ac8b34789b..f32b171064134e0749e25e044c7b2bddcc5ac5a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -196,6 +196,10 @@ public:
                return _default_interop;
        }
 
+       bool default_upload_after_make_dcp () {
+               return _default_upload_after_make_dcp;
+       }
+
        void set_default_kdm_directory (boost::filesystem::path d) {
                if (_default_kdm_directory && _default_kdm_directory.get() == d) {
                        return;
@@ -282,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;
        }
@@ -345,6 +353,16 @@ public:
                return _last_player_load_directory;
        }
 
+       enum KDMWriteType {
+               KDM_WRITE_FLAT,
+               KDM_WRITE_FOLDER,
+               KDM_WRITE_ZIP
+       };
+
+       boost::optional<KDMWriteType> last_kdm_write_type () const {
+               return _last_kdm_write_type;
+       }
+
        int frames_in_memory_multiplier () const {
                return _frames_in_memory_multiplier;
        }
@@ -477,6 +495,10 @@ public:
                maybe_set (_default_interop, i);
        }
 
+       void set_default_upload_after_make_dcp (bool u) {
+               maybe_set (_default_upload_after_make_dcp, u);
+       }
+
        void set_mail_server (std::string s) {
                maybe_set (_mail_server, s);
        }
@@ -583,6 +605,10 @@ public:
                maybe_set (_last_player_load_directory, d);
        }
 
+       void set_last_kdm_write_type (KDMWriteType t) {
+               maybe_set (_last_kdm_write_type, t);
+       }
+
        void unset_sound_output () {
                if (!_sound_output) {
                        return;
@@ -617,7 +643,13 @@ public:
                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);
@@ -661,6 +693,8 @@ public:
        static bool have_existing (std::string);
        static boost::filesystem::path config_file ();
 
+       static boost::optional<boost::filesystem::path> test_path;
+
 private:
        Config ();
        static boost::filesystem::path path (std::string file, bool create_directories = true);
@@ -671,6 +705,7 @@ 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);
 
        template <class T>
        void maybe_set (T& member, T new_value, Property prop = OTHER) {
@@ -737,6 +772,7 @@ private:
            the home directory will be offered.
        */
        boost::optional<boost::filesystem::path> _default_kdm_directory;
+       bool _default_upload_after_make_dcp;
        std::list<boost::shared_ptr<Cinema> > _cinemas;
        std::string _mail_server;
        int _mail_port;
@@ -764,6 +800,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;
@@ -779,6 +816,7 @@ private:
        boost::optional<std::string> _sound_output;
        std::string _cover_sheet;
        boost::optional<boost::filesystem::path> _last_player_load_directory;
+       boost::optional<KDMWriteType> _last_kdm_write_type;
        int _frames_in_memory_multiplier;
 
        /** Singleton instance, or 0 */