X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.h;h=e18cd33121da70ea46a7429afd832bb17a8ce610;hb=c0d2b454ea1e8c9b047907343c902d72101ef6dd;hp=feaac8390842b902559ea3d90e86f7e0156f7d5e;hpb=b74bc6135a6a690bf5674638a8bea56e5580fd08;p=dcpomatic.git diff --git a/src/lib/config.h b/src/lib/config.h index feaac8390..e18cd3312 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -27,6 +27,7 @@ #include "isdcf_metadata.h" #include "types.h" +#include #include #include #include @@ -38,6 +39,7 @@ class CinemaSoundProcessor; class DCPContentType; class Ratio; class Cinema; +class Film; /** @class Config * @brief A singleton class holding configuration. @@ -266,6 +268,18 @@ public: return _show_hints_before_make_dcp; } + dcp::NameFormat kdm_filename_format () const { + return _kdm_filename_format; + } + + dcp::NameFormat dcp_metadata_filename_format () const { + return _dcp_metadata_filename_format; + } + + dcp::NameFormat dcp_asset_filename_format () const { + return _dcp_asset_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); @@ -462,8 +476,7 @@ public: } #endif - void set_dkdms (std::vector dkdms) - { + void set_dkdms (std::vector dkdms) { _dkdms = dkdms; changed (); } @@ -474,6 +487,18 @@ public: maybe_set (_show_hints_before_make_dcp, s); } + void set_kdm_filename_format (dcp::NameFormat n) { + maybe_set (_kdm_filename_format, n); + } + + void set_dcp_metadata_filename_format (dcp::NameFormat n) { + maybe_set (_dcp_metadata_filename_format, n); + } + + void set_dcp_asset_filename_format (dcp::NameFormat n) { + maybe_set (_dcp_asset_filename_format, n); + } + void clear_history () { _history.clear (); changed (); @@ -483,9 +508,20 @@ public: void changed (Property p = OTHER); boost::signals2::signal 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 FailedToLoad; void write () const; + void save_template (boost::shared_ptr film, std::string name) const; + bool existing_template (std::string name) const; + std::list templates () const; + boost::filesystem::path template_path (std::string name) const; + void rename_template (std::string old_name, std::string new_name) const; + void delete_template (std::string name) const; + static Config* instance (); static void drop (); static void restore_defaults (); @@ -581,6 +617,9 @@ private: std::vector _dkdms; boost::filesystem::path _cinemas_file; bool _show_hints_before_make_dcp; + dcp::NameFormat _kdm_filename_format; + dcp::NameFormat _dcp_metadata_filename_format; + dcp::NameFormat _dcp_asset_filename_format; /** Singleton instance, or 0 */ static Config* _instance;