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;
81 #ifdef DCPOMATIC_VARIANT_SWAROOP
82 PLAYER_BACKGROUND_IMAGE,
87 /** @return base port number to use for J2K encoding servers */
88 int server_port_base () const {
89 return _server_port_base;
92 void set_use_any_servers (bool u) {
94 changed (USE_ANY_SERVERS);
97 bool use_any_servers () const {
98 return _use_any_servers;
101 /** @param s New list of servers */
102 void set_servers (std::vector<std::string> s) {
107 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
108 std::vector<std::string> servers () const {
112 bool only_servers_encode () const {
113 return _only_servers_encode;
116 Protocol tms_protocol () const {
117 return _tms_protocol;
120 /** @return The IP address of a TMS that we can copy DCPs to */
121 std::string tms_ip () const {
125 /** @return The path on a TMS that we should changed DCPs to */
126 std::string tms_path () const {
130 /** @return User name to log into the TMS with */
131 std::string tms_user () const {
135 /** @return Password to log into the TMS with */
136 std::string tms_password () const {
137 return _tms_password;
140 /** @return The cinema sound processor that we are using */
141 CinemaSoundProcessor const * cinema_sound_processor () const {
142 return _cinema_sound_processor;
145 std::list<boost::shared_ptr<Cinema> > cinemas () const {
149 std::list<int> allowed_dcp_frame_rates () const {
150 return _allowed_dcp_frame_rates;
153 bool allow_any_dcp_frame_rate () const {
154 return _allow_any_dcp_frame_rate;
157 bool allow_any_container () const {
158 return _allow_any_container;
161 ISDCFMetadata default_isdcf_metadata () const {
162 return _default_isdcf_metadata;
165 boost::optional<std::string> language () const {
169 int default_still_length () const {
170 return _default_still_length;
173 Ratio const * default_container () const {
174 return _default_container;
177 Ratio const * default_scale_to () const {
178 return _default_scale_to;
181 DCPContentType const * default_dcp_content_type () const {
182 return _default_dcp_content_type;
185 int default_dcp_audio_channels () const {
186 return _default_dcp_audio_channels;
189 std::string dcp_issuer () const {
193 std::string dcp_creator () const {
197 int default_j2k_bandwidth () const {
198 return _default_j2k_bandwidth;
201 int default_audio_delay () const {
202 return _default_audio_delay;
205 bool default_interop () const {
206 return _default_interop;
209 bool default_upload_after_make_dcp () {
210 return _default_upload_after_make_dcp;
213 void set_default_kdm_directory (boost::filesystem::path d) {
214 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
217 _default_kdm_directory = d;
221 std::string mail_server () const {
225 int mail_port () const {
229 std::string mail_user () const {
233 std::string mail_password () const {
234 return _mail_password;
237 std::string kdm_subject () const {
241 std::string kdm_from () const {
245 std::vector<std::string> kdm_cc () const {
249 std::string kdm_bcc () const {
253 std::string kdm_email () const {
257 std::string notification_subject () const {
258 return _notification_subject;
261 std::string notification_from () const {
262 return _notification_from;
265 std::string notification_to () const {
266 return _notification_to;
269 std::vector<std::string> notification_cc () const {
270 return _notification_cc;
273 std::string notification_bcc () const {
274 return _notification_bcc;
277 std::string notification_email () const {
278 return _notification_email;
281 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
282 return _signer_chain;
285 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
286 return _decryption_chain;
289 bool check_for_updates () const {
290 return _check_for_updates;
293 bool check_for_test_updates () const {
294 return _check_for_test_updates;
297 int maximum_j2k_bandwidth () const {
298 return _maximum_j2k_bandwidth;
301 int log_types () const {
305 bool analyse_ebur128 () const {
306 return _analyse_ebur128;
309 bool automatic_audio_analysis () const {
310 return _automatic_audio_analysis;
313 #ifdef DCPOMATIC_WINDOWS
314 bool win32_console () const {
315 return _win32_console;
319 std::vector<boost::filesystem::path> history () const {
323 std::vector<boost::filesystem::path> player_history () const {
324 return _player_history;
327 boost::shared_ptr<DKDMGroup> dkdms () const {
331 boost::filesystem::path cinemas_file () const {
332 return _cinemas_file;
335 bool show_hints_before_make_dcp () const {
336 return _show_hints_before_make_dcp;
339 bool confirm_kdm_email () const {
340 return _confirm_kdm_email;
343 dcp::NameFormat kdm_container_name_format () const {
344 return _kdm_container_name_format;
347 dcp::NameFormat kdm_filename_format () const {
348 return _kdm_filename_format;
351 dcp::NameFormat dcp_metadata_filename_format () const {
352 return _dcp_metadata_filename_format;
355 dcp::NameFormat dcp_asset_filename_format () const {
356 return _dcp_asset_filename_format;
359 bool jump_to_selected () const {
360 return _jump_to_selected;
365 NAG_ENCRYPTED_METADATA,
366 NAG_REMAKE_DECRYPTION_CHAIN,
367 NAG_BAD_SIGNER_CHAIN,
368 /* Not really a nag but it's the same idea */
373 bool nagged (Nag nag) const {
377 bool sound () const {
381 std::string cover_sheet () const {
385 boost::optional<std::string> sound_output () const {
386 return _sound_output;
389 boost::optional<boost::filesystem::path> last_player_load_directory () const {
390 return _last_player_load_directory;
399 boost::optional<KDMWriteType> last_kdm_write_type () const {
400 return _last_kdm_write_type;
408 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
409 return _last_dkdm_write_type;
412 int frames_in_memory_multiplier () const {
413 return _frames_in_memory_multiplier;
416 boost::optional<int> decode_reduction () const {
417 return _decode_reduction;
420 bool default_notify () const {
421 return _default_notify;
430 bool notification (Notification n) const {
431 return _notification[n];
434 boost::optional<std::string> barco_username () const {
435 return _barco_username;
438 boost::optional<std::string> barco_password () const {
439 return _barco_password;
442 boost::optional<std::string> christie_username () const {
443 return _christie_username;
446 boost::optional<std::string> christie_password () const {
447 return _christie_password;
450 boost::optional<std::string> gdc_username () const {
451 return _gdc_username;
454 boost::optional<std::string> gdc_password () const {
455 return _gdc_password;
463 Interface interface_complexity () const {
464 return _interface_complexity;
473 PlayerMode player_mode () const {
477 int image_display () const {
478 return _image_display;
481 bool respect_kdm_validity_periods () const {
482 return _respect_kdm_validity_periods;
485 boost::optional<boost::filesystem::path> player_log_file () const {
486 return _player_log_file;
489 boost::optional<boost::filesystem::path> player_dcp_directory () const {
490 return _player_dcp_directory;
493 boost::optional<boost::filesystem::path> player_kdm_directory () const {
494 return _player_kdm_directory;
497 #ifdef DCPOMATIC_VARIANT_SWAROOP
498 boost::optional<boost::filesystem::path> player_background_image () const {
499 return _player_background_image;
502 std::string kdm_server_url () const {
503 return _kdm_server_url;
506 std::string player_watermark_theatre () const {
507 return _player_watermark_theatre;
510 int player_watermark_period () const {
511 return _player_watermark_period;
514 int player_watermark_duration () const {
515 return _player_watermark_duration;
518 std::vector<Monitor> required_monitors () const {
519 return _required_monitors;
525 void set_master_encoding_threads (int n) {
526 maybe_set (_master_encoding_threads, n);
529 void set_server_encoding_threads (int n) {
530 maybe_set (_server_encoding_threads, n);
533 void set_default_directory (boost::filesystem::path d) {
534 if (_default_directory && *_default_directory == d) {
537 _default_directory = d;
541 /** @param p New server port */
542 void set_server_port_base (int p) {
543 maybe_set (_server_port_base, p);
546 void set_only_servers_encode (bool o) {
547 maybe_set (_only_servers_encode, o);
550 void set_tms_protocol (Protocol p) {
551 maybe_set (_tms_protocol, p);
554 /** @param i IP address of a TMS that we can copy DCPs to */
555 void set_tms_ip (std::string i) {
556 maybe_set (_tms_ip, i);
559 /** @param p Path on a TMS that we should changed DCPs to */
560 void set_tms_path (std::string p) {
561 maybe_set (_tms_path, p);
564 /** @param u User name to log into the TMS with */
565 void set_tms_user (std::string u) {
566 maybe_set (_tms_user, u);
569 /** @param p Password to log into the TMS with */
570 void set_tms_password (std::string p) {
571 maybe_set (_tms_password, p);
574 void add_cinema (boost::shared_ptr<Cinema> c) {
575 _cinemas.push_back (c);
579 void remove_cinema (boost::shared_ptr<Cinema> c) {
584 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
585 maybe_set (_allowed_dcp_frame_rates, r);
588 void set_allow_any_dcp_frame_rate (bool a) {
589 maybe_set (_allow_any_dcp_frame_rate, a);
592 void set_allow_any_container (bool a) {
593 maybe_set (_allow_any_container, a);
596 void set_default_isdcf_metadata (ISDCFMetadata d) {
597 maybe_set (_default_isdcf_metadata, d);
600 void set_language (std::string l) {
601 if (_language && _language.get() == l) {
608 void unset_language () {
613 _language = boost::none;
617 void set_default_still_length (int s) {
618 maybe_set (_default_still_length, s);
621 void set_default_container (Ratio const * c) {
622 maybe_set (_default_container, c);
625 void set_default_scale_to (Ratio const * c) {
626 maybe_set (_default_scale_to, c);
629 void set_default_dcp_content_type (DCPContentType const * t) {
630 maybe_set (_default_dcp_content_type, t);
633 void set_default_dcp_audio_channels (int c) {
634 maybe_set (_default_dcp_audio_channels, c);
637 void set_dcp_issuer (std::string i) {
638 maybe_set (_dcp_issuer, i);
641 void set_dcp_creator (std::string c) {
642 maybe_set (_dcp_creator, c);
645 void set_default_j2k_bandwidth (int b) {
646 maybe_set (_default_j2k_bandwidth, b);
649 void set_default_audio_delay (int d) {
650 maybe_set (_default_audio_delay, d);
653 void set_default_interop (bool i) {
654 maybe_set (_default_interop, i);
657 void set_default_upload_after_make_dcp (bool u) {
658 maybe_set (_default_upload_after_make_dcp, u);
661 void set_mail_server (std::string s) {
662 maybe_set (_mail_server, s);
665 void set_mail_port (int p) {
666 maybe_set (_mail_port, p);
669 void set_mail_user (std::string u) {
670 maybe_set (_mail_user, u);
673 void set_mail_password (std::string p) {
674 maybe_set (_mail_password, p);
677 void set_kdm_subject (std::string s) {
678 maybe_set (_kdm_subject, s);
681 void set_kdm_from (std::string f) {
682 maybe_set (_kdm_from, f);
685 void set_kdm_cc (std::vector<std::string> f) {
686 maybe_set (_kdm_cc, f);
689 void set_kdm_bcc (std::string f) {
690 maybe_set (_kdm_bcc, f);
693 void set_kdm_email (std::string e) {
694 maybe_set (_kdm_email, e);
697 void reset_kdm_email ();
699 void set_notification_subject (std::string s) {
700 maybe_set (_notification_subject, s);
703 void set_notification_from (std::string f) {
704 maybe_set (_notification_from, f);
707 void set_notification_to (std::string t) {
708 maybe_set (_notification_to, t);
711 void set_notification_cc (std::vector<std::string> f) {
712 maybe_set (_notification_cc, f);
715 void set_notification_bcc (std::string f) {
716 maybe_set (_notification_bcc, f);
719 void set_notification_email (std::string e) {
720 maybe_set (_notification_email, e);
723 void reset_notification_email ();
725 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
726 maybe_set (_signer_chain, s);
729 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
730 maybe_set (_decryption_chain, c);
733 void set_check_for_updates (bool c) {
734 maybe_set (_check_for_updates, c);
736 set_check_for_test_updates (false);
740 void set_check_for_test_updates (bool c) {
741 maybe_set (_check_for_test_updates, c);
744 void set_maximum_j2k_bandwidth (int b) {
745 maybe_set (_maximum_j2k_bandwidth, b);
748 void set_log_types (int t) {
749 maybe_set (_log_types, t);
752 void set_analyse_ebur128 (bool a) {
753 maybe_set (_analyse_ebur128, a);
756 void set_automatic_audio_analysis (bool a) {
757 maybe_set (_automatic_audio_analysis, a);
760 #ifdef DCPOMATIC_WINDOWS
761 void set_win32_console (bool c) {
762 maybe_set (_win32_console, c);
766 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
771 void set_cinemas_file (boost::filesystem::path file);
773 void set_show_hints_before_make_dcp (bool s) {
774 maybe_set (_show_hints_before_make_dcp, s);
777 void set_confirm_kdm_email (bool s) {
778 maybe_set (_confirm_kdm_email, s);
781 void set_sound (bool s) {
782 maybe_set (_sound, s, SOUND);
785 void set_sound_output (std::string o) {
786 maybe_set (_sound_output, o, SOUND_OUTPUT);
789 void set_last_player_load_directory (boost::filesystem::path d) {
790 maybe_set (_last_player_load_directory, d);
793 void set_last_kdm_write_type (KDMWriteType t) {
794 maybe_set (_last_kdm_write_type, t);
797 void set_last_dkdm_write_type (DKDMWriteType t) {
798 maybe_set (_last_dkdm_write_type, t);
801 void unset_sound_output () {
802 if (!_sound_output) {
806 _sound_output = boost::none;
810 void set_kdm_container_name_format (dcp::NameFormat n) {
811 maybe_set (_kdm_container_name_format, n);
814 void set_kdm_filename_format (dcp::NameFormat n) {
815 maybe_set (_kdm_filename_format, n);
818 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
819 maybe_set (_dcp_metadata_filename_format, n);
822 void set_dcp_asset_filename_format (dcp::NameFormat n) {
823 maybe_set (_dcp_asset_filename_format, n);
826 void set_frames_in_memory_multiplier (int m) {
827 maybe_set (_frames_in_memory_multiplier, m);
830 void set_decode_reduction (boost::optional<int> r) {
831 maybe_set (_decode_reduction, r);
834 void set_default_notify (bool n) {
835 maybe_set (_default_notify, n);
838 void clear_history () {
843 void clear_player_history () {
844 _player_history.clear ();
848 void add_to_history (boost::filesystem::path p);
849 void add_to_player_history (boost::filesystem::path p);
851 void set_jump_to_selected (bool j) {
852 maybe_set (_jump_to_selected, j);
855 void set_nagged (Nag nag, bool nagged) {
856 maybe_set (_nagged[nag], nagged);
859 void set_cover_sheet (std::string s) {
860 maybe_set (_cover_sheet, s);
863 void reset_cover_sheet ();
865 void set_notification (Notification n, bool v) {
866 maybe_set (_notification[n], v);
869 void set_barco_username (std::string u) {
870 maybe_set (_barco_username, u);
873 void unset_barco_username () {
874 maybe_set (_barco_username, boost::optional<std::string>());
877 void set_barco_password (std::string p) {
878 maybe_set (_barco_password, p);
881 void unset_barco_password () {
882 maybe_set (_barco_password, boost::optional<std::string>());
885 void set_christie_username (std::string u) {
886 maybe_set (_christie_username, u);
889 void unset_christie_username () {
890 maybe_set (_christie_username, boost::optional<std::string>());
893 void set_christie_password (std::string p) {
894 maybe_set (_christie_password, p);
897 void unset_christie_password () {
898 maybe_set (_christie_password, boost::optional<std::string>());
901 void set_gdc_username (std::string u) {
902 maybe_set (_gdc_username, u);
905 void unset_gdc_username () {
906 maybe_set (_gdc_username, boost::optional<std::string>());
909 void set_gdc_password (std::string p) {
910 maybe_set (_gdc_password, p);
913 void unset_gdc_password () {
914 maybe_set (_gdc_password, boost::optional<std::string>());
917 void set_interface_complexity (Interface i) {
918 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
921 void set_player_mode (PlayerMode m) {
922 maybe_set (_player_mode, m);
925 void set_image_display (int n) {
926 maybe_set (_image_display, n);
929 void set_respect_kdm_validity_periods (bool r) {
930 maybe_set (_respect_kdm_validity_periods, r);
933 void set_player_log_file (boost::filesystem::path p) {
934 maybe_set (_player_log_file, p);
937 void unset_player_log_file () {
938 if (!_player_log_file) {
941 _player_log_file = boost::none;
945 void set_player_dcp_directory (boost::filesystem::path p) {
946 maybe_set (_player_dcp_directory, p, PLAYER_DCP_DIRECTORY);
949 void unset_player_dcp_directory () {
950 if (!_player_dcp_directory) {
953 _player_dcp_directory = boost::none;
954 changed (PLAYER_DCP_DIRECTORY);
957 void set_player_kdm_directory (boost::filesystem::path p) {
958 maybe_set (_player_kdm_directory, p);
961 void unset_player_kdm_directory () {
962 if (!_player_kdm_directory) {
965 _player_kdm_directory = boost::none;
969 #ifdef DCPOMATIC_VARIANT_SWAROOP
970 void set_player_background_image (boost::filesystem::path p) {
971 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
974 void unset_player_background_image () {
975 if (!_player_background_image) {
978 _player_background_image = boost::none;
979 changed (PLAYER_BACKGROUND_IMAGE);
982 void set_kdm_server_url (std::string s) {
983 maybe_set (_kdm_server_url, s);
986 void set_player_watermark_theatre (std::string p) {
987 maybe_set (_player_watermark_theatre, p);
990 void set_player_watermark_period (int minutes) {
991 maybe_set (_player_watermark_period, minutes);
994 void set_player_watermark_duration (int milliseconds) {
995 maybe_set (_player_watermark_duration, milliseconds);
998 void set_required_monitors (std::vector<Monitor> monitors) {
999 maybe_set (_required_monitors, monitors);
1003 void changed (Property p = OTHER);
1004 boost::signals2::signal<void (Property)> Changed;
1005 /** Emitted if read() failed on an existing Config file. There is nothing
1006 a listener can do about it: this is just for information.
1008 static boost::signals2::signal<void ()> FailedToLoad;
1009 /** Emitted if read() issued a warning which the user might want to know about */
1010 static boost::signals2::signal<void (std::string)> Warning;
1011 /** Emitted if there is a bad certificate in the signer chain. Handler can call
1012 * true to ask Config to re-create the chain.
1014 static boost::signals2::signal<bool (void)> BadSignerChain;
1016 void write () const;
1017 void write_config () const;
1018 void write_cinemas () const;
1019 void link (boost::filesystem::path new_file) const;
1020 void copy_and_link (boost::filesystem::path new_file) const;
1021 bool have_write_permission () const;
1023 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1024 bool existing_template (std::string name) const;
1025 std::list<std::string> templates () const;
1026 boost::filesystem::path template_path (std::string name) const;
1027 void rename_template (std::string old_name, std::string new_name) const;
1028 void delete_template (std::string name) const;
1030 static Config* instance ();
1031 static void drop ();
1032 static void restore_defaults ();
1033 static bool have_existing (std::string);
1034 static boost::filesystem::path config_file ();
1036 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1037 static boost::optional<boost::filesystem::path> override_path;
1041 static boost::filesystem::path path (std::string file, bool create_directories = true);
1043 void set_defaults ();
1044 void set_kdm_email_to_default ();
1045 void set_notification_email_to_default ();
1046 void set_cover_sheet_to_default ();
1047 void read_cinemas (cxml::Document const & f);
1048 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1049 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1050 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1054 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1055 if (member == new_value) {
1063 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1064 if (member && member.get() == new_value) {
1071 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1072 int _master_encoding_threads;
1073 /** number of threads which a server should use for J2K encoding on the local machine */
1074 int _server_encoding_threads;
1075 /** default directory to put new films in */
1076 boost::optional<boost::filesystem::path> _default_directory;
1077 /** base port number to use for J2K encoding servers;
1078 * this port and the two above it will be used.
1080 int _server_port_base;
1081 /** true to broadcast on the `any' address to look for servers */
1082 bool _use_any_servers;
1083 /** J2K encoding servers that should definitely be used */
1084 std::vector<std::string> _servers;
1085 bool _only_servers_encode;
1086 Protocol _tms_protocol;
1087 /** The IP address of a TMS that we can copy DCPs to */
1088 std::string _tms_ip;
1089 /** The path on a TMS that we should write DCPs to */
1090 std::string _tms_path;
1091 /** User name to log into the TMS with */
1092 std::string _tms_user;
1093 /** Password to log into the TMS with */
1094 std::string _tms_password;
1095 /** Our cinema sound processor */
1096 CinemaSoundProcessor const * _cinema_sound_processor;
1097 std::list<int> _allowed_dcp_frame_rates;
1098 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1099 bool _allow_any_dcp_frame_rate;
1100 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1101 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1102 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1104 bool _allow_any_container;
1105 /** Default ISDCF metadata for newly-created Films */
1106 ISDCFMetadata _default_isdcf_metadata;
1107 boost::optional<std::string> _language;
1108 /** Default length of still image content (seconds) */
1109 int _default_still_length;
1110 Ratio const * _default_container;
1111 Ratio const * _default_scale_to;
1112 DCPContentType const * _default_dcp_content_type;
1113 int _default_dcp_audio_channels;
1114 std::string _dcp_issuer;
1115 std::string _dcp_creator;
1116 int _default_j2k_bandwidth;
1117 int _default_audio_delay;
1118 bool _default_interop;
1119 /** Default directory to offer to write KDMs to; if it's not set,
1120 the home directory will be offered.
1122 boost::optional<boost::filesystem::path> _default_kdm_directory;
1123 bool _default_upload_after_make_dcp;
1124 std::list<boost::shared_ptr<Cinema> > _cinemas;
1125 std::string _mail_server;
1127 std::string _mail_user;
1128 std::string _mail_password;
1129 std::string _kdm_subject;
1130 std::string _kdm_from;
1131 std::vector<std::string> _kdm_cc;
1132 std::string _kdm_bcc;
1133 std::string _kdm_email;
1134 std::string _notification_subject;
1135 std::string _notification_from;
1136 std::string _notification_to;
1137 std::vector<std::string> _notification_cc;
1138 std::string _notification_bcc;
1139 std::string _notification_email;
1140 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1141 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1142 * certificate for making KDMs given to DCP-o-matic.
1144 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1145 /** true to check for updates on startup */
1146 bool _check_for_updates;
1147 bool _check_for_test_updates;
1148 /** maximum allowed J2K bandwidth in bits per second */
1149 int _maximum_j2k_bandwidth;
1151 bool _analyse_ebur128;
1152 bool _automatic_audio_analysis;
1153 #ifdef DCPOMATIC_WINDOWS
1154 bool _win32_console;
1156 std::vector<boost::filesystem::path> _history;
1157 std::vector<boost::filesystem::path> _player_history;
1158 boost::shared_ptr<DKDMGroup> _dkdms;
1159 boost::filesystem::path _cinemas_file;
1160 bool _show_hints_before_make_dcp;
1161 bool _confirm_kdm_email;
1162 dcp::NameFormat _kdm_filename_format;
1163 dcp::NameFormat _kdm_container_name_format;
1164 dcp::NameFormat _dcp_metadata_filename_format;
1165 dcp::NameFormat _dcp_asset_filename_format;
1166 bool _jump_to_selected;
1167 bool _nagged[NAG_COUNT];
1169 /** name of a specific sound output stream to use, or empty to use the default */
1170 boost::optional<std::string> _sound_output;
1171 std::string _cover_sheet;
1172 boost::optional<boost::filesystem::path> _last_player_load_directory;
1173 boost::optional<KDMWriteType> _last_kdm_write_type;
1174 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1175 int _frames_in_memory_multiplier;
1176 boost::optional<int> _decode_reduction;
1177 bool _default_notify;
1178 bool _notification[NOTIFICATION_COUNT];
1179 boost::optional<std::string> _barco_username;
1180 boost::optional<std::string> _barco_password;
1181 boost::optional<std::string> _christie_username;
1182 boost::optional<std::string> _christie_password;
1183 boost::optional<std::string> _gdc_username;
1184 boost::optional<std::string> _gdc_password;
1185 Interface _interface_complexity;
1186 PlayerMode _player_mode;
1188 bool _respect_kdm_validity_periods;
1189 boost::optional<boost::filesystem::path> _player_log_file;
1190 /** A directory containing DCPs whose contents are presented to the user
1191 in the dual-screen player mode. DCPs on the list can be loaded
1194 boost::optional<boost::filesystem::path> _player_dcp_directory;
1195 boost::optional<boost::filesystem::path> _player_kdm_directory;
1196 #ifdef DCPOMATIC_VARIANT_SWAROOP
1197 boost::optional<boost::filesystem::path> _player_background_image;
1198 std::string _kdm_server_url;
1199 std::string _player_watermark_theatre;
1200 /** watermark period in minutes */
1201 int _player_watermark_period;
1202 /** watermark duration in milliseconds */
1203 int _player_watermark_duration;
1204 std::vector<Monitor> _required_monitors;
1207 static int const _current_version;
1209 /** Singleton instance, or 0 */
1210 static Config* _instance;