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;
533 bool allow_spl_editing () const {
534 return _allow_spl_editing;
539 void set_master_encoding_threads (int n) {
540 maybe_set (_master_encoding_threads, n);
543 void set_server_encoding_threads (int n) {
544 maybe_set (_server_encoding_threads, n);
547 void set_default_directory (boost::filesystem::path d) {
548 if (_default_directory && *_default_directory == d) {
551 _default_directory = d;
555 /** @param p New server port */
556 void set_server_port_base (int p) {
557 maybe_set (_server_port_base, p);
560 void set_only_servers_encode (bool o) {
561 maybe_set (_only_servers_encode, o);
564 void set_tms_protocol (Protocol p) {
565 maybe_set (_tms_protocol, p);
568 /** @param i IP address of a TMS that we can copy DCPs to */
569 void set_tms_ip (std::string i) {
570 maybe_set (_tms_ip, i);
573 /** @param p Path on a TMS that we should changed DCPs to */
574 void set_tms_path (std::string p) {
575 maybe_set (_tms_path, p);
578 /** @param u User name to log into the TMS with */
579 void set_tms_user (std::string u) {
580 maybe_set (_tms_user, u);
583 /** @param p Password to log into the TMS with */
584 void set_tms_password (std::string p) {
585 maybe_set (_tms_password, p);
588 void add_cinema (boost::shared_ptr<Cinema> c) {
589 _cinemas.push_back (c);
593 void remove_cinema (boost::shared_ptr<Cinema> c) {
598 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
599 maybe_set (_allowed_dcp_frame_rates, r);
602 void set_allow_any_dcp_frame_rate (bool a) {
603 maybe_set (_allow_any_dcp_frame_rate, a);
606 void set_allow_any_container (bool a) {
607 maybe_set (_allow_any_container, a);
610 void set_default_isdcf_metadata (ISDCFMetadata d) {
611 maybe_set (_default_isdcf_metadata, d);
614 void set_language (std::string l) {
615 if (_language && _language.get() == l) {
622 void unset_language () {
627 _language = boost::none;
631 void set_default_still_length (int s) {
632 maybe_set (_default_still_length, s);
635 void set_default_container (Ratio const * c) {
636 maybe_set (_default_container, c);
639 void set_default_scale_to (Ratio const * c) {
640 maybe_set (_default_scale_to, c);
643 void set_default_dcp_content_type (DCPContentType const * t) {
644 maybe_set (_default_dcp_content_type, t);
647 void set_default_dcp_audio_channels (int c) {
648 maybe_set (_default_dcp_audio_channels, c);
651 void set_dcp_issuer (std::string i) {
652 maybe_set (_dcp_issuer, i);
655 void set_dcp_creator (std::string c) {
656 maybe_set (_dcp_creator, c);
659 void set_default_j2k_bandwidth (int b) {
660 maybe_set (_default_j2k_bandwidth, b);
663 void set_default_audio_delay (int d) {
664 maybe_set (_default_audio_delay, d);
667 void set_default_interop (bool i) {
668 maybe_set (_default_interop, i);
671 void set_default_upload_after_make_dcp (bool u) {
672 maybe_set (_default_upload_after_make_dcp, u);
675 void set_mail_server (std::string s) {
676 maybe_set (_mail_server, s);
679 void set_mail_port (int p) {
680 maybe_set (_mail_port, p);
683 void set_mail_user (std::string u) {
684 maybe_set (_mail_user, u);
687 void set_mail_password (std::string p) {
688 maybe_set (_mail_password, p);
691 void set_kdm_subject (std::string s) {
692 maybe_set (_kdm_subject, s);
695 void set_kdm_from (std::string f) {
696 maybe_set (_kdm_from, f);
699 void set_kdm_cc (std::vector<std::string> f) {
700 maybe_set (_kdm_cc, f);
703 void set_kdm_bcc (std::string f) {
704 maybe_set (_kdm_bcc, f);
707 void set_kdm_email (std::string e) {
708 maybe_set (_kdm_email, e);
711 void reset_kdm_email ();
713 void set_notification_subject (std::string s) {
714 maybe_set (_notification_subject, s);
717 void set_notification_from (std::string f) {
718 maybe_set (_notification_from, f);
721 void set_notification_to (std::string t) {
722 maybe_set (_notification_to, t);
725 void set_notification_cc (std::vector<std::string> f) {
726 maybe_set (_notification_cc, f);
729 void set_notification_bcc (std::string f) {
730 maybe_set (_notification_bcc, f);
733 void set_notification_email (std::string e) {
734 maybe_set (_notification_email, e);
737 void reset_notification_email ();
739 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
740 maybe_set (_signer_chain, s);
743 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
744 maybe_set (_decryption_chain, c);
747 void set_check_for_updates (bool c) {
748 maybe_set (_check_for_updates, c);
750 set_check_for_test_updates (false);
754 void set_check_for_test_updates (bool c) {
755 maybe_set (_check_for_test_updates, c);
758 void set_maximum_j2k_bandwidth (int b) {
759 maybe_set (_maximum_j2k_bandwidth, b);
762 void set_log_types (int t) {
763 maybe_set (_log_types, t);
766 void set_analyse_ebur128 (bool a) {
767 maybe_set (_analyse_ebur128, a);
770 void set_automatic_audio_analysis (bool a) {
771 maybe_set (_automatic_audio_analysis, a);
774 #ifdef DCPOMATIC_WINDOWS
775 void set_win32_console (bool c) {
776 maybe_set (_win32_console, c);
780 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
785 void set_cinemas_file (boost::filesystem::path file);
787 void set_show_hints_before_make_dcp (bool s) {
788 maybe_set (_show_hints_before_make_dcp, s);
791 void set_confirm_kdm_email (bool s) {
792 maybe_set (_confirm_kdm_email, s);
795 void set_sound (bool s) {
796 maybe_set (_sound, s, SOUND);
799 void set_sound_output (std::string o) {
800 maybe_set (_sound_output, o, SOUND_OUTPUT);
803 void set_last_player_load_directory (boost::filesystem::path d) {
804 maybe_set (_last_player_load_directory, d);
807 void set_last_kdm_write_type (KDMWriteType t) {
808 maybe_set (_last_kdm_write_type, t);
811 void set_last_dkdm_write_type (DKDMWriteType t) {
812 maybe_set (_last_dkdm_write_type, t);
815 void unset_sound_output () {
816 if (!_sound_output) {
820 _sound_output = boost::none;
824 void set_kdm_container_name_format (dcp::NameFormat n) {
825 maybe_set (_kdm_container_name_format, n);
828 void set_kdm_filename_format (dcp::NameFormat n) {
829 maybe_set (_kdm_filename_format, n);
832 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
833 maybe_set (_dcp_metadata_filename_format, n);
836 void set_dcp_asset_filename_format (dcp::NameFormat n) {
837 maybe_set (_dcp_asset_filename_format, n);
840 void set_frames_in_memory_multiplier (int m) {
841 maybe_set (_frames_in_memory_multiplier, m);
844 void set_decode_reduction (boost::optional<int> r) {
845 maybe_set (_decode_reduction, r);
848 void set_default_notify (bool n) {
849 maybe_set (_default_notify, n);
852 void clear_history () {
857 void clear_player_history () {
858 _player_history.clear ();
862 void add_to_history (boost::filesystem::path p);
863 void add_to_player_history (boost::filesystem::path p);
865 void set_jump_to_selected (bool j) {
866 maybe_set (_jump_to_selected, j);
869 void set_nagged (Nag nag, bool nagged) {
870 maybe_set (_nagged[nag], nagged);
873 void set_cover_sheet (std::string s) {
874 maybe_set (_cover_sheet, s);
877 void reset_cover_sheet ();
879 void set_notification (Notification n, bool v) {
880 maybe_set (_notification[n], v);
883 void set_barco_username (std::string u) {
884 maybe_set (_barco_username, u);
887 void unset_barco_username () {
888 maybe_set (_barco_username, boost::optional<std::string>());
891 void set_barco_password (std::string p) {
892 maybe_set (_barco_password, p);
895 void unset_barco_password () {
896 maybe_set (_barco_password, boost::optional<std::string>());
899 void set_christie_username (std::string u) {
900 maybe_set (_christie_username, u);
903 void unset_christie_username () {
904 maybe_set (_christie_username, boost::optional<std::string>());
907 void set_christie_password (std::string p) {
908 maybe_set (_christie_password, p);
911 void unset_christie_password () {
912 maybe_set (_christie_password, boost::optional<std::string>());
915 void set_gdc_username (std::string u) {
916 maybe_set (_gdc_username, u);
919 void unset_gdc_username () {
920 maybe_set (_gdc_username, boost::optional<std::string>());
923 void set_gdc_password (std::string p) {
924 maybe_set (_gdc_password, p);
927 void unset_gdc_password () {
928 maybe_set (_gdc_password, boost::optional<std::string>());
931 void set_interface_complexity (Interface i) {
932 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
935 void set_player_mode (PlayerMode m) {
936 maybe_set (_player_mode, m);
939 void set_image_display (int n) {
940 maybe_set (_image_display, n);
943 void set_respect_kdm_validity_periods (bool r) {
944 maybe_set (_respect_kdm_validity_periods, r);
947 void set_player_log_file (boost::filesystem::path p) {
948 maybe_set (_player_log_file, p);
951 void unset_player_log_file () {
952 if (!_player_log_file) {
955 _player_log_file = boost::none;
959 void set_player_content_directory (boost::filesystem::path p) {
960 maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
963 void unset_player_content_directory () {
964 if (!_player_content_directory) {
967 _player_content_directory = boost::none;
968 changed (PLAYER_CONTENT_DIRECTORY);
971 void set_player_playlist_directory (boost::filesystem::path p) {
972 maybe_set (_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
975 void unset_player_playlist_directory () {
976 if (!_player_playlist_directory) {
979 _player_playlist_directory = boost::none;
980 changed (PLAYER_PLAYLIST_DIRECTORY);
983 void set_player_kdm_directory (boost::filesystem::path p) {
984 maybe_set (_player_kdm_directory, p);
987 void unset_player_kdm_directory () {
988 if (!_player_kdm_directory) {
991 _player_kdm_directory = boost::none;
995 #ifdef DCPOMATIC_VARIANT_SWAROOP
996 void set_player_background_image (boost::filesystem::path p) {
997 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
1000 void unset_player_background_image () {
1001 if (!_player_background_image) {
1004 _player_background_image = boost::none;
1005 changed (PLAYER_BACKGROUND_IMAGE);
1008 void set_kdm_server_url (std::string s) {
1009 maybe_set (_kdm_server_url, s);
1012 void set_player_watermark_theatre (std::string p) {
1013 maybe_set (_player_watermark_theatre, p);
1016 void set_player_watermark_period (int minutes) {
1017 maybe_set (_player_watermark_period, minutes);
1020 void set_player_watermark_duration (int milliseconds) {
1021 maybe_set (_player_watermark_duration, milliseconds);
1024 void set_required_monitors (std::vector<Monitor> monitors) {
1025 maybe_set (_required_monitors, monitors);
1028 void set_player_lock_file (boost::filesystem::path p) {
1029 maybe_set (_player_lock_file, p);
1032 void unset_player_lock_file () {
1033 if (!_player_lock_file) {
1036 _player_lock_file = boost::none;
1041 void set_allow_spl_editing (bool s) {
1042 maybe_set (_allow_spl_editing, s);
1045 void changed (Property p = OTHER);
1046 boost::signals2::signal<void (Property)> Changed;
1047 /** Emitted if read() failed on an existing Config file. There is nothing
1048 a listener can do about it: this is just for information.
1050 static boost::signals2::signal<void ()> FailedToLoad;
1051 /** Emitted if read() issued a warning which the user might want to know about */
1052 static boost::signals2::signal<void (std::string)> Warning;
1053 /** Emitted if there is a bad certificate in the signer chain. Handler can call
1054 * true to ask Config to re-create the chain.
1056 static boost::signals2::signal<bool (void)> BadSignerChain;
1058 void write () const;
1059 void write_config () const;
1060 void write_cinemas () const;
1061 void link (boost::filesystem::path new_file) const;
1062 void copy_and_link (boost::filesystem::path new_file) const;
1063 bool have_write_permission () const;
1065 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1066 bool existing_template (std::string name) const;
1067 std::list<std::string> templates () const;
1068 boost::filesystem::path template_path (std::string name) const;
1069 void rename_template (std::string old_name, std::string new_name) const;
1070 void delete_template (std::string name) const;
1072 static Config* instance ();
1073 static void drop ();
1074 static void restore_defaults ();
1075 static bool have_existing (std::string);
1076 static boost::filesystem::path config_file ();
1077 static boost::filesystem::path path (std::string file, bool create_directories = true);
1079 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1080 static boost::optional<boost::filesystem::path> override_path;
1085 void set_defaults ();
1086 void set_kdm_email_to_default ();
1087 void set_notification_email_to_default ();
1088 void set_cover_sheet_to_default ();
1089 void read_cinemas (cxml::Document const & f);
1090 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1091 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1092 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1096 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1097 if (member == new_value) {
1105 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1106 if (member && member.get() == new_value) {
1113 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1114 int _master_encoding_threads;
1115 /** number of threads which a server should use for J2K encoding on the local machine */
1116 int _server_encoding_threads;
1117 /** default directory to put new films in */
1118 boost::optional<boost::filesystem::path> _default_directory;
1119 /** base port number to use for J2K encoding servers;
1120 * this port and the two above it will be used.
1122 int _server_port_base;
1123 /** true to broadcast on the `any' address to look for servers */
1124 bool _use_any_servers;
1125 /** J2K encoding servers that should definitely be used */
1126 std::vector<std::string> _servers;
1127 bool _only_servers_encode;
1128 Protocol _tms_protocol;
1129 /** The IP address of a TMS that we can copy DCPs to */
1130 std::string _tms_ip;
1131 /** The path on a TMS that we should write DCPs to */
1132 std::string _tms_path;
1133 /** User name to log into the TMS with */
1134 std::string _tms_user;
1135 /** Password to log into the TMS with */
1136 std::string _tms_password;
1137 /** Our cinema sound processor */
1138 CinemaSoundProcessor const * _cinema_sound_processor;
1139 std::list<int> _allowed_dcp_frame_rates;
1140 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1141 bool _allow_any_dcp_frame_rate;
1142 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1143 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1144 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1146 bool _allow_any_container;
1147 /** Default ISDCF metadata for newly-created Films */
1148 ISDCFMetadata _default_isdcf_metadata;
1149 boost::optional<std::string> _language;
1150 /** Default length of still image content (seconds) */
1151 int _default_still_length;
1152 Ratio const * _default_container;
1153 Ratio const * _default_scale_to;
1154 DCPContentType const * _default_dcp_content_type;
1155 int _default_dcp_audio_channels;
1156 std::string _dcp_issuer;
1157 std::string _dcp_creator;
1158 int _default_j2k_bandwidth;
1159 int _default_audio_delay;
1160 bool _default_interop;
1161 /** Default directory to offer to write KDMs to; if it's not set,
1162 the home directory will be offered.
1164 boost::optional<boost::filesystem::path> _default_kdm_directory;
1165 bool _default_upload_after_make_dcp;
1166 std::list<boost::shared_ptr<Cinema> > _cinemas;
1167 std::string _mail_server;
1169 std::string _mail_user;
1170 std::string _mail_password;
1171 std::string _kdm_subject;
1172 std::string _kdm_from;
1173 std::vector<std::string> _kdm_cc;
1174 std::string _kdm_bcc;
1175 std::string _kdm_email;
1176 std::string _notification_subject;
1177 std::string _notification_from;
1178 std::string _notification_to;
1179 std::vector<std::string> _notification_cc;
1180 std::string _notification_bcc;
1181 std::string _notification_email;
1182 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1183 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1184 * certificate for making KDMs given to DCP-o-matic.
1186 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1187 /** true to check for updates on startup */
1188 bool _check_for_updates;
1189 bool _check_for_test_updates;
1190 /** maximum allowed J2K bandwidth in bits per second */
1191 int _maximum_j2k_bandwidth;
1193 bool _analyse_ebur128;
1194 bool _automatic_audio_analysis;
1195 #ifdef DCPOMATIC_WINDOWS
1196 bool _win32_console;
1198 std::vector<boost::filesystem::path> _history;
1199 std::vector<boost::filesystem::path> _player_history;
1200 boost::shared_ptr<DKDMGroup> _dkdms;
1201 boost::filesystem::path _cinemas_file;
1202 bool _show_hints_before_make_dcp;
1203 bool _confirm_kdm_email;
1204 dcp::NameFormat _kdm_filename_format;
1205 dcp::NameFormat _kdm_container_name_format;
1206 dcp::NameFormat _dcp_metadata_filename_format;
1207 dcp::NameFormat _dcp_asset_filename_format;
1208 bool _jump_to_selected;
1209 bool _nagged[NAG_COUNT];
1211 /** name of a specific sound output stream to use, or empty to use the default */
1212 boost::optional<std::string> _sound_output;
1213 std::string _cover_sheet;
1214 boost::optional<boost::filesystem::path> _last_player_load_directory;
1215 boost::optional<KDMWriteType> _last_kdm_write_type;
1216 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1217 int _frames_in_memory_multiplier;
1218 boost::optional<int> _decode_reduction;
1219 bool _default_notify;
1220 bool _notification[NOTIFICATION_COUNT];
1221 boost::optional<std::string> _barco_username;
1222 boost::optional<std::string> _barco_password;
1223 boost::optional<std::string> _christie_username;
1224 boost::optional<std::string> _christie_password;
1225 boost::optional<std::string> _gdc_username;
1226 boost::optional<std::string> _gdc_password;
1227 Interface _interface_complexity;
1228 PlayerMode _player_mode;
1230 bool _respect_kdm_validity_periods;
1231 boost::optional<boost::filesystem::path> _player_log_file;
1232 /** A directory containing DCPs whose contents are presented to the user
1233 in the dual-screen player mode. DCPs on the list can be loaded
1236 boost::optional<boost::filesystem::path> _player_content_directory;
1237 boost::optional<boost::filesystem::path> _player_playlist_directory;
1238 boost::optional<boost::filesystem::path> _player_kdm_directory;
1239 #ifdef DCPOMATIC_VARIANT_SWAROOP
1240 boost::optional<boost::filesystem::path> _player_background_image;
1241 std::string _kdm_server_url;
1242 std::string _player_watermark_theatre;
1243 /** watermark period in minutes */
1244 int _player_watermark_period;
1245 /** watermark duration in milliseconds */
1246 int _player_watermark_duration;
1247 std::vector<Monitor> _required_monitors;
1248 /** a file which, if specified, must be present for the player to work */
1249 boost::optional<boost::filesystem::path> _player_lock_file;
1251 bool _allow_spl_editing;
1253 static int const _current_version;
1255 /** Singleton instance, or 0 */
1256 static Config* _instance;