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;
80 PLAYER_CONTENT_DIRECTORY,
81 PLAYER_PLAYLIST_DIRECTORY,
83 #ifdef DCPOMATIC_VARIANT_SWAROOP
84 PLAYER_BACKGROUND_IMAGE,
89 /** @return base port number to use for J2K encoding servers */
90 int server_port_base () const {
91 return _server_port_base;
94 void set_use_any_servers (bool u) {
96 changed (USE_ANY_SERVERS);
99 bool use_any_servers () const {
100 return _use_any_servers;
103 /** @param s New list of servers */
104 void set_servers (std::vector<std::string> s) {
109 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
110 std::vector<std::string> servers () const {
114 bool only_servers_encode () const {
115 return _only_servers_encode;
118 Protocol tms_protocol () const {
119 return _tms_protocol;
122 /** @return The IP address of a TMS that we can copy DCPs to */
123 std::string tms_ip () const {
127 /** @return The path on a TMS that we should changed DCPs to */
128 std::string tms_path () const {
132 /** @return User name to log into the TMS with */
133 std::string tms_user () const {
137 /** @return Password to log into the TMS with */
138 std::string tms_password () const {
139 return _tms_password;
142 /** @return The cinema sound processor that we are using */
143 CinemaSoundProcessor const * cinema_sound_processor () const {
144 return _cinema_sound_processor;
147 std::list<boost::shared_ptr<Cinema> > cinemas () const {
151 std::list<int> allowed_dcp_frame_rates () const {
152 return _allowed_dcp_frame_rates;
155 bool allow_any_dcp_frame_rate () const {
156 return _allow_any_dcp_frame_rate;
159 bool allow_any_container () const {
160 return _allow_any_container;
163 ISDCFMetadata default_isdcf_metadata () const {
164 return _default_isdcf_metadata;
167 boost::optional<std::string> language () const {
171 int default_still_length () const {
172 return _default_still_length;
175 Ratio const * default_container () const {
176 return _default_container;
179 Ratio const * default_scale_to () const {
180 return _default_scale_to;
183 DCPContentType const * default_dcp_content_type () const {
184 return _default_dcp_content_type;
187 int default_dcp_audio_channels () const {
188 return _default_dcp_audio_channels;
191 std::string dcp_issuer () const {
195 std::string dcp_creator () const {
199 int default_j2k_bandwidth () const {
200 return _default_j2k_bandwidth;
203 int default_audio_delay () const {
204 return _default_audio_delay;
207 bool default_interop () const {
208 return _default_interop;
211 bool default_upload_after_make_dcp () {
212 return _default_upload_after_make_dcp;
215 void set_default_kdm_directory (boost::filesystem::path d) {
216 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
219 _default_kdm_directory = d;
223 std::string mail_server () const {
227 int mail_port () const {
231 std::string mail_user () const {
235 std::string mail_password () const {
236 return _mail_password;
239 std::string kdm_subject () const {
243 std::string kdm_from () const {
247 std::vector<std::string> kdm_cc () const {
251 std::string kdm_bcc () const {
255 std::string kdm_email () const {
259 std::string notification_subject () const {
260 return _notification_subject;
263 std::string notification_from () const {
264 return _notification_from;
267 std::string notification_to () const {
268 return _notification_to;
271 std::vector<std::string> notification_cc () const {
272 return _notification_cc;
275 std::string notification_bcc () const {
276 return _notification_bcc;
279 std::string notification_email () const {
280 return _notification_email;
283 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
284 return _signer_chain;
287 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
288 return _decryption_chain;
291 bool check_for_updates () const {
292 return _check_for_updates;
295 bool check_for_test_updates () const {
296 return _check_for_test_updates;
299 int maximum_j2k_bandwidth () const {
300 return _maximum_j2k_bandwidth;
303 int log_types () const {
307 bool analyse_ebur128 () const {
308 return _analyse_ebur128;
311 bool automatic_audio_analysis () const {
312 return _automatic_audio_analysis;
315 #ifdef DCPOMATIC_WINDOWS
316 bool win32_console () const {
317 return _win32_console;
321 std::vector<boost::filesystem::path> history () const {
325 std::vector<boost::filesystem::path> player_history () const {
326 return _player_history;
329 boost::shared_ptr<DKDMGroup> dkdms () const {
333 boost::filesystem::path cinemas_file () const {
334 return _cinemas_file;
337 bool show_hints_before_make_dcp () const {
338 return _show_hints_before_make_dcp;
341 bool confirm_kdm_email () const {
342 return _confirm_kdm_email;
345 dcp::NameFormat kdm_container_name_format () const {
346 return _kdm_container_name_format;
349 dcp::NameFormat kdm_filename_format () const {
350 return _kdm_filename_format;
353 dcp::NameFormat dcp_metadata_filename_format () const {
354 return _dcp_metadata_filename_format;
357 dcp::NameFormat dcp_asset_filename_format () const {
358 return _dcp_asset_filename_format;
361 bool jump_to_selected () const {
362 return _jump_to_selected;
367 NAG_ENCRYPTED_METADATA,
368 NAG_REMAKE_DECRYPTION_CHAIN,
369 NAG_BAD_SIGNER_CHAIN,
370 /* Not really a nag but it's the same idea */
375 bool nagged (Nag nag) const {
379 bool sound () const {
383 std::string cover_sheet () const {
387 boost::optional<std::string> sound_output () const {
388 return _sound_output;
391 boost::optional<boost::filesystem::path> last_player_load_directory () const {
392 return _last_player_load_directory;
401 boost::optional<KDMWriteType> last_kdm_write_type () const {
402 return _last_kdm_write_type;
410 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
411 return _last_dkdm_write_type;
414 int frames_in_memory_multiplier () const {
415 return _frames_in_memory_multiplier;
418 boost::optional<int> decode_reduction () const {
419 return _decode_reduction;
422 bool default_notify () const {
423 return _default_notify;
432 bool notification (Notification n) const {
433 return _notification[n];
436 boost::optional<std::string> barco_username () const {
437 return _barco_username;
440 boost::optional<std::string> barco_password () const {
441 return _barco_password;
444 boost::optional<std::string> christie_username () const {
445 return _christie_username;
448 boost::optional<std::string> christie_password () const {
449 return _christie_password;
452 boost::optional<std::string> gdc_username () const {
453 return _gdc_username;
456 boost::optional<std::string> gdc_password () const {
457 return _gdc_password;
465 Interface interface_complexity () const {
466 return _interface_complexity;
475 PlayerMode player_mode () const {
479 int image_display () const {
480 return _image_display;
483 bool respect_kdm_validity_periods () const {
484 return _respect_kdm_validity_periods;
487 boost::optional<boost::filesystem::path> player_log_file () const {
488 return _player_log_file;
491 boost::optional<boost::filesystem::path> player_content_directory () const {
492 return _player_content_directory;
495 boost::optional<boost::filesystem::path> player_playlist_directory () const {
496 return _player_playlist_directory;
499 boost::optional<boost::filesystem::path> player_kdm_directory () const {
500 return _player_kdm_directory;
503 #ifdef DCPOMATIC_VARIANT_SWAROOP
504 boost::optional<boost::filesystem::path> player_background_image () const {
505 return _player_background_image;
508 std::string kdm_server_url () const {
509 return _kdm_server_url;
512 std::string player_watermark_theatre () const {
513 return _player_watermark_theatre;
516 int player_watermark_period () const {
517 return _player_watermark_period;
520 int player_watermark_duration () const {
521 return _player_watermark_duration;
524 std::vector<Monitor> required_monitors () const {
525 return _required_monitors;
528 boost::optional<boost::filesystem::path> player_lock_file () const {
529 return _player_lock_file;
535 void set_master_encoding_threads (int n) {
536 maybe_set (_master_encoding_threads, n);
539 void set_server_encoding_threads (int n) {
540 maybe_set (_server_encoding_threads, n);
543 void set_default_directory (boost::filesystem::path d) {
544 if (_default_directory && *_default_directory == d) {
547 _default_directory = d;
551 /** @param p New server port */
552 void set_server_port_base (int p) {
553 maybe_set (_server_port_base, p);
556 void set_only_servers_encode (bool o) {
557 maybe_set (_only_servers_encode, o);
560 void set_tms_protocol (Protocol p) {
561 maybe_set (_tms_protocol, p);
564 /** @param i IP address of a TMS that we can copy DCPs to */
565 void set_tms_ip (std::string i) {
566 maybe_set (_tms_ip, i);
569 /** @param p Path on a TMS that we should changed DCPs to */
570 void set_tms_path (std::string p) {
571 maybe_set (_tms_path, p);
574 /** @param u User name to log into the TMS with */
575 void set_tms_user (std::string u) {
576 maybe_set (_tms_user, u);
579 /** @param p Password to log into the TMS with */
580 void set_tms_password (std::string p) {
581 maybe_set (_tms_password, p);
584 void add_cinema (boost::shared_ptr<Cinema> c) {
585 _cinemas.push_back (c);
589 void remove_cinema (boost::shared_ptr<Cinema> c) {
594 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
595 maybe_set (_allowed_dcp_frame_rates, r);
598 void set_allow_any_dcp_frame_rate (bool a) {
599 maybe_set (_allow_any_dcp_frame_rate, a);
602 void set_allow_any_container (bool a) {
603 maybe_set (_allow_any_container, a);
606 void set_default_isdcf_metadata (ISDCFMetadata d) {
607 maybe_set (_default_isdcf_metadata, d);
610 void set_language (std::string l) {
611 if (_language && _language.get() == l) {
618 void unset_language () {
623 _language = boost::none;
627 void set_default_still_length (int s) {
628 maybe_set (_default_still_length, s);
631 void set_default_container (Ratio const * c) {
632 maybe_set (_default_container, c);
635 void set_default_scale_to (Ratio const * c) {
636 maybe_set (_default_scale_to, c);
639 void set_default_dcp_content_type (DCPContentType const * t) {
640 maybe_set (_default_dcp_content_type, t);
643 void set_default_dcp_audio_channels (int c) {
644 maybe_set (_default_dcp_audio_channels, c);
647 void set_dcp_issuer (std::string i) {
648 maybe_set (_dcp_issuer, i);
651 void set_dcp_creator (std::string c) {
652 maybe_set (_dcp_creator, c);
655 void set_default_j2k_bandwidth (int b) {
656 maybe_set (_default_j2k_bandwidth, b);
659 void set_default_audio_delay (int d) {
660 maybe_set (_default_audio_delay, d);
663 void set_default_interop (bool i) {
664 maybe_set (_default_interop, i);
667 void set_default_upload_after_make_dcp (bool u) {
668 maybe_set (_default_upload_after_make_dcp, u);
671 void set_mail_server (std::string s) {
672 maybe_set (_mail_server, s);
675 void set_mail_port (int p) {
676 maybe_set (_mail_port, p);
679 void set_mail_user (std::string u) {
680 maybe_set (_mail_user, u);
683 void set_mail_password (std::string p) {
684 maybe_set (_mail_password, p);
687 void set_kdm_subject (std::string s) {
688 maybe_set (_kdm_subject, s);
691 void set_kdm_from (std::string f) {
692 maybe_set (_kdm_from, f);
695 void set_kdm_cc (std::vector<std::string> f) {
696 maybe_set (_kdm_cc, f);
699 void set_kdm_bcc (std::string f) {
700 maybe_set (_kdm_bcc, f);
703 void set_kdm_email (std::string e) {
704 maybe_set (_kdm_email, e);
707 void reset_kdm_email ();
709 void set_notification_subject (std::string s) {
710 maybe_set (_notification_subject, s);
713 void set_notification_from (std::string f) {
714 maybe_set (_notification_from, f);
717 void set_notification_to (std::string t) {
718 maybe_set (_notification_to, t);
721 void set_notification_cc (std::vector<std::string> f) {
722 maybe_set (_notification_cc, f);
725 void set_notification_bcc (std::string f) {
726 maybe_set (_notification_bcc, f);
729 void set_notification_email (std::string e) {
730 maybe_set (_notification_email, e);
733 void reset_notification_email ();
735 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
736 maybe_set (_signer_chain, s);
739 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
740 maybe_set (_decryption_chain, c);
743 void set_check_for_updates (bool c) {
744 maybe_set (_check_for_updates, c);
746 set_check_for_test_updates (false);
750 void set_check_for_test_updates (bool c) {
751 maybe_set (_check_for_test_updates, c);
754 void set_maximum_j2k_bandwidth (int b) {
755 maybe_set (_maximum_j2k_bandwidth, b);
758 void set_log_types (int t) {
759 maybe_set (_log_types, t);
762 void set_analyse_ebur128 (bool a) {
763 maybe_set (_analyse_ebur128, a);
766 void set_automatic_audio_analysis (bool a) {
767 maybe_set (_automatic_audio_analysis, a);
770 #ifdef DCPOMATIC_WINDOWS
771 void set_win32_console (bool c) {
772 maybe_set (_win32_console, c);
776 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
781 void set_cinemas_file (boost::filesystem::path file);
783 void set_show_hints_before_make_dcp (bool s) {
784 maybe_set (_show_hints_before_make_dcp, s);
787 void set_confirm_kdm_email (bool s) {
788 maybe_set (_confirm_kdm_email, s);
791 void set_sound (bool s) {
792 maybe_set (_sound, s, SOUND);
795 void set_sound_output (std::string o) {
796 maybe_set (_sound_output, o, SOUND_OUTPUT);
799 void set_last_player_load_directory (boost::filesystem::path d) {
800 maybe_set (_last_player_load_directory, d);
803 void set_last_kdm_write_type (KDMWriteType t) {
804 maybe_set (_last_kdm_write_type, t);
807 void set_last_dkdm_write_type (DKDMWriteType t) {
808 maybe_set (_last_dkdm_write_type, t);
811 void unset_sound_output () {
812 if (!_sound_output) {
816 _sound_output = boost::none;
820 void set_kdm_container_name_format (dcp::NameFormat n) {
821 maybe_set (_kdm_container_name_format, n);
824 void set_kdm_filename_format (dcp::NameFormat n) {
825 maybe_set (_kdm_filename_format, n);
828 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
829 maybe_set (_dcp_metadata_filename_format, n);
832 void set_dcp_asset_filename_format (dcp::NameFormat n) {
833 maybe_set (_dcp_asset_filename_format, n);
836 void set_frames_in_memory_multiplier (int m) {
837 maybe_set (_frames_in_memory_multiplier, m);
840 void set_decode_reduction (boost::optional<int> r) {
841 maybe_set (_decode_reduction, r);
844 void set_default_notify (bool n) {
845 maybe_set (_default_notify, n);
848 void clear_history () {
853 void clear_player_history () {
854 _player_history.clear ();
858 void add_to_history (boost::filesystem::path p);
859 void add_to_player_history (boost::filesystem::path p);
861 void set_jump_to_selected (bool j) {
862 maybe_set (_jump_to_selected, j);
865 void set_nagged (Nag nag, bool nagged) {
866 maybe_set (_nagged[nag], nagged);
869 void set_cover_sheet (std::string s) {
870 maybe_set (_cover_sheet, s);
873 void reset_cover_sheet ();
875 void set_notification (Notification n, bool v) {
876 maybe_set (_notification[n], v);
879 void set_barco_username (std::string u) {
880 maybe_set (_barco_username, u);
883 void unset_barco_username () {
884 maybe_set (_barco_username, boost::optional<std::string>());
887 void set_barco_password (std::string p) {
888 maybe_set (_barco_password, p);
891 void unset_barco_password () {
892 maybe_set (_barco_password, boost::optional<std::string>());
895 void set_christie_username (std::string u) {
896 maybe_set (_christie_username, u);
899 void unset_christie_username () {
900 maybe_set (_christie_username, boost::optional<std::string>());
903 void set_christie_password (std::string p) {
904 maybe_set (_christie_password, p);
907 void unset_christie_password () {
908 maybe_set (_christie_password, boost::optional<std::string>());
911 void set_gdc_username (std::string u) {
912 maybe_set (_gdc_username, u);
915 void unset_gdc_username () {
916 maybe_set (_gdc_username, boost::optional<std::string>());
919 void set_gdc_password (std::string p) {
920 maybe_set (_gdc_password, p);
923 void unset_gdc_password () {
924 maybe_set (_gdc_password, boost::optional<std::string>());
927 void set_interface_complexity (Interface i) {
928 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
931 void set_player_mode (PlayerMode m) {
932 maybe_set (_player_mode, m);
935 void set_image_display (int n) {
936 maybe_set (_image_display, n);
939 void set_respect_kdm_validity_periods (bool r) {
940 maybe_set (_respect_kdm_validity_periods, r);
943 void set_player_log_file (boost::filesystem::path p) {
944 maybe_set (_player_log_file, p);
947 void unset_player_log_file () {
948 if (!_player_log_file) {
951 _player_log_file = boost::none;
955 void set_player_content_directory (boost::filesystem::path p) {
956 maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
959 void unset_player_content_directory () {
960 if (!_player_content_directory) {
963 _player_content_directory = boost::none;
964 changed (PLAYER_CONTENT_DIRECTORY);
967 void set_player_playlist_directory (boost::filesystem::path p) {
968 maybe_set (_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
971 void unset_player_playlist_directory () {
972 if (!_player_playlist_directory) {
975 _player_playlist_directory = boost::none;
976 changed (PLAYER_PLAYLIST_DIRECTORY);
979 void set_player_kdm_directory (boost::filesystem::path p) {
980 maybe_set (_player_kdm_directory, p);
983 void unset_player_kdm_directory () {
984 if (!_player_kdm_directory) {
987 _player_kdm_directory = boost::none;
991 #ifdef DCPOMATIC_VARIANT_SWAROOP
992 void set_player_background_image (boost::filesystem::path p) {
993 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
996 void unset_player_background_image () {
997 if (!_player_background_image) {
1000 _player_background_image = boost::none;
1001 changed (PLAYER_BACKGROUND_IMAGE);
1004 void set_kdm_server_url (std::string s) {
1005 maybe_set (_kdm_server_url, s);
1008 void set_player_watermark_theatre (std::string p) {
1009 maybe_set (_player_watermark_theatre, p);
1012 void set_player_watermark_period (int minutes) {
1013 maybe_set (_player_watermark_period, minutes);
1016 void set_player_watermark_duration (int milliseconds) {
1017 maybe_set (_player_watermark_duration, milliseconds);
1020 void set_required_monitors (std::vector<Monitor> monitors) {
1021 maybe_set (_required_monitors, monitors);
1024 void set_player_lock_file (boost::filesystem::path p) {
1025 maybe_set (_player_lock_file, p);
1028 void unset_player_lock_file () {
1029 if (!_player_lock_file) {
1032 _player_lock_file = boost::none;
1037 void changed (Property p = OTHER);
1038 boost::signals2::signal<void (Property)> Changed;
1039 /** Emitted if read() failed on an existing Config file. There is nothing
1040 a listener can do about it: this is just for information.
1042 static boost::signals2::signal<void ()> FailedToLoad;
1043 /** Emitted if read() issued a warning which the user might want to know about */
1044 static boost::signals2::signal<void (std::string)> Warning;
1045 /** Emitted if there is a bad certificate in the signer chain. Handler can call
1046 * true to ask Config to re-create the chain.
1048 static boost::signals2::signal<bool (void)> BadSignerChain;
1050 void write () const;
1051 void write_config () const;
1052 void write_cinemas () const;
1053 void link (boost::filesystem::path new_file) const;
1054 void copy_and_link (boost::filesystem::path new_file) const;
1055 bool have_write_permission () const;
1057 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1058 bool existing_template (std::string name) const;
1059 std::list<std::string> templates () const;
1060 boost::filesystem::path template_path (std::string name) const;
1061 void rename_template (std::string old_name, std::string new_name) const;
1062 void delete_template (std::string name) const;
1064 static Config* instance ();
1065 static void drop ();
1066 static void restore_defaults ();
1067 static bool have_existing (std::string);
1068 static boost::filesystem::path config_file ();
1069 static boost::filesystem::path path (std::string file, bool create_directories = true);
1071 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1072 static boost::optional<boost::filesystem::path> override_path;
1077 void set_defaults ();
1078 void set_kdm_email_to_default ();
1079 void set_notification_email_to_default ();
1080 void set_cover_sheet_to_default ();
1081 void read_cinemas (cxml::Document const & f);
1082 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1083 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1084 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1086 #ifdef DCPOMATIC_VARIANT_SWAROOP
1087 dcp::Data key_from_uuid () const;
1091 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1092 if (member == new_value) {
1100 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1101 if (member && member.get() == new_value) {
1108 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1109 int _master_encoding_threads;
1110 /** number of threads which a server should use for J2K encoding on the local machine */
1111 int _server_encoding_threads;
1112 /** default directory to put new films in */
1113 boost::optional<boost::filesystem::path> _default_directory;
1114 /** base port number to use for J2K encoding servers;
1115 * this port and the two above it will be used.
1117 int _server_port_base;
1118 /** true to broadcast on the `any' address to look for servers */
1119 bool _use_any_servers;
1120 /** J2K encoding servers that should definitely be used */
1121 std::vector<std::string> _servers;
1122 bool _only_servers_encode;
1123 Protocol _tms_protocol;
1124 /** The IP address of a TMS that we can copy DCPs to */
1125 std::string _tms_ip;
1126 /** The path on a TMS that we should write DCPs to */
1127 std::string _tms_path;
1128 /** User name to log into the TMS with */
1129 std::string _tms_user;
1130 /** Password to log into the TMS with */
1131 std::string _tms_password;
1132 /** Our cinema sound processor */
1133 CinemaSoundProcessor const * _cinema_sound_processor;
1134 std::list<int> _allowed_dcp_frame_rates;
1135 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1136 bool _allow_any_dcp_frame_rate;
1137 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1138 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1139 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1141 bool _allow_any_container;
1142 /** Default ISDCF metadata for newly-created Films */
1143 ISDCFMetadata _default_isdcf_metadata;
1144 boost::optional<std::string> _language;
1145 /** Default length of still image content (seconds) */
1146 int _default_still_length;
1147 Ratio const * _default_container;
1148 Ratio const * _default_scale_to;
1149 DCPContentType const * _default_dcp_content_type;
1150 int _default_dcp_audio_channels;
1151 std::string _dcp_issuer;
1152 std::string _dcp_creator;
1153 int _default_j2k_bandwidth;
1154 int _default_audio_delay;
1155 bool _default_interop;
1156 /** Default directory to offer to write KDMs to; if it's not set,
1157 the home directory will be offered.
1159 boost::optional<boost::filesystem::path> _default_kdm_directory;
1160 bool _default_upload_after_make_dcp;
1161 std::list<boost::shared_ptr<Cinema> > _cinemas;
1162 std::string _mail_server;
1164 std::string _mail_user;
1165 std::string _mail_password;
1166 std::string _kdm_subject;
1167 std::string _kdm_from;
1168 std::vector<std::string> _kdm_cc;
1169 std::string _kdm_bcc;
1170 std::string _kdm_email;
1171 std::string _notification_subject;
1172 std::string _notification_from;
1173 std::string _notification_to;
1174 std::vector<std::string> _notification_cc;
1175 std::string _notification_bcc;
1176 std::string _notification_email;
1177 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1178 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1179 * certificate for making KDMs given to DCP-o-matic.
1181 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1182 /** true to check for updates on startup */
1183 bool _check_for_updates;
1184 bool _check_for_test_updates;
1185 /** maximum allowed J2K bandwidth in bits per second */
1186 int _maximum_j2k_bandwidth;
1188 bool _analyse_ebur128;
1189 bool _automatic_audio_analysis;
1190 #ifdef DCPOMATIC_WINDOWS
1191 bool _win32_console;
1193 std::vector<boost::filesystem::path> _history;
1194 std::vector<boost::filesystem::path> _player_history;
1195 boost::shared_ptr<DKDMGroup> _dkdms;
1196 boost::filesystem::path _cinemas_file;
1197 bool _show_hints_before_make_dcp;
1198 bool _confirm_kdm_email;
1199 dcp::NameFormat _kdm_filename_format;
1200 dcp::NameFormat _kdm_container_name_format;
1201 dcp::NameFormat _dcp_metadata_filename_format;
1202 dcp::NameFormat _dcp_asset_filename_format;
1203 bool _jump_to_selected;
1204 bool _nagged[NAG_COUNT];
1206 /** name of a specific sound output stream to use, or empty to use the default */
1207 boost::optional<std::string> _sound_output;
1208 std::string _cover_sheet;
1209 boost::optional<boost::filesystem::path> _last_player_load_directory;
1210 boost::optional<KDMWriteType> _last_kdm_write_type;
1211 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1212 int _frames_in_memory_multiplier;
1213 boost::optional<int> _decode_reduction;
1214 bool _default_notify;
1215 bool _notification[NOTIFICATION_COUNT];
1216 boost::optional<std::string> _barco_username;
1217 boost::optional<std::string> _barco_password;
1218 boost::optional<std::string> _christie_username;
1219 boost::optional<std::string> _christie_password;
1220 boost::optional<std::string> _gdc_username;
1221 boost::optional<std::string> _gdc_password;
1222 Interface _interface_complexity;
1223 PlayerMode _player_mode;
1225 bool _respect_kdm_validity_periods;
1226 boost::optional<boost::filesystem::path> _player_log_file;
1227 /** A directory containing DCPs whose contents are presented to the user
1228 in the dual-screen player mode. DCPs on the list can be loaded
1231 boost::optional<boost::filesystem::path> _player_content_directory;
1232 boost::optional<boost::filesystem::path> _player_playlist_directory;
1233 boost::optional<boost::filesystem::path> _player_kdm_directory;
1234 #ifdef DCPOMATIC_VARIANT_SWAROOP
1235 boost::optional<boost::filesystem::path> _player_background_image;
1236 std::string _kdm_server_url;
1237 std::string _player_watermark_theatre;
1238 /** watermark period in minutes */
1239 int _player_watermark_period;
1240 /** watermark duration in milliseconds */
1241 int _player_watermark_duration;
1242 std::vector<Monitor> _required_monitors;
1243 /** a file which, if specified, must be present for the player to work */
1244 boost::optional<boost::filesystem::path> _player_lock_file;
1247 static int const _current_version;
1249 /** Singleton instance, or 0 */
1250 static Config* _instance;