2 Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 /** @file src/config.h
22 * @brief Class holding configuration.
25 #ifndef DCPOMATIC_CONFIG_H
26 #define DCPOMATIC_CONFIG_H
28 #include "isdcf_metadata.h"
30 #include <dcp/name_format.h>
31 #include <dcp/certificate_chain.h>
32 #include <dcp/encrypted_kdm.h>
33 #include <boost/shared_ptr.hpp>
34 #include <boost/signals2.hpp>
35 #include <boost/filesystem.hpp>
38 class CinemaSoundProcessor;
46 * @brief A singleton class holding configuration.
48 class Config : public boost::noncopyable
51 /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
52 int master_encoding_threads () const {
53 return _master_encoding_threads;
56 /** @return number of threads which a server should use for J2K encoding on the local machine */
57 int server_encoding_threads () const {
58 return _server_encoding_threads;
61 boost::optional<boost::filesystem::path> default_directory () const {
62 return _default_directory;
65 boost::optional<boost::filesystem::path> default_kdm_directory () const {
66 return _default_kdm_directory;
69 boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
70 boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
80 #ifdef DCPOMATIC_VARIANT_SWAROOP
81 PLAYER_BACKGROUND_IMAGE,
86 /** @return base port number to use for J2K encoding servers */
87 int server_port_base () const {
88 return _server_port_base;
91 void set_use_any_servers (bool u) {
93 changed (USE_ANY_SERVERS);
96 bool use_any_servers () const {
97 return _use_any_servers;
100 /** @param s New list of servers */
101 void set_servers (std::vector<std::string> s) {
106 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
107 std::vector<std::string> servers () const {
111 bool only_servers_encode () const {
112 return _only_servers_encode;
115 Protocol tms_protocol () const {
116 return _tms_protocol;
119 /** @return The IP address of a TMS that we can copy DCPs to */
120 std::string tms_ip () const {
124 /** @return The path on a TMS that we should changed DCPs to */
125 std::string tms_path () const {
129 /** @return User name to log into the TMS with */
130 std::string tms_user () const {
134 /** @return Password to log into the TMS with */
135 std::string tms_password () const {
136 return _tms_password;
139 /** @return The cinema sound processor that we are using */
140 CinemaSoundProcessor const * cinema_sound_processor () const {
141 return _cinema_sound_processor;
144 std::list<boost::shared_ptr<Cinema> > cinemas () const {
148 std::list<int> allowed_dcp_frame_rates () const {
149 return _allowed_dcp_frame_rates;
152 bool allow_any_dcp_frame_rate () const {
153 return _allow_any_dcp_frame_rate;
156 bool allow_any_container () const {
157 return _allow_any_container;
160 ISDCFMetadata default_isdcf_metadata () const {
161 return _default_isdcf_metadata;
164 boost::optional<std::string> language () const {
168 int default_still_length () const {
169 return _default_still_length;
172 Ratio const * default_container () const {
173 return _default_container;
176 Ratio const * default_scale_to () const {
177 return _default_scale_to;
180 DCPContentType const * default_dcp_content_type () const {
181 return _default_dcp_content_type;
184 int default_dcp_audio_channels () const {
185 return _default_dcp_audio_channels;
188 std::string dcp_issuer () const {
192 std::string dcp_creator () const {
196 int default_j2k_bandwidth () const {
197 return _default_j2k_bandwidth;
200 int default_audio_delay () const {
201 return _default_audio_delay;
204 bool default_interop () const {
205 return _default_interop;
208 bool default_upload_after_make_dcp () {
209 return _default_upload_after_make_dcp;
212 void set_default_kdm_directory (boost::filesystem::path d) {
213 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
216 _default_kdm_directory = d;
220 std::string mail_server () const {
224 int mail_port () const {
228 std::string mail_user () const {
232 std::string mail_password () const {
233 return _mail_password;
236 std::string kdm_subject () const {
240 std::string kdm_from () const {
244 std::vector<std::string> kdm_cc () const {
248 std::string kdm_bcc () const {
252 std::string kdm_email () const {
256 std::string notification_subject () const {
257 return _notification_subject;
260 std::string notification_from () const {
261 return _notification_from;
264 std::string notification_to () const {
265 return _notification_to;
268 std::vector<std::string> notification_cc () const {
269 return _notification_cc;
272 std::string notification_bcc () const {
273 return _notification_bcc;
276 std::string notification_email () const {
277 return _notification_email;
280 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
281 return _signer_chain;
284 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
285 return _decryption_chain;
288 bool check_for_updates () const {
289 return _check_for_updates;
292 bool check_for_test_updates () const {
293 return _check_for_test_updates;
296 int maximum_j2k_bandwidth () const {
297 return _maximum_j2k_bandwidth;
300 int log_types () const {
304 bool analyse_ebur128 () const {
305 return _analyse_ebur128;
308 bool automatic_audio_analysis () const {
309 return _automatic_audio_analysis;
312 #ifdef DCPOMATIC_WINDOWS
313 bool win32_console () const {
314 return _win32_console;
318 std::vector<boost::filesystem::path> history () const {
322 std::vector<boost::filesystem::path> player_history () const {
323 return _player_history;
326 boost::shared_ptr<DKDMGroup> dkdms () const {
330 boost::filesystem::path cinemas_file () const {
331 return _cinemas_file;
334 bool show_hints_before_make_dcp () const {
335 return _show_hints_before_make_dcp;
338 bool confirm_kdm_email () const {
339 return _confirm_kdm_email;
342 dcp::NameFormat kdm_container_name_format () const {
343 return _kdm_container_name_format;
346 dcp::NameFormat kdm_filename_format () const {
347 return _kdm_filename_format;
350 dcp::NameFormat dcp_metadata_filename_format () const {
351 return _dcp_metadata_filename_format;
354 dcp::NameFormat dcp_asset_filename_format () const {
355 return _dcp_asset_filename_format;
358 bool jump_to_selected () const {
359 return _jump_to_selected;
364 NAG_ENCRYPTED_METADATA,
365 NAG_REMAKE_DECRYPTION_CHAIN,
366 NAG_BAD_SIGNER_CHAIN,
367 /* Not really a nag but it's the same idea */
372 bool nagged (Nag nag) const {
376 bool sound () const {
380 std::string cover_sheet () const {
384 boost::optional<std::string> sound_output () const {
385 return _sound_output;
388 boost::optional<boost::filesystem::path> last_player_load_directory () const {
389 return _last_player_load_directory;
398 boost::optional<KDMWriteType> last_kdm_write_type () const {
399 return _last_kdm_write_type;
407 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
408 return _last_dkdm_write_type;
411 int frames_in_memory_multiplier () const {
412 return _frames_in_memory_multiplier;
415 boost::optional<int> decode_reduction () const {
416 return _decode_reduction;
419 bool default_notify () const {
420 return _default_notify;
429 bool notification (Notification n) const {
430 return _notification[n];
433 boost::optional<std::string> barco_username () const {
434 return _barco_username;
437 boost::optional<std::string> barco_password () const {
438 return _barco_password;
441 boost::optional<std::string> christie_username () const {
442 return _christie_username;
445 boost::optional<std::string> christie_password () const {
446 return _christie_password;
449 boost::optional<std::string> gdc_username () const {
450 return _gdc_username;
453 boost::optional<std::string> gdc_password () const {
454 return _gdc_password;
462 Interface interface_complexity () const {
463 return _interface_complexity;
472 PlayerMode player_mode () const {
476 int image_display () const {
477 return _image_display;
480 bool respect_kdm_validity_periods () const {
481 return _respect_kdm_validity_periods;
484 boost::optional<boost::filesystem::path> player_log_file () const {
485 return _player_log_file;
488 boost::optional<boost::filesystem::path> player_dcp_directory () const {
489 return _player_dcp_directory;
492 boost::optional<boost::filesystem::path> player_kdm_directory () const {
493 return _player_kdm_directory;
496 #ifdef DCPOMATIC_VARIANT_SWAROOP
497 boost::optional<boost::filesystem::path> player_background_image () const {
498 return _player_background_image;
501 std::string kdm_server_url () const {
502 return _kdm_server_url;
505 std::string player_watermark_theatre () const {
506 return _player_watermark_theatre;
509 int player_watermark_period () const {
510 return _player_watermark_period;
513 int player_watermark_duration () const {
514 return _player_watermark_duration;
520 void set_master_encoding_threads (int n) {
521 maybe_set (_master_encoding_threads, n);
524 void set_server_encoding_threads (int n) {
525 maybe_set (_server_encoding_threads, n);
528 void set_default_directory (boost::filesystem::path d) {
529 if (_default_directory && *_default_directory == d) {
532 _default_directory = d;
536 /** @param p New server port */
537 void set_server_port_base (int p) {
538 maybe_set (_server_port_base, p);
541 void set_only_servers_encode (bool o) {
542 maybe_set (_only_servers_encode, o);
545 void set_tms_protocol (Protocol p) {
546 maybe_set (_tms_protocol, p);
549 /** @param i IP address of a TMS that we can copy DCPs to */
550 void set_tms_ip (std::string i) {
551 maybe_set (_tms_ip, i);
554 /** @param p Path on a TMS that we should changed DCPs to */
555 void set_tms_path (std::string p) {
556 maybe_set (_tms_path, p);
559 /** @param u User name to log into the TMS with */
560 void set_tms_user (std::string u) {
561 maybe_set (_tms_user, u);
564 /** @param p Password to log into the TMS with */
565 void set_tms_password (std::string p) {
566 maybe_set (_tms_password, p);
569 void add_cinema (boost::shared_ptr<Cinema> c) {
570 _cinemas.push_back (c);
574 void remove_cinema (boost::shared_ptr<Cinema> c) {
579 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
580 maybe_set (_allowed_dcp_frame_rates, r);
583 void set_allow_any_dcp_frame_rate (bool a) {
584 maybe_set (_allow_any_dcp_frame_rate, a);
587 void set_allow_any_container (bool a) {
588 maybe_set (_allow_any_container, a);
591 void set_default_isdcf_metadata (ISDCFMetadata d) {
592 maybe_set (_default_isdcf_metadata, d);
595 void set_language (std::string l) {
596 if (_language && _language.get() == l) {
603 void unset_language () {
608 _language = boost::none;
612 void set_default_still_length (int s) {
613 maybe_set (_default_still_length, s);
616 void set_default_container (Ratio const * c) {
617 maybe_set (_default_container, c);
620 void set_default_scale_to (Ratio const * c) {
621 maybe_set (_default_scale_to, c);
624 void set_default_dcp_content_type (DCPContentType const * t) {
625 maybe_set (_default_dcp_content_type, t);
628 void set_default_dcp_audio_channels (int c) {
629 maybe_set (_default_dcp_audio_channels, c);
632 void set_dcp_issuer (std::string i) {
633 maybe_set (_dcp_issuer, i);
636 void set_dcp_creator (std::string c) {
637 maybe_set (_dcp_creator, c);
640 void set_default_j2k_bandwidth (int b) {
641 maybe_set (_default_j2k_bandwidth, b);
644 void set_default_audio_delay (int d) {
645 maybe_set (_default_audio_delay, d);
648 void set_default_interop (bool i) {
649 maybe_set (_default_interop, i);
652 void set_default_upload_after_make_dcp (bool u) {
653 maybe_set (_default_upload_after_make_dcp, u);
656 void set_mail_server (std::string s) {
657 maybe_set (_mail_server, s);
660 void set_mail_port (int p) {
661 maybe_set (_mail_port, p);
664 void set_mail_user (std::string u) {
665 maybe_set (_mail_user, u);
668 void set_mail_password (std::string p) {
669 maybe_set (_mail_password, p);
672 void set_kdm_subject (std::string s) {
673 maybe_set (_kdm_subject, s);
676 void set_kdm_from (std::string f) {
677 maybe_set (_kdm_from, f);
680 void set_kdm_cc (std::vector<std::string> f) {
681 maybe_set (_kdm_cc, f);
684 void set_kdm_bcc (std::string f) {
685 maybe_set (_kdm_bcc, f);
688 void set_kdm_email (std::string e) {
689 maybe_set (_kdm_email, e);
692 void reset_kdm_email ();
694 void set_notification_subject (std::string s) {
695 maybe_set (_notification_subject, s);
698 void set_notification_from (std::string f) {
699 maybe_set (_notification_from, f);
702 void set_notification_to (std::string t) {
703 maybe_set (_notification_to, t);
706 void set_notification_cc (std::vector<std::string> f) {
707 maybe_set (_notification_cc, f);
710 void set_notification_bcc (std::string f) {
711 maybe_set (_notification_bcc, f);
714 void set_notification_email (std::string e) {
715 maybe_set (_notification_email, e);
718 void reset_notification_email ();
720 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
721 maybe_set (_signer_chain, s);
724 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
725 maybe_set (_decryption_chain, c);
728 void set_check_for_updates (bool c) {
729 maybe_set (_check_for_updates, c);
731 set_check_for_test_updates (false);
735 void set_check_for_test_updates (bool c) {
736 maybe_set (_check_for_test_updates, c);
739 void set_maximum_j2k_bandwidth (int b) {
740 maybe_set (_maximum_j2k_bandwidth, b);
743 void set_log_types (int t) {
744 maybe_set (_log_types, t);
747 void set_analyse_ebur128 (bool a) {
748 maybe_set (_analyse_ebur128, a);
751 void set_automatic_audio_analysis (bool a) {
752 maybe_set (_automatic_audio_analysis, a);
755 #ifdef DCPOMATIC_WINDOWS
756 void set_win32_console (bool c) {
757 maybe_set (_win32_console, c);
761 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
766 void set_cinemas_file (boost::filesystem::path file);
768 void set_show_hints_before_make_dcp (bool s) {
769 maybe_set (_show_hints_before_make_dcp, s);
772 void set_confirm_kdm_email (bool s) {
773 maybe_set (_confirm_kdm_email, s);
776 void set_sound (bool s) {
777 maybe_set (_sound, s, SOUND);
780 void set_sound_output (std::string o) {
781 maybe_set (_sound_output, o, SOUND_OUTPUT);
784 void set_last_player_load_directory (boost::filesystem::path d) {
785 maybe_set (_last_player_load_directory, d);
788 void set_last_kdm_write_type (KDMWriteType t) {
789 maybe_set (_last_kdm_write_type, t);
792 void set_last_dkdm_write_type (DKDMWriteType t) {
793 maybe_set (_last_dkdm_write_type, t);
796 void unset_sound_output () {
797 if (!_sound_output) {
801 _sound_output = boost::none;
805 void set_kdm_container_name_format (dcp::NameFormat n) {
806 maybe_set (_kdm_container_name_format, n);
809 void set_kdm_filename_format (dcp::NameFormat n) {
810 maybe_set (_kdm_filename_format, n);
813 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
814 maybe_set (_dcp_metadata_filename_format, n);
817 void set_dcp_asset_filename_format (dcp::NameFormat n) {
818 maybe_set (_dcp_asset_filename_format, n);
821 void set_frames_in_memory_multiplier (int m) {
822 maybe_set (_frames_in_memory_multiplier, m);
825 void set_decode_reduction (boost::optional<int> r) {
826 maybe_set (_decode_reduction, r);
829 void set_default_notify (bool n) {
830 maybe_set (_default_notify, n);
833 void clear_history () {
838 void clear_player_history () {
839 _player_history.clear ();
843 void add_to_history (boost::filesystem::path p);
844 void add_to_player_history (boost::filesystem::path p);
846 void set_jump_to_selected (bool j) {
847 maybe_set (_jump_to_selected, j);
850 void set_nagged (Nag nag, bool nagged) {
851 maybe_set (_nagged[nag], nagged);
854 void set_cover_sheet (std::string s) {
855 maybe_set (_cover_sheet, s);
858 void reset_cover_sheet ();
860 void set_notification (Notification n, bool v) {
861 maybe_set (_notification[n], v);
864 void set_barco_username (std::string u) {
865 maybe_set (_barco_username, u);
868 void unset_barco_username () {
869 maybe_set (_barco_username, boost::optional<std::string>());
872 void set_barco_password (std::string p) {
873 maybe_set (_barco_password, p);
876 void unset_barco_password () {
877 maybe_set (_barco_password, boost::optional<std::string>());
880 void set_christie_username (std::string u) {
881 maybe_set (_christie_username, u);
884 void unset_christie_username () {
885 maybe_set (_christie_username, boost::optional<std::string>());
888 void set_christie_password (std::string p) {
889 maybe_set (_christie_password, p);
892 void unset_christie_password () {
893 maybe_set (_christie_password, boost::optional<std::string>());
896 void set_gdc_username (std::string u) {
897 maybe_set (_gdc_username, u);
900 void unset_gdc_username () {
901 maybe_set (_gdc_username, boost::optional<std::string>());
904 void set_gdc_password (std::string p) {
905 maybe_set (_gdc_password, p);
908 void unset_gdc_password () {
909 maybe_set (_gdc_password, boost::optional<std::string>());
912 void set_interface_complexity (Interface i) {
913 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
916 void set_player_mode (PlayerMode m) {
917 maybe_set (_player_mode, m);
920 void set_image_display (int n) {
921 maybe_set (_image_display, n);
924 void set_respect_kdm_validity_periods (bool r) {
925 maybe_set (_respect_kdm_validity_periods, r);
928 void set_player_log_file (boost::filesystem::path p) {
929 maybe_set (_player_log_file, p);
932 void unset_player_log_file () {
933 if (!_player_log_file) {
936 _player_log_file = boost::none;
940 void set_player_dcp_directory (boost::filesystem::path p) {
941 maybe_set (_player_dcp_directory, p, PLAYER_DCP_DIRECTORY);
944 void unset_player_dcp_directory () {
945 if (!_player_dcp_directory) {
948 _player_dcp_directory = boost::none;
949 changed (PLAYER_DCP_DIRECTORY);
952 void set_player_kdm_directory (boost::filesystem::path p) {
953 maybe_set (_player_kdm_directory, p);
956 void unset_player_kdm_directory () {
957 if (!_player_kdm_directory) {
960 _player_kdm_directory = boost::none;
964 #ifdef DCPOMATIC_VARIANT_SWAROOP
965 void set_player_background_image (boost::filesystem::path p) {
966 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
969 void unset_player_background_image () {
970 if (!_player_background_image) {
973 _player_background_image = boost::none;
974 changed (PLAYER_BACKGROUND_IMAGE);
977 void set_kdm_server_url (std::string s) {
978 maybe_set (_kdm_server_url, s);
981 void set_player_watermark_theatre (std::string p) {
982 maybe_set (_player_watermark_theatre, p);
985 void set_player_watermark_period (int minutes) {
986 maybe_set (_player_watermark_period, minutes);
989 void set_player_watermark_duration (int milliseconds) {
990 maybe_set (_player_watermark_duration, milliseconds);
994 void changed (Property p = OTHER);
995 boost::signals2::signal<void (Property)> Changed;
996 /** Emitted if read() failed on an existing Config file. There is nothing
997 a listener can do about it: this is just for information.
999 static boost::signals2::signal<void ()> FailedToLoad;
1000 /** Emitted if read() issued a warning which the user might want to know about */
1001 static boost::signals2::signal<void (std::string)> Warning;
1002 /** Emitted if there is a bad certificate in the signer chain. Handler can call
1003 * true to ask Config to re-create the chain.
1005 static boost::signals2::signal<bool (void)> BadSignerChain;
1007 void write () const;
1008 void write_config () const;
1009 void write_cinemas () const;
1010 void link (boost::filesystem::path new_file) const;
1011 void copy_and_link (boost::filesystem::path new_file) const;
1012 bool have_write_permission () const;
1014 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1015 bool existing_template (std::string name) const;
1016 std::list<std::string> templates () const;
1017 boost::filesystem::path template_path (std::string name) const;
1018 void rename_template (std::string old_name, std::string new_name) const;
1019 void delete_template (std::string name) const;
1021 static Config* instance ();
1022 static void drop ();
1023 static void restore_defaults ();
1024 static bool have_existing (std::string);
1025 static boost::filesystem::path config_file ();
1027 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1028 static boost::optional<boost::filesystem::path> override_path;
1032 static boost::filesystem::path path (std::string file, bool create_directories = true);
1034 void set_defaults ();
1035 void set_kdm_email_to_default ();
1036 void set_notification_email_to_default ();
1037 void set_cover_sheet_to_default ();
1038 void read_cinemas (cxml::Document const & f);
1039 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1040 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1041 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1045 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1046 if (member == new_value) {
1054 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1055 if (member && member.get() == new_value) {
1062 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1063 int _master_encoding_threads;
1064 /** number of threads which a server should use for J2K encoding on the local machine */
1065 int _server_encoding_threads;
1066 /** default directory to put new films in */
1067 boost::optional<boost::filesystem::path> _default_directory;
1068 /** base port number to use for J2K encoding servers;
1069 * this port and the two above it will be used.
1071 int _server_port_base;
1072 /** true to broadcast on the `any' address to look for servers */
1073 bool _use_any_servers;
1074 /** J2K encoding servers that should definitely be used */
1075 std::vector<std::string> _servers;
1076 bool _only_servers_encode;
1077 Protocol _tms_protocol;
1078 /** The IP address of a TMS that we can copy DCPs to */
1079 std::string _tms_ip;
1080 /** The path on a TMS that we should write DCPs to */
1081 std::string _tms_path;
1082 /** User name to log into the TMS with */
1083 std::string _tms_user;
1084 /** Password to log into the TMS with */
1085 std::string _tms_password;
1086 /** Our cinema sound processor */
1087 CinemaSoundProcessor const * _cinema_sound_processor;
1088 std::list<int> _allowed_dcp_frame_rates;
1089 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1090 bool _allow_any_dcp_frame_rate;
1091 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1092 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1093 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1095 bool _allow_any_container;
1096 /** Default ISDCF metadata for newly-created Films */
1097 ISDCFMetadata _default_isdcf_metadata;
1098 boost::optional<std::string> _language;
1099 /** Default length of still image content (seconds) */
1100 int _default_still_length;
1101 Ratio const * _default_container;
1102 Ratio const * _default_scale_to;
1103 DCPContentType const * _default_dcp_content_type;
1104 int _default_dcp_audio_channels;
1105 std::string _dcp_issuer;
1106 std::string _dcp_creator;
1107 int _default_j2k_bandwidth;
1108 int _default_audio_delay;
1109 bool _default_interop;
1110 /** Default directory to offer to write KDMs to; if it's not set,
1111 the home directory will be offered.
1113 boost::optional<boost::filesystem::path> _default_kdm_directory;
1114 bool _default_upload_after_make_dcp;
1115 std::list<boost::shared_ptr<Cinema> > _cinemas;
1116 std::string _mail_server;
1118 std::string _mail_user;
1119 std::string _mail_password;
1120 std::string _kdm_subject;
1121 std::string _kdm_from;
1122 std::vector<std::string> _kdm_cc;
1123 std::string _kdm_bcc;
1124 std::string _kdm_email;
1125 std::string _notification_subject;
1126 std::string _notification_from;
1127 std::string _notification_to;
1128 std::vector<std::string> _notification_cc;
1129 std::string _notification_bcc;
1130 std::string _notification_email;
1131 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1132 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1133 * certificate for making KDMs given to DCP-o-matic.
1135 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1136 /** true to check for updates on startup */
1137 bool _check_for_updates;
1138 bool _check_for_test_updates;
1139 /** maximum allowed J2K bandwidth in bits per second */
1140 int _maximum_j2k_bandwidth;
1142 bool _analyse_ebur128;
1143 bool _automatic_audio_analysis;
1144 #ifdef DCPOMATIC_WINDOWS
1145 bool _win32_console;
1147 std::vector<boost::filesystem::path> _history;
1148 std::vector<boost::filesystem::path> _player_history;
1149 boost::shared_ptr<DKDMGroup> _dkdms;
1150 boost::filesystem::path _cinemas_file;
1151 bool _show_hints_before_make_dcp;
1152 bool _confirm_kdm_email;
1153 dcp::NameFormat _kdm_filename_format;
1154 dcp::NameFormat _kdm_container_name_format;
1155 dcp::NameFormat _dcp_metadata_filename_format;
1156 dcp::NameFormat _dcp_asset_filename_format;
1157 bool _jump_to_selected;
1158 bool _nagged[NAG_COUNT];
1160 /** name of a specific sound output stream to use, or empty to use the default */
1161 boost::optional<std::string> _sound_output;
1162 std::string _cover_sheet;
1163 boost::optional<boost::filesystem::path> _last_player_load_directory;
1164 boost::optional<KDMWriteType> _last_kdm_write_type;
1165 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1166 int _frames_in_memory_multiplier;
1167 boost::optional<int> _decode_reduction;
1168 bool _default_notify;
1169 bool _notification[NOTIFICATION_COUNT];
1170 boost::optional<std::string> _barco_username;
1171 boost::optional<std::string> _barco_password;
1172 boost::optional<std::string> _christie_username;
1173 boost::optional<std::string> _christie_password;
1174 boost::optional<std::string> _gdc_username;
1175 boost::optional<std::string> _gdc_password;
1176 Interface _interface_complexity;
1177 PlayerMode _player_mode;
1179 bool _respect_kdm_validity_periods;
1180 boost::optional<boost::filesystem::path> _player_log_file;
1181 /** A directory containing DCPs whose contents are presented to the user
1182 in the dual-screen player mode. DCPs on the list can be loaded
1185 boost::optional<boost::filesystem::path> _player_dcp_directory;
1186 boost::optional<boost::filesystem::path> _player_kdm_directory;
1187 #ifdef DCPOMATIC_VARIANT_SWAROOP
1188 boost::optional<boost::filesystem::path> _player_background_image;
1189 std::string _kdm_server_url;
1190 std::string _player_watermark_theatre;
1191 int _player_watermark_period;
1192 int _player_watermark_duration;
1195 static int const _current_version;
1197 /** Singleton instance, or 0 */
1198 static Config* _instance;