Some missing copy constructors / operator= / noncopyable.
[dcpomatic.git] / src / lib / config.h
index ee46166e6d9809e4a098dcba15175f25509f459f..38664f093f33d79235c7cdb333ac8333d5196afe 100644 (file)
  *  @brief Class holding configuration.
  */
 
-#ifndef DVDOMATIC_CONFIG_H
-#define DVDOMATIC_CONFIG_H
+#ifndef DCPOMATIC_CONFIG_H
+#define DCPOMATIC_CONFIG_H
 
 #include <vector>
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
+#include <libdcp/metadata.h>
 #include "dci_metadata.h"
 
 class ServerDescription;
 class Scaler;
 class Filter;
 class SoundProcessor;
+class DCPContentType;
+class Ratio;
 
 /** @class Config
  *  @brief A singleton class holding configuration.
@@ -62,14 +65,6 @@ public:
                return _servers;
        }
 
-       Scaler const * reference_scaler () const {
-               return _reference_scaler;
-       }
-
-       std::vector<Filter const *> reference_filters () const {
-               return _reference_filters;
-       }
-
        /** @return The IP address of a TMS that we can copy DCPs to */
        std::string tms_ip () const {
                return _tms_ip;
@@ -107,6 +102,26 @@ public:
                return _language;
        }
 
+       int default_still_length () const {
+               return _default_still_length;
+       }
+
+       Ratio const * default_container () const {
+               return _default_container;
+       }
+
+       DCPContentType const * default_dcp_content_type () const {
+               return _default_dcp_content_type;
+       }
+
+       libdcp::XMLMetadata dcp_metadata () const {
+               return _dcp_metadata;
+       }
+
+       int default_j2k_bandwidth () const {
+               return _default_j2k_bandwidth;
+       }
+
        /** @param n New number of local encoding threads */
        void set_num_local_encoding_threads (int n) {
                _num_local_encoding_threads = n;
@@ -165,6 +180,30 @@ public:
        void set_language (std::string l) {
                _language = l;
        }
+
+       void unset_language () {
+               _language = boost::none;
+       }
+
+       void set_default_still_length (int s) {
+               _default_still_length = s;
+       }
+
+       void set_default_container (Ratio const * c) {
+               _default_container = c;
+       }
+
+       void set_default_dcp_content_type (DCPContentType const * t) {
+               _default_dcp_content_type = t;
+       }
+
+       void set_dcp_metadata (libdcp::XMLMetadata m) {
+               _dcp_metadata = m;
+       }
+
+       void set_default_j2k_bandwidth (int b) {
+               _default_j2k_bandwidth = b;
+       }
        
        void write () const;
 
@@ -173,7 +212,9 @@ public:
 
 private:
        Config ();
-       std::string file () const;
+       std::string file (bool) const;
+       void read ();
+       void read_old_metadata ();
 
        /** number of threads to use for J2K encoding on the local machine */
        int _num_local_encoding_threads;
@@ -202,6 +243,11 @@ private:
        /** Default DCI metadata for newly-created Films */
        DCIMetadata _default_dci_metadata;
        boost::optional<std::string> _language;
+       int _default_still_length;
+       Ratio const * _default_container;
+       DCPContentType const * _default_dcp_content_type;
+       libdcp::XMLMetadata _dcp_metadata;
+       int _default_j2k_bandwidth;
 
        /** Singleton instance, or 0 */
        static Config* _instance;