Backup more than one config on failure to load.
[dcpomatic.git] / src / lib / config.h
index 0a81dee5132679e9d461d8c8e5b4a4b3510ea6e0..61d9c64e6baf17f6536a1d29d8b25ce109aa11e5 100644 (file)
@@ -341,6 +341,24 @@ public:
                return _sound_output;
        }
 
+       boost::optional<boost::filesystem::path> last_player_load_directory () const {
+               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;
+       }
+
        void set_master_encoding_threads (int n) {
                maybe_set (_master_encoding_threads, n);
        }
@@ -567,13 +585,19 @@ public:
                maybe_set (_sound, s, SOUND);
        }
 
-       void set_sound_output (std::string o)
-       {
+       void set_sound_output (std::string o) {
                maybe_set (_sound_output, o, SOUND_OUTPUT);
        }
 
-       void unset_sound_output ()
-       {
+       void set_last_player_load_directory (boost::filesystem::path d) {
+               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;
                }
@@ -598,6 +622,10 @@ public:
                maybe_set (_dcp_asset_filename_format, n);
        }
 
+       void set_frames_in_memory_multiplier (int m) {
+               maybe_set (_frames_in_memory_multiplier, m);
+       }
+
        void clear_history () {
                _history.clear ();
                changed ();
@@ -647,6 +675,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);
@@ -764,6 +794,9 @@ private:
        /** name of a specific sound output stream to use, or empty to use the default */
        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 */
        static Config* _instance;