2 Copyright (C) 2012-2019 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"
32 #include "audio_mapping.h"
33 #include <dcp/name_format.h>
34 #include <dcp/certificate_chain.h>
35 #include <dcp/encrypted_kdm.h>
36 #include <boost/shared_ptr.hpp>
37 #include <boost/signals2.hpp>
38 #include <boost/filesystem.hpp>
41 class CinemaSoundProcessor;
49 * @brief A singleton class holding configuration.
51 class Config : public State
54 /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
55 int master_encoding_threads () const {
56 return _master_encoding_threads;
59 /** @return number of threads which a server should use for J2K encoding on the local machine */
60 int server_encoding_threads () const {
61 return _server_encoding_threads;
64 boost::optional<boost::filesystem::path> default_directory () const {
65 return _default_directory;
68 boost::optional<boost::filesystem::path> default_kdm_directory () const {
69 return _default_kdm_directory;
72 boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
73 boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
82 PLAYER_CONTENT_DIRECTORY,
83 PLAYER_PLAYLIST_DIRECTORY,
86 SHOW_EXPERIMENTAL_AUDIO_PROCESSORS,
88 #ifdef DCPOMATIC_VARIANT_SWAROOP
89 PLAYER_BACKGROUND_IMAGE,
94 /** @return base port number to use for J2K encoding servers */
95 int server_port_base () const {
96 return _server_port_base;
99 void set_use_any_servers (bool u) {
100 _use_any_servers = u;
101 changed (USE_ANY_SERVERS);
104 bool use_any_servers () const {
105 return _use_any_servers;
108 /** @param s New list of servers */
109 void set_servers (std::vector<std::string> s) {
114 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
115 std::vector<std::string> servers () const {
119 bool only_servers_encode () const {
120 return _only_servers_encode;
123 FileTransferProtocol tms_protocol () const {
124 return _tms_protocol;
127 /** @return The IP address of a TMS that we can copy DCPs to */
128 std::string tms_ip () const {
132 /** @return The path on a TMS that we should changed DCPs to */
133 std::string tms_path () const {
137 /** @return User name to log into the TMS with */
138 std::string tms_user () const {
142 /** @return Password to log into the TMS with */
143 std::string tms_password () const {
144 return _tms_password;
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 bool show_experimental_audio_processors () const {
164 return _show_experimental_audio_processors;
167 ISDCFMetadata default_isdcf_metadata () const {
168 return _default_isdcf_metadata;
171 boost::optional<std::string> language () const {
175 int default_still_length () const {
176 return _default_still_length;
179 Ratio const * default_container () const {
180 return _default_container;
183 Ratio const * default_scale_to () const {
184 return _default_scale_to;
187 DCPContentType const * default_dcp_content_type () const {
188 return _default_dcp_content_type;
191 int default_dcp_audio_channels () const {
192 return _default_dcp_audio_channels;
195 std::string dcp_issuer () const {
199 std::string dcp_creator () const {
203 int default_j2k_bandwidth () const {
204 return _default_j2k_bandwidth;
207 int default_audio_delay () const {
208 return _default_audio_delay;
211 bool default_interop () const {
212 return _default_interop;
215 bool default_upload_after_make_dcp () {
216 return _default_upload_after_make_dcp;
219 void set_default_kdm_directory (boost::filesystem::path d) {
220 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
223 _default_kdm_directory = d;
227 std::string mail_server () const {
231 int mail_port () const {
235 EmailProtocol mail_protocol () const {
236 return _mail_protocol;
239 std::string mail_user () const {
243 std::string mail_password () const {
244 return _mail_password;
247 std::string kdm_subject () const {
251 std::string kdm_from () const {
255 std::vector<std::string> kdm_cc () const {
259 std::string kdm_bcc () const {
263 std::string kdm_email () const {
267 std::string notification_subject () const {
268 return _notification_subject;
271 std::string notification_from () const {
272 return _notification_from;
275 std::string notification_to () const {
276 return _notification_to;
279 std::vector<std::string> notification_cc () const {
280 return _notification_cc;
283 std::string notification_bcc () const {
284 return _notification_bcc;
287 std::string notification_email () const {
288 return _notification_email;
291 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
292 return _signer_chain;
295 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
296 return _decryption_chain;
299 bool check_for_updates () const {
300 return _check_for_updates;
303 bool check_for_test_updates () const {
304 return _check_for_test_updates;
307 int maximum_j2k_bandwidth () const {
308 return _maximum_j2k_bandwidth;
311 int log_types () const {
315 bool analyse_ebur128 () const {
316 return _analyse_ebur128;
319 bool automatic_audio_analysis () const {
320 return _automatic_audio_analysis;
323 #ifdef DCPOMATIC_WINDOWS
324 bool win32_console () const {
325 return _win32_console;
329 std::vector<boost::filesystem::path> history () const {
333 std::vector<boost::filesystem::path> player_history () const {
334 return _player_history;
337 boost::shared_ptr<DKDMGroup> dkdms () const {
341 boost::filesystem::path cinemas_file () const {
342 return _cinemas_file;
345 bool show_hints_before_make_dcp () const {
346 return _show_hints_before_make_dcp;
349 bool confirm_kdm_email () const {
350 return _confirm_kdm_email;
353 dcp::NameFormat kdm_container_name_format () const {
354 return _kdm_container_name_format;
357 dcp::NameFormat kdm_filename_format () const {
358 return _kdm_filename_format;
361 dcp::NameFormat dcp_metadata_filename_format () const {
362 return _dcp_metadata_filename_format;
365 dcp::NameFormat dcp_asset_filename_format () const {
366 return _dcp_asset_filename_format;
369 bool jump_to_selected () const {
370 return _jump_to_selected;
375 NAG_ENCRYPTED_METADATA,
376 NAG_ALTER_DECRYPTION_CHAIN,
377 NAG_BAD_SIGNER_CHAIN,
378 /* Not really a nag but it's the same idea */
380 NAG_IMPORT_DECRYPTION_CHAIN,
386 bool nagged (Nag nag) const {
390 bool sound () const {
394 std::string cover_sheet () const {
398 boost::optional<std::string> sound_output () const {
399 return _sound_output;
402 boost::optional<boost::filesystem::path> last_player_load_directory () const {
403 return _last_player_load_directory;
412 boost::optional<KDMWriteType> last_kdm_write_type () const {
413 return _last_kdm_write_type;
421 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
422 return _last_dkdm_write_type;
425 int frames_in_memory_multiplier () const {
426 return _frames_in_memory_multiplier;
429 boost::optional<int> decode_reduction () const {
430 return _decode_reduction;
433 bool default_notify () const {
434 return _default_notify;
443 bool notification (Notification n) const {
444 return _notification[n];
447 boost::optional<std::string> barco_username () const {
448 return _barco_username;
451 boost::optional<std::string> barco_password () const {
452 return _barco_password;
455 boost::optional<std::string> christie_username () const {
456 return _christie_username;
459 boost::optional<std::string> christie_password () const {
460 return _christie_password;
463 boost::optional<std::string> gdc_username () const {
464 return _gdc_username;
467 boost::optional<std::string> gdc_password () const {
468 return _gdc_password;
476 Interface interface_complexity () const {
477 return _interface_complexity;
486 PlayerMode player_mode () const {
490 int image_display () const {
491 return _image_display;
499 VideoViewType video_view_type () const {
500 return _video_view_type;
503 bool respect_kdm_validity_periods () const {
504 return _respect_kdm_validity_periods;
507 boost::optional<boost::filesystem::path> player_activity_log_file () const {
508 return _player_activity_log_file;
511 boost::optional<boost::filesystem::path> player_debug_log_file () const {
512 return _player_debug_log_file;
515 boost::optional<boost::filesystem::path> player_content_directory () const {
516 return _player_content_directory;
519 boost::optional<boost::filesystem::path> player_playlist_directory () const {
520 return _player_playlist_directory;
523 boost::optional<boost::filesystem::path> player_kdm_directory () const {
524 return _player_kdm_directory;
527 AudioMapping audio_mapping (int output_channels);
529 #ifdef DCPOMATIC_VARIANT_SWAROOP
530 boost::optional<boost::filesystem::path> player_background_image () const {
531 return _player_background_image;
534 std::string kdm_server_url () const {
535 return _kdm_server_url;
538 std::string player_watermark_theatre () const {
539 return _player_watermark_theatre;
542 int player_watermark_period () const {
543 return _player_watermark_period;
546 int player_watermark_duration () const {
547 return _player_watermark_duration;
550 std::vector<Monitor> required_monitors () const {
551 return _required_monitors;
554 boost::optional<boost::filesystem::path> player_lock_file () const {
555 return _player_lock_file;
561 void set_master_encoding_threads (int n) {
562 maybe_set (_master_encoding_threads, n);
565 void set_server_encoding_threads (int n) {
566 maybe_set (_server_encoding_threads, n);
569 void set_default_directory (boost::filesystem::path d) {
570 if (_default_directory && *_default_directory == d) {
573 _default_directory = d;
577 /** @param p New server port */
578 void set_server_port_base (int p) {
579 maybe_set (_server_port_base, p);
582 void set_only_servers_encode (bool o) {
583 maybe_set (_only_servers_encode, o);
586 void set_tms_protocol (FileTransferProtocol p) {
587 maybe_set (_tms_protocol, p);
590 /** @param i IP address of a TMS that we can copy DCPs to */
591 void set_tms_ip (std::string i) {
592 maybe_set (_tms_ip, i);
595 /** @param p Path on a TMS that we should changed DCPs to */
596 void set_tms_path (std::string p) {
597 maybe_set (_tms_path, p);
600 /** @param u User name to log into the TMS with */
601 void set_tms_user (std::string u) {
602 maybe_set (_tms_user, u);
605 /** @param p Password to log into the TMS with */
606 void set_tms_password (std::string p) {
607 maybe_set (_tms_password, p);
610 void add_cinema (boost::shared_ptr<Cinema> c) {
611 _cinemas.push_back (c);
615 void remove_cinema (boost::shared_ptr<Cinema> c) {
620 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
621 maybe_set (_allowed_dcp_frame_rates, r);
624 void set_allow_any_dcp_frame_rate (bool a) {
625 maybe_set (_allow_any_dcp_frame_rate, a);
628 void set_allow_any_container (bool a) {
629 maybe_set (_allow_any_container, a);
632 void set_show_experimental_audio_processors (bool e) {
633 maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
636 void set_default_isdcf_metadata (ISDCFMetadata d) {
637 maybe_set (_default_isdcf_metadata, d);
640 void set_language (std::string l) {
641 if (_language && _language.get() == l) {
648 void unset_language () {
653 _language = boost::none;
657 void set_default_still_length (int s) {
658 maybe_set (_default_still_length, s);
661 void set_default_container (Ratio const * c) {
662 maybe_set (_default_container, c);
665 void set_default_scale_to (Ratio const * c) {
666 maybe_set (_default_scale_to, c);
669 void set_default_dcp_content_type (DCPContentType const * t) {
670 maybe_set (_default_dcp_content_type, t);
673 void set_default_dcp_audio_channels (int c) {
674 maybe_set (_default_dcp_audio_channels, c);
677 void set_dcp_issuer (std::string i) {
678 maybe_set (_dcp_issuer, i);
681 void set_dcp_creator (std::string c) {
682 maybe_set (_dcp_creator, c);
685 void set_default_j2k_bandwidth (int b) {
686 maybe_set (_default_j2k_bandwidth, b);
689 void set_default_audio_delay (int d) {
690 maybe_set (_default_audio_delay, d);
693 void set_default_interop (bool i) {
694 maybe_set (_default_interop, i);
697 void set_default_upload_after_make_dcp (bool u) {
698 maybe_set (_default_upload_after_make_dcp, u);
701 void set_mail_server (std::string s) {
702 maybe_set (_mail_server, s);
705 void set_mail_port (int p) {
706 maybe_set (_mail_port, p);
709 void set_mail_protocol (EmailProtocol p) {
710 maybe_set (_mail_protocol, p);
713 void set_mail_user (std::string u) {
714 maybe_set (_mail_user, u);
717 void set_mail_password (std::string p) {
718 maybe_set (_mail_password, p);
721 void set_kdm_subject (std::string s) {
722 maybe_set (_kdm_subject, s);
725 void set_kdm_from (std::string f) {
726 maybe_set (_kdm_from, f);
729 void set_kdm_cc (std::vector<std::string> f) {
730 maybe_set (_kdm_cc, f);
733 void set_kdm_bcc (std::string f) {
734 maybe_set (_kdm_bcc, f);
737 void set_kdm_email (std::string e) {
738 maybe_set (_kdm_email, e);
741 void reset_kdm_email ();
743 void set_notification_subject (std::string s) {
744 maybe_set (_notification_subject, s);
747 void set_notification_from (std::string f) {
748 maybe_set (_notification_from, f);
751 void set_notification_to (std::string t) {
752 maybe_set (_notification_to, t);
755 void set_notification_cc (std::vector<std::string> f) {
756 maybe_set (_notification_cc, f);
759 void set_notification_bcc (std::string f) {
760 maybe_set (_notification_bcc, f);
763 void set_notification_email (std::string e) {
764 maybe_set (_notification_email, e);
767 void reset_notification_email ();
769 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
770 maybe_set (_signer_chain, s);
773 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
774 maybe_set (_decryption_chain, c);
777 void set_check_for_updates (bool c) {
778 maybe_set (_check_for_updates, c);
780 set_check_for_test_updates (false);
784 void set_check_for_test_updates (bool c) {
785 maybe_set (_check_for_test_updates, c);
788 void set_maximum_j2k_bandwidth (int b) {
789 maybe_set (_maximum_j2k_bandwidth, b);
792 void set_log_types (int t) {
793 maybe_set (_log_types, t);
796 void set_analyse_ebur128 (bool a) {
797 maybe_set (_analyse_ebur128, a);
800 void set_automatic_audio_analysis (bool a) {
801 maybe_set (_automatic_audio_analysis, a);
804 #ifdef DCPOMATIC_WINDOWS
805 void set_win32_console (bool c) {
806 maybe_set (_win32_console, c);
810 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
815 void set_cinemas_file (boost::filesystem::path file);
817 void set_show_hints_before_make_dcp (bool s) {
818 maybe_set (_show_hints_before_make_dcp, s);
821 void set_confirm_kdm_email (bool s) {
822 maybe_set (_confirm_kdm_email, s);
825 void set_sound (bool s) {
826 maybe_set (_sound, s, SOUND);
829 void set_sound_output (std::string o) {
830 maybe_set (_sound_output, o, SOUND_OUTPUT);
833 void set_last_player_load_directory (boost::filesystem::path d) {
834 maybe_set (_last_player_load_directory, d);
837 void set_last_kdm_write_type (KDMWriteType t) {
838 maybe_set (_last_kdm_write_type, t);
841 void set_last_dkdm_write_type (DKDMWriteType t) {
842 maybe_set (_last_dkdm_write_type, t);
845 void unset_sound_output () {
846 if (!_sound_output) {
850 _sound_output = boost::none;
854 void set_kdm_container_name_format (dcp::NameFormat n) {
855 maybe_set (_kdm_container_name_format, n);
858 void set_kdm_filename_format (dcp::NameFormat n) {
859 maybe_set (_kdm_filename_format, n);
862 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
863 maybe_set (_dcp_metadata_filename_format, n);
866 void set_dcp_asset_filename_format (dcp::NameFormat n) {
867 maybe_set (_dcp_asset_filename_format, n);
870 void set_frames_in_memory_multiplier (int m) {
871 maybe_set (_frames_in_memory_multiplier, m);
874 void set_decode_reduction (boost::optional<int> r) {
875 maybe_set (_decode_reduction, r);
878 void set_default_notify (bool n) {
879 maybe_set (_default_notify, n);
882 void clear_history () {
887 void clear_player_history () {
888 _player_history.clear ();
892 void add_to_history (boost::filesystem::path p);
893 void clean_history ();
894 void add_to_player_history (boost::filesystem::path p);
895 void clean_player_history ();
897 void set_jump_to_selected (bool j) {
898 maybe_set (_jump_to_selected, j);
901 void set_nagged (Nag nag, bool nagged) {
902 maybe_set (_nagged[nag], nagged);
905 void set_cover_sheet (std::string s) {
906 maybe_set (_cover_sheet, s);
909 void reset_cover_sheet ();
911 void set_notification (Notification n, bool v) {
912 maybe_set (_notification[n], v);
915 void set_barco_username (std::string u) {
916 maybe_set (_barco_username, u);
919 void unset_barco_username () {
920 maybe_set (_barco_username, boost::optional<std::string>());
923 void set_barco_password (std::string p) {
924 maybe_set (_barco_password, p);
927 void unset_barco_password () {
928 maybe_set (_barco_password, boost::optional<std::string>());
931 void set_christie_username (std::string u) {
932 maybe_set (_christie_username, u);
935 void unset_christie_username () {
936 maybe_set (_christie_username, boost::optional<std::string>());
939 void set_christie_password (std::string p) {
940 maybe_set (_christie_password, p);
943 void unset_christie_password () {
944 maybe_set (_christie_password, boost::optional<std::string>());
947 void set_gdc_username (std::string u) {
948 maybe_set (_gdc_username, u);
951 void unset_gdc_username () {
952 maybe_set (_gdc_username, boost::optional<std::string>());
955 void set_gdc_password (std::string p) {
956 maybe_set (_gdc_password, p);
959 void unset_gdc_password () {
960 maybe_set (_gdc_password, boost::optional<std::string>());
963 void set_interface_complexity (Interface i) {
964 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
967 void set_player_mode (PlayerMode m) {
968 maybe_set (_player_mode, m);
971 void set_image_display (int n) {
972 maybe_set (_image_display, n);
975 void set_video_view_type (VideoViewType v) {
976 maybe_set (_video_view_type, v);
979 void set_respect_kdm_validity_periods (bool r) {
980 maybe_set (_respect_kdm_validity_periods, r);
983 void set_player_activity_log_file (boost::filesystem::path p) {
984 maybe_set (_player_activity_log_file, p);
987 void unset_player_activity_log_file () {
988 if (!_player_activity_log_file) {
991 _player_activity_log_file = boost::none;
995 void set_player_debug_log_file (boost::filesystem::path p) {
996 maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
999 void unset_player_debug_log_file () {
1000 if (!_player_debug_log_file) {
1003 _player_debug_log_file = boost::none;
1004 changed (PLAYER_DEBUG_LOG);
1007 void set_player_content_directory (boost::filesystem::path p) {
1008 maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
1011 void unset_player_content_directory () {
1012 if (!_player_content_directory) {
1015 _player_content_directory = boost::none;
1016 changed (PLAYER_CONTENT_DIRECTORY);
1019 void set_player_playlist_directory (boost::filesystem::path p) {
1020 maybe_set (_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
1023 void unset_player_playlist_directory () {
1024 if (!_player_playlist_directory) {
1027 _player_playlist_directory = boost::none;
1028 changed (PLAYER_PLAYLIST_DIRECTORY);
1031 void set_player_kdm_directory (boost::filesystem::path p) {
1032 maybe_set (_player_kdm_directory, p);
1035 void unset_player_kdm_directory () {
1036 if (!_player_kdm_directory) {
1039 _player_kdm_directory = boost::none;
1043 void set_audio_mapping (AudioMapping m);
1044 void set_audio_mapping_to_default ();
1046 #ifdef DCPOMATIC_VARIANT_SWAROOP
1047 void set_player_background_image (boost::filesystem::path p) {
1048 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
1051 void unset_player_background_image () {
1052 if (!_player_background_image) {
1055 _player_background_image = boost::none;
1056 changed (PLAYER_BACKGROUND_IMAGE);
1059 void set_kdm_server_url (std::string s) {
1060 maybe_set (_kdm_server_url, s);
1063 void set_player_watermark_theatre (std::string p) {
1064 maybe_set (_player_watermark_theatre, p);
1067 void set_player_watermark_period (int minutes) {
1068 maybe_set (_player_watermark_period, minutes);
1071 void set_player_watermark_duration (int milliseconds) {
1072 maybe_set (_player_watermark_duration, milliseconds);
1075 void set_required_monitors (std::vector<Monitor> monitors) {
1076 maybe_set (_required_monitors, monitors);
1079 void set_player_lock_file (boost::filesystem::path p) {
1080 maybe_set (_player_lock_file, p);
1083 void unset_player_lock_file () {
1084 if (!_player_lock_file) {
1087 _player_lock_file = boost::none;
1092 void changed (Property p = OTHER);
1093 boost::signals2::signal<void (Property)> Changed;
1094 /** Emitted if read() failed on an existing Config file. There is nothing
1095 a listener can do about it: this is just for information.
1097 static boost::signals2::signal<void ()> FailedToLoad;
1098 /** Emitted if read() issued a warning which the user might want to know about */
1099 static boost::signals2::signal<void (std::string)> Warning;
1100 /** Emitted if there is a something wrong the contents of our config. Handler can call
1101 * true to ask Config to solve the problem (by discarding and recreating the bad thing)
1104 BAD_SIGNER_UTF8_STRINGS, ///< signer chain contains UTF-8 strings (not PRINTABLESTRING)
1105 BAD_SIGNER_INCONSISTENT, ///< signer chain is somehow inconsistent
1106 BAD_DECRYPTION_INCONSISTENT, ///< KDM decryption chain is somehow inconsistent
1109 static boost::signals2::signal<bool (BadReason)> Bad;
1111 void write () const;
1112 void write_config () const;
1113 void write_cinemas () const;
1114 void link (boost::filesystem::path new_file) const;
1115 void copy_and_link (boost::filesystem::path new_file) const;
1116 bool have_write_permission () const;
1118 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1119 bool existing_template (std::string name) const;
1120 std::list<std::string> templates () const;
1121 boost::filesystem::path template_path (std::string name) const;
1122 void rename_template (std::string old_name, std::string new_name) const;
1123 void delete_template (std::string name) const;
1125 static Config* instance ();
1126 static void drop ();
1127 static void restore_defaults ();
1128 static bool have_existing (std::string);
1129 static boost::filesystem::path config_file ();
1134 void set_defaults ();
1135 void set_kdm_email_to_default ();
1136 void set_notification_email_to_default ();
1137 void set_cover_sheet_to_default ();
1138 void read_cinemas (cxml::Document const & f);
1139 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1140 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1141 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1142 void clean_history_internal (std::vector<boost::filesystem::path>& h);
1146 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1147 if (member == new_value) {
1155 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1156 if (member && member.get() == new_value) {
1163 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1164 int _master_encoding_threads;
1165 /** number of threads which a server should use for J2K encoding on the local machine */
1166 int _server_encoding_threads;
1167 /** default directory to put new films in */
1168 boost::optional<boost::filesystem::path> _default_directory;
1169 /** base port number to use for J2K encoding servers;
1170 * this port and the two above it will be used.
1172 int _server_port_base;
1173 /** true to broadcast on the `any' address to look for servers */
1174 bool _use_any_servers;
1175 /** J2K encoding servers that should definitely be used */
1176 std::vector<std::string> _servers;
1177 bool _only_servers_encode;
1178 FileTransferProtocol _tms_protocol;
1179 /** The IP address of a TMS that we can copy DCPs to */
1180 std::string _tms_ip;
1181 /** The path on a TMS that we should write DCPs to */
1182 std::string _tms_path;
1183 /** User name to log into the TMS with */
1184 std::string _tms_user;
1185 /** Password to log into the TMS with */
1186 std::string _tms_password;
1187 /** The list of possible DCP frame rates that DCP-o-matic will use */
1188 std::list<int> _allowed_dcp_frame_rates;
1189 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1190 bool _allow_any_dcp_frame_rate;
1191 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1192 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1193 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1195 bool _allow_any_container;
1196 /** Offer the upmixers in the audio processor settings */
1197 bool _show_experimental_audio_processors;
1198 /** Default ISDCF metadata for newly-created Films */
1199 ISDCFMetadata _default_isdcf_metadata;
1200 boost::optional<std::string> _language;
1201 /** Default length of still image content (seconds) */
1202 int _default_still_length;
1203 Ratio const * _default_container;
1204 Ratio const * _default_scale_to;
1205 DCPContentType const * _default_dcp_content_type;
1206 int _default_dcp_audio_channels;
1207 std::string _dcp_issuer;
1208 std::string _dcp_creator;
1209 int _default_j2k_bandwidth;
1210 int _default_audio_delay;
1211 bool _default_interop;
1212 /** Default directory to offer to write KDMs to; if it's not set,
1213 the home directory will be offered.
1215 boost::optional<boost::filesystem::path> _default_kdm_directory;
1216 bool _default_upload_after_make_dcp;
1217 std::list<boost::shared_ptr<Cinema> > _cinemas;
1218 std::string _mail_server;
1220 EmailProtocol _mail_protocol;
1221 std::string _mail_user;
1222 std::string _mail_password;
1223 std::string _kdm_subject;
1224 std::string _kdm_from;
1225 std::vector<std::string> _kdm_cc;
1226 std::string _kdm_bcc;
1227 std::string _kdm_email;
1228 std::string _notification_subject;
1229 std::string _notification_from;
1230 std::string _notification_to;
1231 std::vector<std::string> _notification_cc;
1232 std::string _notification_bcc;
1233 std::string _notification_email;
1234 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1235 #ifdef DCPOMATIC_VARIANT_SWAROOP
1236 boost::filesystem::path _signer_chain_path;
1238 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1239 * certificate for making KDMs given to DCP-o-matic.
1241 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1242 #ifdef DCPOMATIC_VARIANT_SWAROOP
1243 boost::filesystem::path _decryption_chain_path;
1245 /** true to check for updates on startup */
1246 bool _check_for_updates;
1247 bool _check_for_test_updates;
1248 /** maximum allowed J2K bandwidth in bits per second */
1249 int _maximum_j2k_bandwidth;
1251 bool _analyse_ebur128;
1252 bool _automatic_audio_analysis;
1253 #ifdef DCPOMATIC_WINDOWS
1254 bool _win32_console;
1256 std::vector<boost::filesystem::path> _history;
1257 std::vector<boost::filesystem::path> _player_history;
1258 boost::shared_ptr<DKDMGroup> _dkdms;
1259 boost::filesystem::path _cinemas_file;
1260 bool _show_hints_before_make_dcp;
1261 bool _confirm_kdm_email;
1262 dcp::NameFormat _kdm_filename_format;
1263 dcp::NameFormat _kdm_container_name_format;
1264 dcp::NameFormat _dcp_metadata_filename_format;
1265 dcp::NameFormat _dcp_asset_filename_format;
1266 bool _jump_to_selected;
1267 bool _nagged[NAG_COUNT];
1269 /** name of a specific sound output stream to use, or empty to use the default */
1270 boost::optional<std::string> _sound_output;
1271 std::string _cover_sheet;
1272 boost::optional<boost::filesystem::path> _last_player_load_directory;
1273 boost::optional<KDMWriteType> _last_kdm_write_type;
1274 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1275 int _frames_in_memory_multiplier;
1276 boost::optional<int> _decode_reduction;
1277 bool _default_notify;
1278 bool _notification[NOTIFICATION_COUNT];
1279 boost::optional<std::string> _barco_username;
1280 boost::optional<std::string> _barco_password;
1281 boost::optional<std::string> _christie_username;
1282 boost::optional<std::string> _christie_password;
1283 boost::optional<std::string> _gdc_username;
1284 boost::optional<std::string> _gdc_password;
1285 Interface _interface_complexity;
1286 PlayerMode _player_mode;
1288 VideoViewType _video_view_type;
1289 bool _respect_kdm_validity_periods;
1290 /** Log file containing things the player does (e.g. started, stopped, loaded
1291 playlist etc.) Does not contain debugging information.
1293 boost::optional<boost::filesystem::path> _player_activity_log_file;
1294 /** Log file containing debug information for the player */
1295 boost::optional<boost::filesystem::path> _player_debug_log_file;
1296 /** A directory containing DCPs whose contents are presented to the user
1297 in the dual-screen player mode. DCPs on the list can be loaded
1300 boost::optional<boost::filesystem::path> _player_content_directory;
1301 boost::optional<boost::filesystem::path> _player_playlist_directory;
1302 boost::optional<boost::filesystem::path> _player_kdm_directory;
1303 boost::optional<AudioMapping> _audio_mapping;
1304 #ifdef DCPOMATIC_VARIANT_SWAROOP
1305 boost::optional<boost::filesystem::path> _player_background_image;
1306 std::string _kdm_server_url;
1307 std::string _player_watermark_theatre;
1308 /** watermark period in minutes */
1309 int _player_watermark_period;
1310 /** watermark duration in milliseconds */
1311 int _player_watermark_duration;
1312 std::vector<Monitor> _required_monitors;
1313 /** a file which, if specified, must be present for the player to work */
1314 boost::optional<boost::filesystem::path> _player_lock_file;
1317 static int const _current_version;
1319 /** Singleton instance, or 0 */
1320 static Config* _instance;