Basic implementation of a tree view for DKDMs (#1012).
[dcpomatic.git] / src / lib / config.h
index 40380f825f3247e7e545be4c4f5a12c4c3d6a79c..44708a24fc231b561dcebe0efb84e2ade175fb9d 100644 (file)
@@ -40,6 +40,7 @@ class DCPContentType;
 class Ratio;
 class Cinema;
 class Film;
+class DKDMGroup;
 
 /** @class Config
  *  @brief A singleton class holding configuration.
@@ -163,6 +164,10 @@ public:
                return _default_container;
        }
 
+       Ratio const * default_scale_to () const {
+               return _default_scale_to;
+       }
+
        DCPContentType const * default_dcp_content_type () const {
                return _default_dcp_content_type;
        }
@@ -277,7 +282,7 @@ public:
                return _history;
        }
 
-       std::vector<dcp::EncryptedKDM> dkdms () const {
+       boost::shared_ptr<DKDMGroup> dkdms () const {
                return _dkdms;
        }
 
@@ -313,10 +318,24 @@ public:
                return _jump_to_selected;
        }
 
+       enum Nag {
+               NAG_DKDM_CONFIG,
+               NAG_ENCRYPTED_METADATA,
+               NAG_COUNT
+       };
+
+       bool nagged (Nag nag) const {
+               return _nagged[nag];
+       }
+
        bool preview_sound () const {
                return _preview_sound;
        }
 
+       std::string cover_sheet () const {
+               return _cover_sheet;
+       }
+
        boost::optional<std::string> preview_sound_output () const {
                return _preview_sound_output;
        }
@@ -417,6 +436,10 @@ public:
                maybe_set (_default_container, c);
        }
 
+       void set_default_scale_to (Ratio const * c) {
+               maybe_set (_default_scale_to, c);
+       }
+
        void set_default_dcp_content_type (DCPContentType const * t) {
                maybe_set (_default_dcp_content_type, t);
        }
@@ -524,7 +547,7 @@ public:
        }
 #endif
 
-       void set_dkdms (std::vector<dcp::EncryptedKDM> dkdms) {
+       void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
                _dkdms = dkdms;
                changed ();
        }
@@ -585,6 +608,16 @@ public:
                maybe_set (_jump_to_selected, j);
        }
 
+       void set_nagged (Nag nag, bool nagged) {
+               maybe_set (_nagged[nag], nagged);
+       }
+
+       void set_cover_sheet (std::string s) {
+               maybe_set (_cover_sheet, s);
+       }
+
+       void reset_cover_sheet ();
+
        void changed (Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
        /** Emitted if read() failed on an existing Config file.  There is nothing
@@ -607,6 +640,7 @@ public:
        static void drop ();
        static void restore_defaults ();
        static bool have_existing (std::string);
+       static boost::filesystem::path config_path ();
 
 private:
        Config ();
@@ -614,6 +648,7 @@ private:
        void read ();
        void set_defaults ();
        void set_kdm_email_to_default ();
+       void set_cover_sheet_to_default ();
        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;
@@ -671,6 +706,7 @@ private:
        /** Default length of still image content (seconds) */
        int _default_still_length;
        Ratio const * _default_container;
+       Ratio const * _default_scale_to;
        DCPContentType const * _default_dcp_content_type;
        int _default_dcp_audio_channels;
        std::string _dcp_issuer;
@@ -709,7 +745,7 @@ private:
        bool _win32_console;
 #endif
        std::vector<boost::filesystem::path> _history;
-       std::vector<dcp::EncryptedKDM> _dkdms;
+       boost::shared_ptr<DKDMGroup> _dkdms;
        boost::filesystem::path _cinemas_file;
        bool _show_hints_before_make_dcp;
        bool _confirm_kdm_email;
@@ -718,9 +754,11 @@ private:
        dcp::NameFormat _dcp_metadata_filename_format;
        dcp::NameFormat _dcp_asset_filename_format;
        bool _jump_to_selected;
+       bool _nagged[NAG_COUNT];
        bool _preview_sound;
        /** name of a specific sound output stream to use for preview, or empty to use the default */
        boost::optional<std::string> _preview_sound_output;
+       std::string _cover_sheet;
 
        /** Singleton instance, or 0 */
        static Config* _instance;