Preserve export video settings in the config (#2259).
[dcpomatic.git] / src / lib / config.h
index 40497e2193e1d1ce8b9bce4fa4cb95dfbc194339..9c3650f8d00af1d8cfb0f6f2b2ad1cf33136942a 100644 (file)
@@ -28,6 +28,8 @@
 
 
 #include "audio_mapping.h"
+#include "export_config.h"
+#include "rough_duration.h"
 #include "state.h"
 #include "types.h"
 #include <dcp/name_format.h>
@@ -572,6 +574,10 @@ public:
                return _default_kdm_type;
        }
 
+       RoughDuration default_kdm_duration () const {
+               return _default_kdm_duration;
+       }
+
        double auto_crop_threshold () const {
                return _auto_crop_threshold;
        }
@@ -1100,10 +1106,18 @@ public:
                maybe_set (_default_kdm_type, type);
        }
 
+       void set_default_kdm_duration (RoughDuration duration) {
+               maybe_set (_default_kdm_duration, duration);
+       }
+
        void set_auto_crop_threshold (double threshold) {
                maybe_set (_auto_crop_threshold, threshold, AUTO_CROP_THRESHOLD);
        }
 
+       ExportConfig& export_config() {
+               return _export;
+       }
+
        void changed (Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
        /** Emitted if read() failed on an existing Config file.  There is nothing
@@ -1149,21 +1163,6 @@ public:
        static boost::filesystem::path config_read_file ();
        static boost::filesystem::path config_write_file ();
 
-private:
-       Config ();
-       void read () override;
-       void set_defaults ();
-       void set_kdm_email_to_default ();
-       void set_notification_email_to_default ();
-       void set_cover_sheet_to_default ();
-       void read_cinemas (cxml::Document const & f);
-       void read_dkdm_recipients (cxml::Document const & f);
-       std::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 clean_history_internal (std::vector<boost::filesystem::path>& h);
-       void backup ();
-
        template <class T>
        void maybe_set (T& member, T new_value, Property prop = OTHER) {
                if (member == new_value) {
@@ -1182,6 +1181,21 @@ private:
                changed (prop);
        }
 
+private:
+       Config ();
+       void read () override;
+       void set_defaults ();
+       void set_kdm_email_to_default ();
+       void set_notification_email_to_default ();
+       void set_cover_sheet_to_default ();
+       void read_cinemas (cxml::Document const & f);
+       void read_dkdm_recipients (cxml::Document const & f);
+       std::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 clean_history_internal (std::vector<boost::filesystem::path>& h);
+       void backup ();
+
        /** number of threads which a master DoM should use for J2K encoding on the local machine */
        int _master_encoding_threads;
        /** number of threads which a server should use for J2K encoding on the local machine */
@@ -1324,12 +1338,16 @@ private:
        bool _write_kdms_to_disk;
        bool _email_kdms;
        dcp::Formulation _default_kdm_type;
+       RoughDuration _default_kdm_duration;
        double _auto_crop_threshold;
 
+       ExportConfig _export;
+
        static int const _current_version;
 
        /** Singleton instance, or 0 */
        static Config* _instance;
 };
 
+
 #endif