Allow configuration of KDM filename format.
[dcpomatic.git] / src / lib / config.h
index 1ffcfdb9881831f90de4e98d5f3c7c4196c87eba..d89adf4916b083087261dac9f99f6f8a26dd8d36 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -26,6 +26,7 @@
 #define DCPOMATIC_CONFIG_H
 
 #include "isdcf_metadata.h"
+#include "kdm_name_format.h"
 #include "types.h"
 #include <dcp/certificate_chain.h>
 #include <dcp/encrypted_kdm.h>
@@ -262,6 +263,14 @@ public:
                return _cinemas_file;
        }
 
+       bool show_hints_before_make_dcp () const {
+               return _show_hints_before_make_dcp;
+       }
+
+       KDMNameFormat kdm_filename_format () const {
+               return _kdm_filename_format;
+       }
+
        /** @param n New number of local encoding threads */
        void set_num_local_encoding_threads (int n) {
                maybe_set (_num_local_encoding_threads, n);
@@ -466,6 +475,14 @@ public:
 
        void set_cinemas_file (boost::filesystem::path file);
 
+       void set_show_hints_before_make_dcp (bool s) {
+               maybe_set (_show_hints_before_make_dcp, s);
+       }
+
+       void set_kdm_filename_format (KDMNameFormat n) {
+               maybe_set (_kdm_filename_format, n);
+       }
+
        void clear_history () {
                _history.clear ();
                changed ();
@@ -475,6 +492,10 @@ public:
 
        void changed (Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
+       /** Emitted if ::read() failed on an existing Config file.  There is nothing
+           a listener can do about it: this is just for information.
+       */
+       static boost::signals2::signal<void ()> FailedToLoad;
 
        void write () const;
 
@@ -572,6 +593,8 @@ private:
        std::vector<boost::filesystem::path> _history;
        std::vector<dcp::EncryptedKDM> _dkdms;
        boost::filesystem::path _cinemas_file;
+       bool _show_hints_before_make_dcp;
+       KDMNameFormat _kdm_filename_format;
 
        /** Singleton instance, or 0 */
        static Config* _instance;