/*
- 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.
#include "isdcf_metadata.h"
#include "types.h"
+#include <dcp/name_format.h>
#include <dcp/certificate_chain.h>
#include <dcp/encrypted_kdm.h>
#include <boost/shared_ptr.hpp>
class DCPContentType;
class Ratio;
class Cinema;
+class Film;
/** @class Config
* @brief A singleton class holding configuration.
return _default_dcp_content_type;
}
+ int default_dcp_audio_channels () const {
+ return _default_dcp_audio_channels;
+ }
+
std::string dcp_issuer () const {
return _dcp_issuer;
}
return _cinemas_file;
}
+ bool show_hints_before_make_dcp () const {
+ return _show_hints_before_make_dcp;
+ }
+
+ bool confirm_kdm_email () const {
+ return _confirm_kdm_email;
+ }
+
+ 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);
maybe_set (_default_dcp_content_type, t);
}
+ void set_default_dcp_audio_channels (int c) {
+ maybe_set (_default_dcp_audio_channels, c);
+ }
+
void set_dcp_issuer (std::string i) {
maybe_set (_dcp_issuer, i);
}
}
#endif
- void set_dkdms (std::vector<dcp::EncryptedKDM> dkdms)
- {
+ void set_dkdms (std::vector<dcp::EncryptedKDM> dkdms) {
_dkdms = dkdms;
changed ();
}
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_confirm_kdm_email (bool s) {
+ maybe_set (_confirm_kdm_email, 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 ();
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;
+ void save_template (boost::shared_ptr<const Film> film, std::string name) const;
+ bool existing_template (std::string name) const;
+ std::list<std::string> 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 ();
int _default_still_length;
Ratio const * _default_container;
DCPContentType const * _default_dcp_content_type;
+ int _default_dcp_audio_channels;
std::string _dcp_issuer;
std::string _dcp_creator;
int _default_j2k_bandwidth;
std::vector<boost::filesystem::path> _history;
std::vector<dcp::EncryptedKDM> _dkdms;
boost::filesystem::path _cinemas_file;
+ bool _show_hints_before_make_dcp;
+ bool _confirm_kdm_email;
+ dcp::NameFormat _kdm_filename_format;
+ dcp::NameFormat _dcp_metadata_filename_format;
+ dcp::NameFormat _dcp_asset_filename_format;
/** Singleton instance, or 0 */
static Config* _instance;