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"
31 #include <dcp/name_format.h>
32 #include <dcp/certificate_chain.h>
33 #include <dcp/encrypted_kdm.h>
34 #include <boost/shared_ptr.hpp>
35 #include <boost/signals2.hpp>
36 #include <boost/filesystem.hpp>
39 class CinemaSoundProcessor;
47 * @brief A singleton class holding configuration.
49 class Config : public boost::noncopyable
52 /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
53 int master_encoding_threads () const {
54 return _master_encoding_threads;
57 /** @return number of threads which a server should use for J2K encoding on the local machine */
58 int server_encoding_threads () const {
59 return _server_encoding_threads;
62 boost::optional<boost::filesystem::path> default_directory () const {
63 return _default_directory;
66 boost::optional<boost::filesystem::path> default_kdm_directory () const {
67 return _default_kdm_directory;
70 boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
71 boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
82 #ifdef DCPOMATIC_VARIANT_SWAROOP
83 PLAYER_BACKGROUND_IMAGE,
88 /** @return base port number to use for J2K encoding servers */
89 int server_port_base () const {
90 return _server_port_base;
93 void set_use_any_servers (bool u) {
95 changed (USE_ANY_SERVERS);
98 bool use_any_servers () const {
99 return _use_any_servers;
102 /** @param s New list of servers */
103 void set_servers (std::vector<std::string> s) {
108 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
109 std::vector<std::string> servers () const {
113 bool only_servers_encode () const {
114 return _only_servers_encode;
117 Protocol tms_protocol () const {
118 return _tms_protocol;
121 /** @return The IP address of a TMS that we can copy DCPs to */
122 std::string tms_ip () const {
126 /** @return The path on a TMS that we should changed DCPs to */
127 std::string tms_path () const {
131 /** @return User name to log into the TMS with */
132 std::string tms_user () const {
136 /** @return Password to log into the TMS with */
137 std::string tms_password () const {
138 return _tms_password;
141 /** @return The cinema sound processor that we are using */
142 CinemaSoundProcessor const * cinema_sound_processor () const {
143 return _cinema_sound_processor;
146 std::list<boost::shared_ptr<Cinema> > cinemas () const {
150 std::list<int> allowed_dcp_frame_rates () const {
151 return _allowed_dcp_frame_rates;
154 bool allow_any_dcp_frame_rate () const {
155 return _allow_any_dcp_frame_rate;
158 bool allow_any_container () const {
159 return _allow_any_container;
162 ISDCFMetadata default_isdcf_metadata () const {
163 return _default_isdcf_metadata;
166 boost::optional<std::string> language () const {
170 int default_still_length () const {
171 return _default_still_length;
174 Ratio const * default_container () const {
175 return _default_container;
178 Ratio const * default_scale_to () const {
179 return _default_scale_to;
182 DCPContentType const * default_dcp_content_type () const {
183 return _default_dcp_content_type;
186 int default_dcp_audio_channels () const {
187 return _default_dcp_audio_channels;
190 std::string dcp_issuer () const {
194 std::string dcp_creator () const {
198 int default_j2k_bandwidth () const {
199 return _default_j2k_bandwidth;
202 int default_audio_delay () const {
203 return _default_audio_delay;
206 bool default_interop () const {
207 return _default_interop;
210 bool default_upload_after_make_dcp () {
211 return _default_upload_after_make_dcp;
214 void set_default_kdm_directory (boost::filesystem::path d) {
215 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
218 _default_kdm_directory = d;
222 std::string mail_server () const {
226 int mail_port () const {
230 std::string mail_user () const {
234 std::string mail_password () const {
235 return _mail_password;
238 std::string kdm_subject () const {
242 std::string kdm_from () const {
246 std::vector<std::string> kdm_cc () const {
250 std::string kdm_bcc () const {
254 std::string kdm_email () const {
258 std::string notification_subject () const {
259 return _notification_subject;
262 std::string notification_from () const {
263 return _notification_from;
266 std::string notification_to () const {
267 return _notification_to;
270 std::vector<std::string> notification_cc () const {
271 return _notification_cc;
274 std::string notification_bcc () const {
275 return _notification_bcc;
278 std::string notification_email () const {
279 return _notification_email;
282 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
283 return _signer_chain;
286 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
287 return _decryption_chain;
290 bool check_for_updates () const {
291 return _check_for_updates;
294 bool check_for_test_updates () const {
295 return _check_for_test_updates;
298 int maximum_j2k_bandwidth () const {
299 return _maximum_j2k_bandwidth;
302 int log_types () const {
306 bool analyse_ebur128 () const {
307 return _analyse_ebur128;
310 bool automatic_audio_analysis () const {
311 return _automatic_audio_analysis;
314 #ifdef DCPOMATIC_WINDOWS
315 bool win32_console () const {
316 return _win32_console;
320 std::vector<boost::filesystem::path> history () const {
324 std::vector<boost::filesystem::path> player_history () const {
325 return _player_history;
328 boost::shared_ptr<DKDMGroup> dkdms () const {
332 boost::filesystem::path cinemas_file () const {
333 return _cinemas_file;
336 bool show_hints_before_make_dcp () const {
337 return _show_hints_before_make_dcp;
340 bool confirm_kdm_email () const {
341 return _confirm_kdm_email;
344 dcp::NameFormat kdm_container_name_format () const {
345 return _kdm_container_name_format;
348 dcp::NameFormat kdm_filename_format () const {
349 return _kdm_filename_format;
352 dcp::NameFormat dcp_metadata_filename_format () const {
353 return _dcp_metadata_filename_format;
356 dcp::NameFormat dcp_asset_filename_format () const {
357 return _dcp_asset_filename_format;
360 bool jump_to_selected () const {
361 return _jump_to_selected;
366 NAG_ENCRYPTED_METADATA,
367 NAG_REMAKE_DECRYPTION_CHAIN,
368 NAG_BAD_SIGNER_CHAIN,
369 /* Not really a nag but it's the same idea */
374 bool nagged (Nag nag) const {
378 bool sound () const {
382 std::string cover_sheet () const {
386 boost::optional<std::string> sound_output () const {
387 return _sound_output;
390 boost::optional<boost::filesystem::path> last_player_load_directory () const {
391 return _last_player_load_directory;
400 boost::optional<KDMWriteType> last_kdm_write_type () const {
401 return _last_kdm_write_type;
409 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
410 return _last_dkdm_write_type;
413 int frames_in_memory_multiplier () const {
414 return _frames_in_memory_multiplier;
417 boost::optional<int> decode_reduction () const {
418 return _decode_reduction;
421 bool default_notify () const {
422 return _default_notify;
431 bool notification (Notification n) const {
432 return _notification[n];
435 boost::optional<std::string> barco_username () const {
436 return _barco_username;
439 boost::optional<std::string> barco_password () const {
440 return _barco_password;
443 boost::optional<std::string> christie_username () const {
444 return _christie_username;
447 boost::optional<std::string> christie_password () const {
448 return _christie_password;
451 boost::optional<std::string> gdc_username () const {
452 return _gdc_username;
455 boost::optional<std::string> gdc_password () const {
456 return _gdc_password;
464 Interface interface_complexity () const {
465 return _interface_complexity;
474 PlayerMode player_mode () const {
478 int image_display () const {
479 return _image_display;
482 bool respect_kdm_validity_periods () const {
483 return _respect_kdm_validity_periods;
486 boost::optional<boost::filesystem::path> player_log_file () const {
487 return _player_log_file;
490 boost::optional<boost::filesystem::path> player_dcp_directory () const {
491 return _player_dcp_directory;
494 boost::optional<boost::filesystem::path> player_kdm_directory () const {
495 return _player_kdm_directory;
498 #ifdef DCPOMATIC_VARIANT_SWAROOP
499 boost::optional<boost::filesystem::path> player_background_image () const {
500 return _player_background_image;
503 std::string kdm_server_url () const {
504 return _kdm_server_url;
507 std::string player_watermark_theatre () const {
508 return _player_watermark_theatre;
511 int player_watermark_period () const {
512 return _player_watermark_period;
515 int player_watermark_duration () const {
516 return _player_watermark_duration;
519 std::vector<Monitor> required_monitors () const {
520 return _required_monitors;
526 void set_master_encoding_threads (int n) {
527 maybe_set (_master_encoding_threads, n);
530 void set_server_encoding_threads (int n) {
531 maybe_set (_server_encoding_threads, n);
534 void set_default_directory (boost::filesystem::path d) {
535 if (_default_directory && *_default_directory == d) {
538 _default_directory = d;
542 /** @param p New server port */
543 void set_server_port_base (int p) {
544 maybe_set (_server_port_base, p);
547 void set_only_servers_encode (bool o) {
548 maybe_set (_only_servers_encode, o);
551 void set_tms_protocol (Protocol p) {
552 maybe_set (_tms_protocol, p);
555 /** @param i IP address of a TMS that we can copy DCPs to */
556 void set_tms_ip (std::string i) {
557 maybe_set (_tms_ip, i);
560 /** @param p Path on a TMS that we should changed DCPs to */
561 void set_tms_path (std::string p) {
562 maybe_set (_tms_path, p);
565 /** @param u User name to log into the TMS with */
566 void set_tms_user (std::string u) {
567 maybe_set (_tms_user, u);
570 /** @param p Password to log into the TMS with */
571 void set_tms_password (std::string p) {
572 maybe_set (_tms_password, p);
575 void add_cinema (boost::shared_ptr<Cinema> c) {
576 _cinemas.push_back (c);
580 void remove_cinema (boost::shared_ptr<Cinema> c) {
585 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
586 maybe_set (_allowed_dcp_frame_rates, r);
589 void set_allow_any_dcp_frame_rate (bool a) {
590 maybe_set (_allow_any_dcp_frame_rate, a);
593 void set_allow_any_container (bool a) {
594 maybe_set (_allow_any_container, a);
597 void set_default_isdcf_metadata (ISDCFMetadata d) {
598 maybe_set (_default_isdcf_metadata, d);
601 void set_language (std::string l) {
602 if (_language && _language.get() == l) {
609 void unset_language () {
614 _language = boost::none;
618 void set_default_still_length (int s) {
619 maybe_set (_default_still_length, s);
622 void set_default_container (Ratio const * c) {
623 maybe_set (_default_container, c);
626 void set_default_scale_to (Ratio const * c) {
627 maybe_set (_default_scale_to, c);
630 void set_default_dcp_content_type (DCPContentType const * t) {
631 maybe_set (_default_dcp_content_type, t);
634 void set_default_dcp_audio_channels (int c) {
635 maybe_set (_default_dcp_audio_channels, c);
638 void set_dcp_issuer (std::string i) {
639 maybe_set (_dcp_issuer, i);
642 void set_dcp_creator (std::string c) {
643 maybe_set (_dcp_creator, c);
646 void set_default_j2k_bandwidth (int b) {
647 maybe_set (_default_j2k_bandwidth, b);
650 void set_default_audio_delay (int d) {
651 maybe_set (_default_audio_delay, d);
654 void set_default_interop (bool i) {
655 maybe_set (_default_interop, i);
658 void set_default_upload_after_make_dcp (bool u) {
659 maybe_set (_default_upload_after_make_dcp, u);
662 void set_mail_server (std::string s) {
663 maybe_set (_mail_server, s);
666 void set_mail_port (int p) {
667 maybe_set (_mail_port, p);
670 void set_mail_user (std::string u) {
671 maybe_set (_mail_user, u);
674 void set_mail_password (std::string p) {
675 maybe_set (_mail_password, p);
678 void set_kdm_subject (std::string s) {
679 maybe_set (_kdm_subject, s);
682 void set_kdm_from (std::string f) {
683 maybe_set (_kdm_from, f);
686 void set_kdm_cc (std::vector<std::string> f) {
687 maybe_set (_kdm_cc, f);
690 void set_kdm_bcc (std::string f) {
691 maybe_set (_kdm_bcc, f);
694 void set_kdm_email (std::string e) {
695 maybe_set (_kdm_email, e);
698 void reset_kdm_email ();
700 void set_notification_subject (std::string s) {
701 maybe_set (_notification_subject, s);
704 void set_notification_from (std::string f) {
705 maybe_set (_notification_from, f);
708 void set_notification_to (std::string t) {
709 maybe_set (_notification_to, t);
712 void set_notification_cc (std::vector<std::string> f) {
713 maybe_set (_notification_cc, f);
716 void set_notification_bcc (std::string f) {
717 maybe_set (_notification_bcc, f);
720 void set_notification_email (std::string e) {
721 maybe_set (_notification_email, e);
724 void reset_notification_email ();
726 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
727 maybe_set (_signer_chain, s);
730 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
731 maybe_set (_decryption_chain, c);
734 void set_check_for_updates (bool c) {
735 maybe_set (_check_for_updates, c);
737 set_check_for_test_updates (false);
741 void set_check_for_test_updates (bool c) {
742 maybe_set (_check_for_test_updates, c);
745 void set_maximum_j2k_bandwidth (int b) {
746 maybe_set (_maximum_j2k_bandwidth, b);
749 void set_log_types (int t) {
750 maybe_set (_log_types, t);
753 void set_analyse_ebur128 (bool a) {
754 maybe_set (_analyse_ebur128, a);
757 void set_automatic_audio_analysis (bool a) {
758 maybe_set (_automatic_audio_analysis, a);
761 #ifdef DCPOMATIC_WINDOWS
762 void set_win32_console (bool c) {
763 maybe_set (_win32_console, c);
767 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
772 void set_cinemas_file (boost::filesystem::path file);
774 void set_show_hints_before_make_dcp (bool s) {
775 maybe_set (_show_hints_before_make_dcp, s);
778 void set_confirm_kdm_email (bool s) {
779 maybe_set (_confirm_kdm_email, s);
782 void set_sound (bool s) {
783 maybe_set (_sound, s, SOUND);
786 void set_sound_output (std::string o) {
787 maybe_set (_sound_output, o, SOUND_OUTPUT);
790 void set_last_player_load_directory (boost::filesystem::path d) {
791 maybe_set (_last_player_load_directory, d);
794 void set_last_kdm_write_type (KDMWriteType t) {
795 maybe_set (_last_kdm_write_type, t);
798 void set_last_dkdm_write_type (DKDMWriteType t) {
799 maybe_set (_last_dkdm_write_type, t);
802 void unset_sound_output () {
803 if (!_sound_output) {
807 _sound_output = boost::none;
811 void set_kdm_container_name_format (dcp::NameFormat n) {
812 maybe_set (_kdm_container_name_format, n);
815 void set_kdm_filename_format (dcp::NameFormat n) {
816 maybe_set (_kdm_filename_format, n);
819 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
820 maybe_set (_dcp_metadata_filename_format, n);
823 void set_dcp_asset_filename_format (dcp::NameFormat n) {
824 maybe_set (_dcp_asset_filename_format, n);
827 void set_frames_in_memory_multiplier (int m) {
828 maybe_set (_frames_in_memory_multiplier, m);
831 void set_decode_reduction (boost::optional<int> r) {
832 maybe_set (_decode_reduction, r);
835 void set_default_notify (bool n) {
836 maybe_set (_default_notify, n);
839 void clear_history () {
844 void clear_player_history () {
845 _player_history.clear ();
849 void add_to_history (boost::filesystem::path p);
850 void add_to_player_history (boost::filesystem::path p);
852 void set_jump_to_selected (bool j) {
853 maybe_set (_jump_to_selected, j);
856 void set_nagged (Nag nag, bool nagged) {
857 maybe_set (_nagged[nag], nagged);
860 void set_cover_sheet (std::string s) {
861 maybe_set (_cover_sheet, s);
864 void reset_cover_sheet ();
866 void set_notification (Notification n, bool v) {
867 maybe_set (_notification[n], v);
870 void set_barco_username (std::string u) {
871 maybe_set (_barco_username, u);
874 void unset_barco_username () {
875 maybe_set (_barco_username, boost::optional<std::string>());
878 void set_barco_password (std::string p) {
879 maybe_set (_barco_password, p);
882 void unset_barco_password () {
883 maybe_set (_barco_password, boost::optional<std::string>());
886 void set_christie_username (std::string u) {
887 maybe_set (_christie_username, u);
890 void unset_christie_username () {
891 maybe_set (_christie_username, boost::optional<std::string>());
894 void set_christie_password (std::string p) {
895 maybe_set (_christie_password, p);
898 void unset_christie_password () {
899 maybe_set (_christie_password, boost::optional<std::string>());
902 void set_gdc_username (std::string u) {
903 maybe_set (_gdc_username, u);
906 void unset_gdc_username () {
907 maybe_set (_gdc_username, boost::optional<std::string>());
910 void set_gdc_password (std::string p) {
911 maybe_set (_gdc_password, p);
914 void unset_gdc_password () {
915 maybe_set (_gdc_password, boost::optional<std::string>());
918 void set_interface_complexity (Interface i) {
919 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
922 void set_player_mode (PlayerMode m) {
923 maybe_set (_player_mode, m);
926 void set_image_display (int n) {
927 maybe_set (_image_display, n);
930 void set_respect_kdm_validity_periods (bool r) {
931 maybe_set (_respect_kdm_validity_periods, r);
934 void set_player_log_file (boost::filesystem::path p) {
935 maybe_set (_player_log_file, p);
938 void unset_player_log_file () {
939 if (!_player_log_file) {
942 _player_log_file = boost::none;
946 void set_player_dcp_directory (boost::filesystem::path p) {
947 maybe_set (_player_dcp_directory, p, PLAYER_DCP_DIRECTORY);
950 void unset_player_dcp_directory () {
951 if (!_player_dcp_directory) {
954 _player_dcp_directory = boost::none;
955 changed (PLAYER_DCP_DIRECTORY);
958 void set_player_kdm_directory (boost::filesystem::path p) {
959 maybe_set (_player_kdm_directory, p);
962 void unset_player_kdm_directory () {
963 if (!_player_kdm_directory) {
966 _player_kdm_directory = boost::none;
970 #ifdef DCPOMATIC_VARIANT_SWAROOP
971 void set_player_background_image (boost::filesystem::path p) {
972 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
975 void unset_player_background_image () {
976 if (!_player_background_image) {
979 _player_background_image = boost::none;
980 changed (PLAYER_BACKGROUND_IMAGE);
983 void set_kdm_server_url (std::string s) {
984 maybe_set (_kdm_server_url, s);
987 void set_player_watermark_theatre (std::string p) {
988 maybe_set (_player_watermark_theatre, p);
991 void set_player_watermark_period (int minutes) {
992 maybe_set (_player_watermark_period, minutes);
995 void set_player_watermark_duration (int milliseconds) {
996 maybe_set (_player_watermark_duration, milliseconds);
999 void set_required_monitors (std::vector<Monitor> monitors) {
1000 maybe_set (_required_monitors, monitors);
1004 void changed (Property p = OTHER);
1005 boost::signals2::signal<void (Property)> Changed;
1006 /** Emitted if read() failed on an existing Config file. There is nothing
1007 a listener can do about it: this is just for information.
1009 static boost::signals2::signal<void ()> FailedToLoad;
1010 /** Emitted if read() issued a warning which the user might want to know about */
1011 static boost::signals2::signal<void (std::string)> Warning;
1012 /** Emitted if there is a bad certificate in the signer chain. Handler can call
1013 * true to ask Config to re-create the chain.
1015 static boost::signals2::signal<bool (void)> BadSignerChain;
1017 void write () const;
1018 void write_config () const;
1019 void write_cinemas () const;
1020 void link (boost::filesystem::path new_file) const;
1021 void copy_and_link (boost::filesystem::path new_file) const;
1022 bool have_write_permission () const;
1024 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1025 bool existing_template (std::string name) const;
1026 std::list<std::string> templates () const;
1027 boost::filesystem::path template_path (std::string name) const;
1028 void rename_template (std::string old_name, std::string new_name) const;
1029 void delete_template (std::string name) const;
1031 static Config* instance ();
1032 static void drop ();
1033 static void restore_defaults ();
1034 static bool have_existing (std::string);
1035 static boost::filesystem::path config_file ();
1036 static boost::filesystem::path path (std::string file, bool create_directories = true);
1038 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1039 static boost::optional<boost::filesystem::path> override_path;
1044 void set_defaults ();
1045 void set_kdm_email_to_default ();
1046 void set_notification_email_to_default ();
1047 void set_cover_sheet_to_default ();
1048 void read_cinemas (cxml::Document const & f);
1049 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1050 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1051 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1055 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1056 if (member == new_value) {
1064 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1065 if (member && member.get() == new_value) {
1072 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1073 int _master_encoding_threads;
1074 /** number of threads which a server should use for J2K encoding on the local machine */
1075 int _server_encoding_threads;
1076 /** default directory to put new films in */
1077 boost::optional<boost::filesystem::path> _default_directory;
1078 /** base port number to use for J2K encoding servers;
1079 * this port and the two above it will be used.
1081 int _server_port_base;
1082 /** true to broadcast on the `any' address to look for servers */
1083 bool _use_any_servers;
1084 /** J2K encoding servers that should definitely be used */
1085 std::vector<std::string> _servers;
1086 bool _only_servers_encode;
1087 Protocol _tms_protocol;
1088 /** The IP address of a TMS that we can copy DCPs to */
1089 std::string _tms_ip;
1090 /** The path on a TMS that we should write DCPs to */
1091 std::string _tms_path;
1092 /** User name to log into the TMS with */
1093 std::string _tms_user;
1094 /** Password to log into the TMS with */
1095 std::string _tms_password;
1096 /** Our cinema sound processor */
1097 CinemaSoundProcessor const * _cinema_sound_processor;
1098 std::list<int> _allowed_dcp_frame_rates;
1099 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1100 bool _allow_any_dcp_frame_rate;
1101 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1102 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1103 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1105 bool _allow_any_container;
1106 /** Default ISDCF metadata for newly-created Films */
1107 ISDCFMetadata _default_isdcf_metadata;
1108 boost::optional<std::string> _language;
1109 /** Default length of still image content (seconds) */
1110 int _default_still_length;
1111 Ratio const * _default_container;
1112 Ratio const * _default_scale_to;
1113 DCPContentType const * _default_dcp_content_type;
1114 int _default_dcp_audio_channels;
1115 std::string _dcp_issuer;
1116 std::string _dcp_creator;
1117 int _default_j2k_bandwidth;
1118 int _default_audio_delay;
1119 bool _default_interop;
1120 /** Default directory to offer to write KDMs to; if it's not set,
1121 the home directory will be offered.
1123 boost::optional<boost::filesystem::path> _default_kdm_directory;
1124 bool _default_upload_after_make_dcp;
1125 std::list<boost::shared_ptr<Cinema> > _cinemas;
1126 std::string _mail_server;
1128 std::string _mail_user;
1129 std::string _mail_password;
1130 std::string _kdm_subject;
1131 std::string _kdm_from;
1132 std::vector<std::string> _kdm_cc;
1133 std::string _kdm_bcc;
1134 std::string _kdm_email;
1135 std::string _notification_subject;
1136 std::string _notification_from;
1137 std::string _notification_to;
1138 std::vector<std::string> _notification_cc;
1139 std::string _notification_bcc;
1140 std::string _notification_email;
1141 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1142 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1143 * certificate for making KDMs given to DCP-o-matic.
1145 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1146 /** true to check for updates on startup */
1147 bool _check_for_updates;
1148 bool _check_for_test_updates;
1149 /** maximum allowed J2K bandwidth in bits per second */
1150 int _maximum_j2k_bandwidth;
1152 bool _analyse_ebur128;
1153 bool _automatic_audio_analysis;
1154 #ifdef DCPOMATIC_WINDOWS
1155 bool _win32_console;
1157 std::vector<boost::filesystem::path> _history;
1158 std::vector<boost::filesystem::path> _player_history;
1159 boost::shared_ptr<DKDMGroup> _dkdms;
1160 boost::filesystem::path _cinemas_file;
1161 bool _show_hints_before_make_dcp;
1162 bool _confirm_kdm_email;
1163 dcp::NameFormat _kdm_filename_format;
1164 dcp::NameFormat _kdm_container_name_format;
1165 dcp::NameFormat _dcp_metadata_filename_format;
1166 dcp::NameFormat _dcp_asset_filename_format;
1167 bool _jump_to_selected;
1168 bool _nagged[NAG_COUNT];
1170 /** name of a specific sound output stream to use, or empty to use the default */
1171 boost::optional<std::string> _sound_output;
1172 std::string _cover_sheet;
1173 boost::optional<boost::filesystem::path> _last_player_load_directory;
1174 boost::optional<KDMWriteType> _last_kdm_write_type;
1175 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1176 int _frames_in_memory_multiplier;
1177 boost::optional<int> _decode_reduction;
1178 bool _default_notify;
1179 bool _notification[NOTIFICATION_COUNT];
1180 boost::optional<std::string> _barco_username;
1181 boost::optional<std::string> _barco_password;
1182 boost::optional<std::string> _christie_username;
1183 boost::optional<std::string> _christie_password;
1184 boost::optional<std::string> _gdc_username;
1185 boost::optional<std::string> _gdc_password;
1186 Interface _interface_complexity;
1187 PlayerMode _player_mode;
1189 bool _respect_kdm_validity_periods;
1190 boost::optional<boost::filesystem::path> _player_log_file;
1191 /** A directory containing DCPs whose contents are presented to the user
1192 in the dual-screen player mode. DCPs on the list can be loaded
1195 boost::optional<boost::filesystem::path> _player_dcp_directory;
1196 boost::optional<boost::filesystem::path> _player_kdm_directory;
1197 #ifdef DCPOMATIC_VARIANT_SWAROOP
1198 boost::optional<boost::filesystem::path> _player_background_image;
1199 std::string _kdm_server_url;
1200 std::string _player_watermark_theatre;
1201 /** watermark period in minutes */
1202 int _player_watermark_period;
1203 /** watermark duration in milliseconds */
1204 int _player_watermark_duration;
1205 std::vector<Monitor> _required_monitors;
1208 static int const _current_version;
1210 /** Singleton instance, or 0 */
1211 static Config* _instance;