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,
84 #ifdef DCPOMATIC_VARIANT_SWAROOP
85 PLAYER_BACKGROUND_IMAGE,
90 /** @return base port number to use for J2K encoding servers */
91 int server_port_base () const {
92 return _server_port_base;
95 void set_use_any_servers (bool u) {
97 changed (USE_ANY_SERVERS);
100 bool use_any_servers () const {
101 return _use_any_servers;
104 /** @param s New list of servers */
105 void set_servers (std::vector<std::string> s) {
110 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
111 std::vector<std::string> servers () const {
115 bool only_servers_encode () const {
116 return _only_servers_encode;
119 Protocol tms_protocol () const {
120 return _tms_protocol;
123 /** @return The IP address of a TMS that we can copy DCPs to */
124 std::string tms_ip () const {
128 /** @return The path on a TMS that we should changed DCPs to */
129 std::string tms_path () const {
133 /** @return User name to log into the TMS with */
134 std::string tms_user () const {
138 /** @return Password to log into the TMS with */
139 std::string tms_password () const {
140 return _tms_password;
143 /** @return The cinema sound processor that we are using */
144 CinemaSoundProcessor const * cinema_sound_processor () const {
145 return _cinema_sound_processor;
148 std::list<boost::shared_ptr<Cinema> > cinemas () const {
152 std::list<int> allowed_dcp_frame_rates () const {
153 return _allowed_dcp_frame_rates;
156 bool allow_any_dcp_frame_rate () const {
157 return _allow_any_dcp_frame_rate;
160 bool allow_any_container () const {
161 return _allow_any_container;
164 ISDCFMetadata default_isdcf_metadata () const {
165 return _default_isdcf_metadata;
168 boost::optional<std::string> language () const {
172 int default_still_length () const {
173 return _default_still_length;
176 Ratio const * default_container () const {
177 return _default_container;
180 Ratio const * default_scale_to () const {
181 return _default_scale_to;
184 DCPContentType const * default_dcp_content_type () const {
185 return _default_dcp_content_type;
188 int default_dcp_audio_channels () const {
189 return _default_dcp_audio_channels;
192 std::string dcp_issuer () const {
196 std::string dcp_creator () const {
200 int default_j2k_bandwidth () const {
201 return _default_j2k_bandwidth;
204 int default_audio_delay () const {
205 return _default_audio_delay;
208 bool default_interop () const {
209 return _default_interop;
212 bool default_upload_after_make_dcp () {
213 return _default_upload_after_make_dcp;
216 void set_default_kdm_directory (boost::filesystem::path d) {
217 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
220 _default_kdm_directory = d;
224 std::string mail_server () const {
228 int mail_port () const {
232 std::string mail_user () const {
236 std::string mail_password () const {
237 return _mail_password;
240 std::string kdm_subject () const {
244 std::string kdm_from () const {
248 std::vector<std::string> kdm_cc () const {
252 std::string kdm_bcc () const {
256 std::string kdm_email () const {
260 std::string notification_subject () const {
261 return _notification_subject;
264 std::string notification_from () const {
265 return _notification_from;
268 std::string notification_to () const {
269 return _notification_to;
272 std::vector<std::string> notification_cc () const {
273 return _notification_cc;
276 std::string notification_bcc () const {
277 return _notification_bcc;
280 std::string notification_email () const {
281 return _notification_email;
284 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
285 return _signer_chain;
288 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
289 return _decryption_chain;
292 bool check_for_updates () const {
293 return _check_for_updates;
296 bool check_for_test_updates () const {
297 return _check_for_test_updates;
300 int maximum_j2k_bandwidth () const {
301 return _maximum_j2k_bandwidth;
304 int log_types () const {
308 bool analyse_ebur128 () const {
309 return _analyse_ebur128;
312 bool automatic_audio_analysis () const {
313 return _automatic_audio_analysis;
316 #ifdef DCPOMATIC_WINDOWS
317 bool win32_console () const {
318 return _win32_console;
322 std::vector<boost::filesystem::path> history () const {
326 std::vector<boost::filesystem::path> player_history () const {
327 return _player_history;
330 boost::shared_ptr<DKDMGroup> dkdms () const {
334 boost::filesystem::path cinemas_file () const {
335 return _cinemas_file;
338 bool show_hints_before_make_dcp () const {
339 return _show_hints_before_make_dcp;
342 bool confirm_kdm_email () const {
343 return _confirm_kdm_email;
346 dcp::NameFormat kdm_container_name_format () const {
347 return _kdm_container_name_format;
350 dcp::NameFormat kdm_filename_format () const {
351 return _kdm_filename_format;
354 dcp::NameFormat dcp_metadata_filename_format () const {
355 return _dcp_metadata_filename_format;
358 dcp::NameFormat dcp_asset_filename_format () const {
359 return _dcp_asset_filename_format;
362 bool jump_to_selected () const {
363 return _jump_to_selected;
368 NAG_ENCRYPTED_METADATA,
369 NAG_REMAKE_DECRYPTION_CHAIN,
370 NAG_BAD_SIGNER_CHAIN,
371 /* Not really a nag but it's the same idea */
373 NAG_IMPORT_DECRYPTION_CHAIN,
377 bool nagged (Nag nag) const {
381 bool sound () const {
385 std::string cover_sheet () const {
389 boost::optional<std::string> sound_output () const {
390 return _sound_output;
393 boost::optional<boost::filesystem::path> last_player_load_directory () const {
394 return _last_player_load_directory;
403 boost::optional<KDMWriteType> last_kdm_write_type () const {
404 return _last_kdm_write_type;
412 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
413 return _last_dkdm_write_type;
416 int frames_in_memory_multiplier () const {
417 return _frames_in_memory_multiplier;
420 boost::optional<int> decode_reduction () const {
421 return _decode_reduction;
424 bool default_notify () const {
425 return _default_notify;
434 bool notification (Notification n) const {
435 return _notification[n];
438 boost::optional<std::string> barco_username () const {
439 return _barco_username;
442 boost::optional<std::string> barco_password () const {
443 return _barco_password;
446 boost::optional<std::string> christie_username () const {
447 return _christie_username;
450 boost::optional<std::string> christie_password () const {
451 return _christie_password;
454 boost::optional<std::string> gdc_username () const {
455 return _gdc_username;
458 boost::optional<std::string> gdc_password () const {
459 return _gdc_password;
467 Interface interface_complexity () const {
468 return _interface_complexity;
477 PlayerMode player_mode () const {
481 int image_display () const {
482 return _image_display;
485 bool respect_kdm_validity_periods () const {
486 return _respect_kdm_validity_periods;
489 boost::optional<boost::filesystem::path> player_activity_log_file () const {
490 return _player_activity_log_file;
493 boost::optional<boost::filesystem::path> player_debug_log_file () const {
494 return _player_debug_log_file;
497 boost::optional<boost::filesystem::path> player_content_directory () const {
498 return _player_content_directory;
501 boost::optional<boost::filesystem::path> player_playlist_directory () const {
502 return _player_playlist_directory;
505 boost::optional<boost::filesystem::path> player_kdm_directory () const {
506 return _player_kdm_directory;
509 #ifdef DCPOMATIC_VARIANT_SWAROOP
510 boost::optional<boost::filesystem::path> player_background_image () const {
511 return _player_background_image;
514 std::string kdm_server_url () const {
515 return _kdm_server_url;
518 std::string player_watermark_theatre () const {
519 return _player_watermark_theatre;
522 int player_watermark_period () const {
523 return _player_watermark_period;
526 int player_watermark_duration () const {
527 return _player_watermark_duration;
530 std::vector<Monitor> required_monitors () const {
531 return _required_monitors;
534 boost::optional<boost::filesystem::path> player_lock_file () const {
535 return _player_lock_file;
541 void set_master_encoding_threads (int n) {
542 maybe_set (_master_encoding_threads, n);
545 void set_server_encoding_threads (int n) {
546 maybe_set (_server_encoding_threads, n);
549 void set_default_directory (boost::filesystem::path d) {
550 if (_default_directory && *_default_directory == d) {
553 _default_directory = d;
557 /** @param p New server port */
558 void set_server_port_base (int p) {
559 maybe_set (_server_port_base, p);
562 void set_only_servers_encode (bool o) {
563 maybe_set (_only_servers_encode, o);
566 void set_tms_protocol (Protocol p) {
567 maybe_set (_tms_protocol, p);
570 /** @param i IP address of a TMS that we can copy DCPs to */
571 void set_tms_ip (std::string i) {
572 maybe_set (_tms_ip, i);
575 /** @param p Path on a TMS that we should changed DCPs to */
576 void set_tms_path (std::string p) {
577 maybe_set (_tms_path, p);
580 /** @param u User name to log into the TMS with */
581 void set_tms_user (std::string u) {
582 maybe_set (_tms_user, u);
585 /** @param p Password to log into the TMS with */
586 void set_tms_password (std::string p) {
587 maybe_set (_tms_password, p);
590 void add_cinema (boost::shared_ptr<Cinema> c) {
591 _cinemas.push_back (c);
595 void remove_cinema (boost::shared_ptr<Cinema> c) {
600 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
601 maybe_set (_allowed_dcp_frame_rates, r);
604 void set_allow_any_dcp_frame_rate (bool a) {
605 maybe_set (_allow_any_dcp_frame_rate, a);
608 void set_allow_any_container (bool a) {
609 maybe_set (_allow_any_container, a);
612 void set_default_isdcf_metadata (ISDCFMetadata d) {
613 maybe_set (_default_isdcf_metadata, d);
616 void set_language (std::string l) {
617 if (_language && _language.get() == l) {
624 void unset_language () {
629 _language = boost::none;
633 void set_default_still_length (int s) {
634 maybe_set (_default_still_length, s);
637 void set_default_container (Ratio const * c) {
638 maybe_set (_default_container, c);
641 void set_default_scale_to (Ratio const * c) {
642 maybe_set (_default_scale_to, c);
645 void set_default_dcp_content_type (DCPContentType const * t) {
646 maybe_set (_default_dcp_content_type, t);
649 void set_default_dcp_audio_channels (int c) {
650 maybe_set (_default_dcp_audio_channels, c);
653 void set_dcp_issuer (std::string i) {
654 maybe_set (_dcp_issuer, i);
657 void set_dcp_creator (std::string c) {
658 maybe_set (_dcp_creator, c);
661 void set_default_j2k_bandwidth (int b) {
662 maybe_set (_default_j2k_bandwidth, b);
665 void set_default_audio_delay (int d) {
666 maybe_set (_default_audio_delay, d);
669 void set_default_interop (bool i) {
670 maybe_set (_default_interop, i);
673 void set_default_upload_after_make_dcp (bool u) {
674 maybe_set (_default_upload_after_make_dcp, u);
677 void set_mail_server (std::string s) {
678 maybe_set (_mail_server, s);
681 void set_mail_port (int p) {
682 maybe_set (_mail_port, p);
685 void set_mail_user (std::string u) {
686 maybe_set (_mail_user, u);
689 void set_mail_password (std::string p) {
690 maybe_set (_mail_password, p);
693 void set_kdm_subject (std::string s) {
694 maybe_set (_kdm_subject, s);
697 void set_kdm_from (std::string f) {
698 maybe_set (_kdm_from, f);
701 void set_kdm_cc (std::vector<std::string> f) {
702 maybe_set (_kdm_cc, f);
705 void set_kdm_bcc (std::string f) {
706 maybe_set (_kdm_bcc, f);
709 void set_kdm_email (std::string e) {
710 maybe_set (_kdm_email, e);
713 void reset_kdm_email ();
715 void set_notification_subject (std::string s) {
716 maybe_set (_notification_subject, s);
719 void set_notification_from (std::string f) {
720 maybe_set (_notification_from, f);
723 void set_notification_to (std::string t) {
724 maybe_set (_notification_to, t);
727 void set_notification_cc (std::vector<std::string> f) {
728 maybe_set (_notification_cc, f);
731 void set_notification_bcc (std::string f) {
732 maybe_set (_notification_bcc, f);
735 void set_notification_email (std::string e) {
736 maybe_set (_notification_email, e);
739 void reset_notification_email ();
741 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
742 maybe_set (_signer_chain, s);
745 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
746 maybe_set (_decryption_chain, c);
749 void set_check_for_updates (bool c) {
750 maybe_set (_check_for_updates, c);
752 set_check_for_test_updates (false);
756 void set_check_for_test_updates (bool c) {
757 maybe_set (_check_for_test_updates, c);
760 void set_maximum_j2k_bandwidth (int b) {
761 maybe_set (_maximum_j2k_bandwidth, b);
764 void set_log_types (int t) {
765 maybe_set (_log_types, t);
768 void set_analyse_ebur128 (bool a) {
769 maybe_set (_analyse_ebur128, a);
772 void set_automatic_audio_analysis (bool a) {
773 maybe_set (_automatic_audio_analysis, a);
776 #ifdef DCPOMATIC_WINDOWS
777 void set_win32_console (bool c) {
778 maybe_set (_win32_console, c);
782 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
787 void set_cinemas_file (boost::filesystem::path file);
789 void set_show_hints_before_make_dcp (bool s) {
790 maybe_set (_show_hints_before_make_dcp, s);
793 void set_confirm_kdm_email (bool s) {
794 maybe_set (_confirm_kdm_email, s);
797 void set_sound (bool s) {
798 maybe_set (_sound, s, SOUND);
801 void set_sound_output (std::string o) {
802 maybe_set (_sound_output, o, SOUND_OUTPUT);
805 void set_last_player_load_directory (boost::filesystem::path d) {
806 maybe_set (_last_player_load_directory, d);
809 void set_last_kdm_write_type (KDMWriteType t) {
810 maybe_set (_last_kdm_write_type, t);
813 void set_last_dkdm_write_type (DKDMWriteType t) {
814 maybe_set (_last_dkdm_write_type, t);
817 void unset_sound_output () {
818 if (!_sound_output) {
822 _sound_output = boost::none;
826 void set_kdm_container_name_format (dcp::NameFormat n) {
827 maybe_set (_kdm_container_name_format, n);
830 void set_kdm_filename_format (dcp::NameFormat n) {
831 maybe_set (_kdm_filename_format, n);
834 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
835 maybe_set (_dcp_metadata_filename_format, n);
838 void set_dcp_asset_filename_format (dcp::NameFormat n) {
839 maybe_set (_dcp_asset_filename_format, n);
842 void set_frames_in_memory_multiplier (int m) {
843 maybe_set (_frames_in_memory_multiplier, m);
846 void set_decode_reduction (boost::optional<int> r) {
847 maybe_set (_decode_reduction, r);
850 void set_default_notify (bool n) {
851 maybe_set (_default_notify, n);
854 void clear_history () {
859 void clear_player_history () {
860 _player_history.clear ();
864 void add_to_history (boost::filesystem::path p);
865 void clean_history ();
866 void add_to_player_history (boost::filesystem::path p);
867 void clean_player_history ();
869 void set_jump_to_selected (bool j) {
870 maybe_set (_jump_to_selected, j);
873 void set_nagged (Nag nag, bool nagged) {
874 maybe_set (_nagged[nag], nagged);
877 void set_cover_sheet (std::string s) {
878 maybe_set (_cover_sheet, s);
881 void reset_cover_sheet ();
883 void set_notification (Notification n, bool v) {
884 maybe_set (_notification[n], v);
887 void set_barco_username (std::string u) {
888 maybe_set (_barco_username, u);
891 void unset_barco_username () {
892 maybe_set (_barco_username, boost::optional<std::string>());
895 void set_barco_password (std::string p) {
896 maybe_set (_barco_password, p);
899 void unset_barco_password () {
900 maybe_set (_barco_password, boost::optional<std::string>());
903 void set_christie_username (std::string u) {
904 maybe_set (_christie_username, u);
907 void unset_christie_username () {
908 maybe_set (_christie_username, boost::optional<std::string>());
911 void set_christie_password (std::string p) {
912 maybe_set (_christie_password, p);
915 void unset_christie_password () {
916 maybe_set (_christie_password, boost::optional<std::string>());
919 void set_gdc_username (std::string u) {
920 maybe_set (_gdc_username, u);
923 void unset_gdc_username () {
924 maybe_set (_gdc_username, boost::optional<std::string>());
927 void set_gdc_password (std::string p) {
928 maybe_set (_gdc_password, p);
931 void unset_gdc_password () {
932 maybe_set (_gdc_password, boost::optional<std::string>());
935 void set_interface_complexity (Interface i) {
936 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
939 void set_player_mode (PlayerMode m) {
940 maybe_set (_player_mode, m);
943 void set_image_display (int n) {
944 maybe_set (_image_display, n);
947 void set_respect_kdm_validity_periods (bool r) {
948 maybe_set (_respect_kdm_validity_periods, r);
951 void set_player_activity_log_file (boost::filesystem::path p) {
952 maybe_set (_player_activity_log_file, p);
955 void unset_player_activity_log_file () {
956 if (!_player_activity_log_file) {
959 _player_activity_log_file = boost::none;
963 void set_player_debug_log_file (boost::filesystem::path p) {
964 maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
967 void unset_player_debug_log_file () {
968 if (!_player_debug_log_file) {
971 _player_debug_log_file = boost::none;
972 changed (PLAYER_DEBUG_LOG);
975 void set_player_content_directory (boost::filesystem::path p) {
976 maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
979 void unset_player_content_directory () {
980 if (!_player_content_directory) {
983 _player_content_directory = boost::none;
984 changed (PLAYER_CONTENT_DIRECTORY);
987 void set_player_playlist_directory (boost::filesystem::path p) {
988 maybe_set (_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
991 void unset_player_playlist_directory () {
992 if (!_player_playlist_directory) {
995 _player_playlist_directory = boost::none;
996 changed (PLAYER_PLAYLIST_DIRECTORY);
999 void set_player_kdm_directory (boost::filesystem::path p) {
1000 maybe_set (_player_kdm_directory, p);
1003 void unset_player_kdm_directory () {
1004 if (!_player_kdm_directory) {
1007 _player_kdm_directory = boost::none;
1011 #ifdef DCPOMATIC_VARIANT_SWAROOP
1012 void set_player_background_image (boost::filesystem::path p) {
1013 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
1016 void unset_player_background_image () {
1017 if (!_player_background_image) {
1020 _player_background_image = boost::none;
1021 changed (PLAYER_BACKGROUND_IMAGE);
1024 void set_kdm_server_url (std::string s) {
1025 maybe_set (_kdm_server_url, s);
1028 void set_player_watermark_theatre (std::string p) {
1029 maybe_set (_player_watermark_theatre, p);
1032 void set_player_watermark_period (int minutes) {
1033 maybe_set (_player_watermark_period, minutes);
1036 void set_player_watermark_duration (int milliseconds) {
1037 maybe_set (_player_watermark_duration, milliseconds);
1040 void set_required_monitors (std::vector<Monitor> monitors) {
1041 maybe_set (_required_monitors, monitors);
1044 void set_player_lock_file (boost::filesystem::path p) {
1045 maybe_set (_player_lock_file, p);
1048 void unset_player_lock_file () {
1049 if (!_player_lock_file) {
1052 _player_lock_file = boost::none;
1057 void changed (Property p = OTHER);
1058 boost::signals2::signal<void (Property)> Changed;
1059 /** Emitted if read() failed on an existing Config file. There is nothing
1060 a listener can do about it: this is just for information.
1062 static boost::signals2::signal<void ()> FailedToLoad;
1063 /** Emitted if read() issued a warning which the user might want to know about */
1064 static boost::signals2::signal<void (std::string)> Warning;
1065 /** Emitted if there is a bad certificate in the signer chain. Handler can call
1066 * true to ask Config to re-create the chain.
1068 static boost::signals2::signal<bool (void)> BadSignerChain;
1070 void write () const;
1071 void write_config () const;
1072 void write_cinemas () const;
1073 void link (boost::filesystem::path new_file) const;
1074 void copy_and_link (boost::filesystem::path new_file) const;
1075 bool have_write_permission () const;
1077 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1078 bool existing_template (std::string name) const;
1079 std::list<std::string> templates () const;
1080 boost::filesystem::path template_path (std::string name) const;
1081 void rename_template (std::string old_name, std::string new_name) const;
1082 void delete_template (std::string name) const;
1084 static Config* instance ();
1085 static void drop ();
1086 static void restore_defaults ();
1087 static bool have_existing (std::string);
1088 static boost::filesystem::path config_file ();
1089 static boost::filesystem::path path (std::string file, bool create_directories = true);
1091 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1092 static boost::optional<boost::filesystem::path> override_path;
1097 void set_defaults ();
1098 void set_kdm_email_to_default ();
1099 void set_notification_email_to_default ();
1100 void set_cover_sheet_to_default ();
1101 void read_cinemas (cxml::Document const & f);
1102 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1103 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1104 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1105 void clean_history_internal (std::vector<boost::filesystem::path>& h);
1109 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1110 if (member == new_value) {
1118 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1119 if (member && member.get() == new_value) {
1126 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1127 int _master_encoding_threads;
1128 /** number of threads which a server should use for J2K encoding on the local machine */
1129 int _server_encoding_threads;
1130 /** default directory to put new films in */
1131 boost::optional<boost::filesystem::path> _default_directory;
1132 /** base port number to use for J2K encoding servers;
1133 * this port and the two above it will be used.
1135 int _server_port_base;
1136 /** true to broadcast on the `any' address to look for servers */
1137 bool _use_any_servers;
1138 /** J2K encoding servers that should definitely be used */
1139 std::vector<std::string> _servers;
1140 bool _only_servers_encode;
1141 Protocol _tms_protocol;
1142 /** The IP address of a TMS that we can copy DCPs to */
1143 std::string _tms_ip;
1144 /** The path on a TMS that we should write DCPs to */
1145 std::string _tms_path;
1146 /** User name to log into the TMS with */
1147 std::string _tms_user;
1148 /** Password to log into the TMS with */
1149 std::string _tms_password;
1150 /** Our cinema sound processor */
1151 CinemaSoundProcessor const * _cinema_sound_processor;
1152 /** The list of possible DCP frame rates that DCP-o-matic will use */
1153 std::list<int> _allowed_dcp_frame_rates;
1154 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1155 bool _allow_any_dcp_frame_rate;
1156 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1157 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1158 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1160 bool _allow_any_container;
1161 /** Default ISDCF metadata for newly-created Films */
1162 ISDCFMetadata _default_isdcf_metadata;
1163 boost::optional<std::string> _language;
1164 /** Default length of still image content (seconds) */
1165 int _default_still_length;
1166 Ratio const * _default_container;
1167 Ratio const * _default_scale_to;
1168 DCPContentType const * _default_dcp_content_type;
1169 int _default_dcp_audio_channels;
1170 std::string _dcp_issuer;
1171 std::string _dcp_creator;
1172 int _default_j2k_bandwidth;
1173 int _default_audio_delay;
1174 bool _default_interop;
1175 /** Default directory to offer to write KDMs to; if it's not set,
1176 the home directory will be offered.
1178 boost::optional<boost::filesystem::path> _default_kdm_directory;
1179 bool _default_upload_after_make_dcp;
1180 std::list<boost::shared_ptr<Cinema> > _cinemas;
1181 std::string _mail_server;
1183 std::string _mail_user;
1184 std::string _mail_password;
1185 std::string _kdm_subject;
1186 std::string _kdm_from;
1187 std::vector<std::string> _kdm_cc;
1188 std::string _kdm_bcc;
1189 std::string _kdm_email;
1190 std::string _notification_subject;
1191 std::string _notification_from;
1192 std::string _notification_to;
1193 std::vector<std::string> _notification_cc;
1194 std::string _notification_bcc;
1195 std::string _notification_email;
1196 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1197 #ifdef DCPOMATIC_VARIANT_SWAROOP
1198 boost::filesystem::path _signer_chain_path;
1200 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1201 * certificate for making KDMs given to DCP-o-matic.
1203 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1204 #ifdef DCPOMATIC_VARIANT_SWAROOP
1205 boost::filesystem::path _decryption_chain_path;
1207 /** true to check for updates on startup */
1208 bool _check_for_updates;
1209 bool _check_for_test_updates;
1210 /** maximum allowed J2K bandwidth in bits per second */
1211 int _maximum_j2k_bandwidth;
1213 bool _analyse_ebur128;
1214 bool _automatic_audio_analysis;
1215 #ifdef DCPOMATIC_WINDOWS
1216 bool _win32_console;
1218 std::vector<boost::filesystem::path> _history;
1219 std::vector<boost::filesystem::path> _player_history;
1220 boost::shared_ptr<DKDMGroup> _dkdms;
1221 boost::filesystem::path _cinemas_file;
1222 bool _show_hints_before_make_dcp;
1223 bool _confirm_kdm_email;
1224 dcp::NameFormat _kdm_filename_format;
1225 dcp::NameFormat _kdm_container_name_format;
1226 dcp::NameFormat _dcp_metadata_filename_format;
1227 dcp::NameFormat _dcp_asset_filename_format;
1228 bool _jump_to_selected;
1229 bool _nagged[NAG_COUNT];
1231 /** name of a specific sound output stream to use, or empty to use the default */
1232 boost::optional<std::string> _sound_output;
1233 std::string _cover_sheet;
1234 boost::optional<boost::filesystem::path> _last_player_load_directory;
1235 boost::optional<KDMWriteType> _last_kdm_write_type;
1236 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1237 int _frames_in_memory_multiplier;
1238 boost::optional<int> _decode_reduction;
1239 bool _default_notify;
1240 bool _notification[NOTIFICATION_COUNT];
1241 boost::optional<std::string> _barco_username;
1242 boost::optional<std::string> _barco_password;
1243 boost::optional<std::string> _christie_username;
1244 boost::optional<std::string> _christie_password;
1245 boost::optional<std::string> _gdc_username;
1246 boost::optional<std::string> _gdc_password;
1247 Interface _interface_complexity;
1248 PlayerMode _player_mode;
1250 bool _respect_kdm_validity_periods;
1251 /** Log file containing things the player does (e.g. started, stopped, loaded
1252 playlist etc.) Does not contain debugging information.
1254 boost::optional<boost::filesystem::path> _player_activity_log_file;
1255 /** Log file containing debug information for the player */
1256 boost::optional<boost::filesystem::path> _player_debug_log_file;
1257 /** A directory containing DCPs whose contents are presented to the user
1258 in the dual-screen player mode. DCPs on the list can be loaded
1261 boost::optional<boost::filesystem::path> _player_content_directory;
1262 boost::optional<boost::filesystem::path> _player_playlist_directory;
1263 boost::optional<boost::filesystem::path> _player_kdm_directory;
1264 #ifdef DCPOMATIC_VARIANT_SWAROOP
1265 boost::optional<boost::filesystem::path> _player_background_image;
1266 std::string _kdm_server_url;
1267 std::string _player_watermark_theatre;
1268 /** watermark period in minutes */
1269 int _player_watermark_period;
1270 /** watermark duration in milliseconds */
1271 int _player_watermark_duration;
1272 std::vector<Monitor> _required_monitors;
1273 /** a file which, if specified, must be present for the player to work */
1274 boost::optional<boost::filesystem::path> _player_lock_file;
1277 static int const _current_version;
1279 /** Singleton instance, or 0 */
1280 static Config* _instance;