2 Copyright (C) 2012-2020 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;
50 * @brief A singleton class holding configuration.
52 class Config : public State
55 /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
56 int master_encoding_threads () const {
57 return _master_encoding_threads;
60 /** @return number of threads which a server should use for J2K encoding on the local machine */
61 int server_encoding_threads () const {
62 return _server_encoding_threads;
65 boost::optional<boost::filesystem::path> default_directory () const {
66 return _default_directory;
69 boost::optional<boost::filesystem::path> default_kdm_directory () const {
70 return _default_kdm_directory;
73 boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
74 boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
84 PLAYER_CONTENT_DIRECTORY,
85 PLAYER_PLAYLIST_DIRECTORY,
88 SHOW_EXPERIMENTAL_AUDIO_PROCESSORS,
90 #ifdef DCPOMATIC_VARIANT_SWAROOP
91 PLAYER_BACKGROUND_IMAGE,
96 /** @return base port number to use for J2K encoding servers */
97 int server_port_base () const {
98 return _server_port_base;
101 void set_use_any_servers (bool u) {
102 _use_any_servers = u;
103 changed (USE_ANY_SERVERS);
106 bool use_any_servers () const {
107 return _use_any_servers;
110 /** @param s New list of servers */
111 void set_servers (std::vector<std::string> s) {
116 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
117 std::vector<std::string> servers () const {
121 bool only_servers_encode () const {
122 return _only_servers_encode;
125 FileTransferProtocol tms_protocol () const {
126 return _tms_protocol;
129 /** @return The IP address of a TMS that we can copy DCPs to */
130 std::string tms_ip () const {
134 /** @return The path on a TMS that we should changed DCPs to */
135 std::string tms_path () const {
139 /** @return User name to log into the TMS with */
140 std::string tms_user () const {
144 /** @return Password to log into the TMS with */
145 std::string tms_password () const {
146 return _tms_password;
149 std::list<boost::shared_ptr<Cinema> > cinemas () const {
153 std::list<boost::shared_ptr<DKDMRecipient> > dkdm_recipients () const {
154 return _dkdm_recipients;
157 std::list<int> allowed_dcp_frame_rates () const {
158 return _allowed_dcp_frame_rates;
161 bool allow_any_dcp_frame_rate () const {
162 return _allow_any_dcp_frame_rate;
165 bool allow_any_container () const {
166 return _allow_any_container;
169 bool show_experimental_audio_processors () const {
170 return _show_experimental_audio_processors;
173 ISDCFMetadata default_isdcf_metadata () const {
174 return _default_isdcf_metadata;
177 boost::optional<std::string> language () const {
181 int default_still_length () const {
182 return _default_still_length;
185 Ratio const * default_container () const {
186 return _default_container;
189 DCPContentType const * default_dcp_content_type () const {
190 return _default_dcp_content_type;
193 int default_dcp_audio_channels () const {
194 return _default_dcp_audio_channels;
197 std::string dcp_issuer () const {
201 std::string dcp_creator () const {
205 std::string dcp_company_name () const {
206 return _dcp_company_name;
209 std::string dcp_product_name () const {
210 return _dcp_product_name;
213 std::string dcp_product_version () const {
214 return _dcp_product_version;
217 std::string dcp_j2k_comment () const {
218 return _dcp_j2k_comment;
221 int default_j2k_bandwidth () const {
222 return _default_j2k_bandwidth;
225 int default_audio_delay () const {
226 return _default_audio_delay;
229 bool default_interop () const {
230 return _default_interop;
233 bool upload_after_make_dcp () {
234 return _upload_after_make_dcp;
237 void set_default_kdm_directory (boost::filesystem::path d) {
238 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
241 _default_kdm_directory = d;
245 std::string mail_server () const {
249 int mail_port () const {
253 EmailProtocol mail_protocol () const {
254 return _mail_protocol;
257 std::string mail_user () const {
261 std::string mail_password () const {
262 return _mail_password;
265 std::string kdm_subject () const {
269 std::string kdm_from () const {
273 std::vector<std::string> kdm_cc () const {
277 std::string kdm_bcc () const {
281 std::string kdm_email () const {
285 std::string notification_subject () const {
286 return _notification_subject;
289 std::string notification_from () const {
290 return _notification_from;
293 std::string notification_to () const {
294 return _notification_to;
297 std::vector<std::string> notification_cc () const {
298 return _notification_cc;
301 std::string notification_bcc () const {
302 return _notification_bcc;
305 std::string notification_email () const {
306 return _notification_email;
309 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
310 return _signer_chain;
313 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
314 return _decryption_chain;
317 bool check_for_updates () const {
318 return _check_for_updates;
321 bool check_for_test_updates () const {
322 return _check_for_test_updates;
325 int maximum_j2k_bandwidth () const {
326 return _maximum_j2k_bandwidth;
329 int log_types () const {
333 bool analyse_ebur128 () const {
334 return _analyse_ebur128;
337 bool automatic_audio_analysis () const {
338 return _automatic_audio_analysis;
341 #ifdef DCPOMATIC_WINDOWS
342 bool win32_console () const {
343 return _win32_console;
347 std::vector<boost::filesystem::path> history () const {
351 std::vector<boost::filesystem::path> player_history () const {
352 return _player_history;
355 boost::shared_ptr<DKDMGroup> dkdms () const {
359 boost::filesystem::path cinemas_file () const {
360 return _cinemas_file;
363 boost::filesystem::path dkdm_recipients_file () const {
364 return _dkdm_recipients_file;
367 bool show_hints_before_make_dcp () const {
368 return _show_hints_before_make_dcp;
371 bool confirm_kdm_email () const {
372 return _confirm_kdm_email;
375 dcp::NameFormat kdm_container_name_format () const {
376 return _kdm_container_name_format;
379 dcp::NameFormat kdm_filename_format () const {
380 return _kdm_filename_format;
383 dcp::NameFormat dkdm_filename_format () const {
384 return _dkdm_filename_format;
387 dcp::NameFormat dcp_metadata_filename_format () const {
388 return _dcp_metadata_filename_format;
391 dcp::NameFormat dcp_asset_filename_format () const {
392 return _dcp_asset_filename_format;
395 bool jump_to_selected () const {
396 return _jump_to_selected;
401 NAG_ENCRYPTED_METADATA,
402 NAG_ALTER_DECRYPTION_CHAIN,
403 NAG_BAD_SIGNER_CHAIN,
404 /* Not really a nag but it's the same idea */
406 NAG_IMPORT_DECRYPTION_CHAIN,
412 bool nagged (Nag nag) const {
416 bool sound () const {
420 std::string cover_sheet () const {
424 boost::optional<std::string> sound_output () const {
425 return _sound_output;
428 boost::optional<boost::filesystem::path> last_player_load_directory () const {
429 return _last_player_load_directory;
438 boost::optional<KDMWriteType> last_kdm_write_type () const {
439 return _last_kdm_write_type;
447 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
448 return _last_dkdm_write_type;
451 int frames_in_memory_multiplier () const {
452 return _frames_in_memory_multiplier;
455 boost::optional<int> decode_reduction () const {
456 return _decode_reduction;
459 bool default_notify () const {
460 return _default_notify;
469 bool notification (Notification n) const {
470 return _notification[n];
473 boost::optional<std::string> barco_username () const {
474 return _barco_username;
477 boost::optional<std::string> barco_password () const {
478 return _barco_password;
481 boost::optional<std::string> christie_username () const {
482 return _christie_username;
485 boost::optional<std::string> christie_password () const {
486 return _christie_password;
489 boost::optional<std::string> gdc_username () const {
490 return _gdc_username;
493 boost::optional<std::string> gdc_password () const {
494 return _gdc_password;
502 Interface interface_complexity () const {
503 return _interface_complexity;
507 PLAYER_MODE_WINDOW, ///< one window containing image and controls
508 PLAYER_MODE_FULL, ///< just the image filling the screen
509 PLAYER_MODE_DUAL ///< image on one monitor and extended controls on the other
512 PlayerMode player_mode () const {
516 int image_display () const {
517 return _image_display;
525 VideoViewType video_view_type () const {
526 return _video_view_type;
529 bool respect_kdm_validity_periods () const {
530 return _respect_kdm_validity_periods;
533 boost::optional<boost::filesystem::path> player_activity_log_file () const {
534 return _player_activity_log_file;
537 boost::optional<boost::filesystem::path> player_debug_log_file () const {
538 return _player_debug_log_file;
541 boost::optional<boost::filesystem::path> player_content_directory () const {
542 return _player_content_directory;
545 boost::optional<boost::filesystem::path> player_playlist_directory () const {
546 return _player_playlist_directory;
549 boost::optional<boost::filesystem::path> player_kdm_directory () const {
550 return _player_kdm_directory;
553 AudioMapping audio_mapping (int output_channels);
555 #ifdef DCPOMATIC_VARIANT_SWAROOP
556 boost::optional<boost::filesystem::path> player_background_image () const {
557 return _player_background_image;
560 std::string kdm_server_url () const {
561 return _kdm_server_url;
564 std::string player_watermark_theatre () const {
565 return _player_watermark_theatre;
568 int player_watermark_period () const {
569 return _player_watermark_period;
572 int player_watermark_duration () const {
573 return _player_watermark_duration;
576 std::vector<Monitor> required_monitors () const {
577 return _required_monitors;
580 boost::optional<boost::filesystem::path> player_lock_file () const {
581 return _player_lock_file;
587 void set_master_encoding_threads (int n) {
588 maybe_set (_master_encoding_threads, n);
591 void set_server_encoding_threads (int n) {
592 maybe_set (_server_encoding_threads, n);
595 void set_default_directory (boost::filesystem::path d) {
596 if (_default_directory && *_default_directory == d) {
599 _default_directory = d;
603 /** @param p New server port */
604 void set_server_port_base (int p) {
605 maybe_set (_server_port_base, p);
608 void set_only_servers_encode (bool o) {
609 maybe_set (_only_servers_encode, o);
612 void set_tms_protocol (FileTransferProtocol p) {
613 maybe_set (_tms_protocol, p);
616 /** @param i IP address of a TMS that we can copy DCPs to */
617 void set_tms_ip (std::string i) {
618 maybe_set (_tms_ip, i);
621 /** @param p Path on a TMS that we should changed DCPs to */
622 void set_tms_path (std::string p) {
623 maybe_set (_tms_path, p);
626 /** @param u User name to log into the TMS with */
627 void set_tms_user (std::string u) {
628 maybe_set (_tms_user, u);
631 /** @param p Password to log into the TMS with */
632 void set_tms_password (std::string p) {
633 maybe_set (_tms_password, p);
636 void add_cinema (boost::shared_ptr<Cinema> c) {
637 _cinemas.push_back (c);
641 void remove_cinema (boost::shared_ptr<Cinema> c) {
646 void add_dkdm_recipient (boost::shared_ptr<DKDMRecipient> c) {
647 _dkdm_recipients.push_back (c);
648 changed (DKDM_RECIPIENTS);
651 void remove_dkdm_recipient (boost::shared_ptr<DKDMRecipient> c) {
652 _dkdm_recipients.remove (c);
653 changed (DKDM_RECIPIENTS);
656 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
657 maybe_set (_allowed_dcp_frame_rates, r);
660 void set_allow_any_dcp_frame_rate (bool a) {
661 maybe_set (_allow_any_dcp_frame_rate, a);
664 void set_allow_any_container (bool a) {
665 maybe_set (_allow_any_container, a);
668 void set_show_experimental_audio_processors (bool e) {
669 maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
672 void set_default_isdcf_metadata (ISDCFMetadata d) {
673 maybe_set (_default_isdcf_metadata, d);
676 void set_language (std::string l) {
677 if (_language && _language.get() == l) {
684 void unset_language () {
689 _language = boost::none;
693 void set_default_still_length (int s) {
694 maybe_set (_default_still_length, s);
697 void set_default_container (Ratio const * c) {
698 maybe_set (_default_container, c);
701 void set_default_dcp_content_type (DCPContentType const * t) {
702 maybe_set (_default_dcp_content_type, t);
705 void set_default_dcp_audio_channels (int c) {
706 maybe_set (_default_dcp_audio_channels, c);
709 void set_dcp_issuer (std::string i) {
710 maybe_set (_dcp_issuer, i);
713 void set_dcp_creator (std::string c) {
714 maybe_set (_dcp_creator, c);
717 void set_dcp_company_name (std::string c) {
718 maybe_set (_dcp_company_name, c);
721 void set_dcp_product_name (std::string c) {
722 maybe_set (_dcp_product_name, c);
725 void set_dcp_product_version (std::string c) {
726 maybe_set (_dcp_product_version, c);
729 void set_dcp_j2k_comment (std::string c) {
730 maybe_set (_dcp_j2k_comment, c);
733 void set_default_j2k_bandwidth (int b) {
734 maybe_set (_default_j2k_bandwidth, b);
737 void set_default_audio_delay (int d) {
738 maybe_set (_default_audio_delay, d);
741 void set_default_interop (bool i) {
742 maybe_set (_default_interop, i);
745 void set_upload_after_make_dcp (bool u) {
746 maybe_set (_upload_after_make_dcp, u);
749 void set_mail_server (std::string s) {
750 maybe_set (_mail_server, s);
753 void set_mail_port (int p) {
754 maybe_set (_mail_port, p);
757 void set_mail_protocol (EmailProtocol p) {
758 maybe_set (_mail_protocol, p);
761 void set_mail_user (std::string u) {
762 maybe_set (_mail_user, u);
765 void set_mail_password (std::string p) {
766 maybe_set (_mail_password, p);
769 void set_kdm_subject (std::string s) {
770 maybe_set (_kdm_subject, s);
773 void set_kdm_from (std::string f) {
774 maybe_set (_kdm_from, f);
777 void set_kdm_cc (std::vector<std::string> f) {
778 maybe_set (_kdm_cc, f);
781 void set_kdm_bcc (std::string f) {
782 maybe_set (_kdm_bcc, f);
785 void set_kdm_email (std::string e) {
786 maybe_set (_kdm_email, e);
789 void reset_kdm_email ();
791 void set_notification_subject (std::string s) {
792 maybe_set (_notification_subject, s);
795 void set_notification_from (std::string f) {
796 maybe_set (_notification_from, f);
799 void set_notification_to (std::string t) {
800 maybe_set (_notification_to, t);
803 void set_notification_cc (std::vector<std::string> f) {
804 maybe_set (_notification_cc, f);
807 void set_notification_bcc (std::string f) {
808 maybe_set (_notification_bcc, f);
811 void set_notification_email (std::string e) {
812 maybe_set (_notification_email, e);
815 void reset_notification_email ();
817 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
818 maybe_set (_signer_chain, s);
821 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
822 maybe_set (_decryption_chain, c);
825 void set_check_for_updates (bool c) {
826 maybe_set (_check_for_updates, c);
828 set_check_for_test_updates (false);
832 void set_check_for_test_updates (bool c) {
833 maybe_set (_check_for_test_updates, c);
836 void set_maximum_j2k_bandwidth (int b) {
837 maybe_set (_maximum_j2k_bandwidth, b);
840 void set_log_types (int t) {
841 maybe_set (_log_types, t);
844 void set_analyse_ebur128 (bool a) {
845 maybe_set (_analyse_ebur128, a);
848 void set_automatic_audio_analysis (bool a) {
849 maybe_set (_automatic_audio_analysis, a);
852 #ifdef DCPOMATIC_WINDOWS
853 void set_win32_console (bool c) {
854 maybe_set (_win32_console, c);
858 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
863 void set_cinemas_file (boost::filesystem::path file);
865 void set_dkdm_recipients_file (boost::filesystem::path file);
867 void set_show_hints_before_make_dcp (bool s) {
868 maybe_set (_show_hints_before_make_dcp, s);
871 void set_confirm_kdm_email (bool s) {
872 maybe_set (_confirm_kdm_email, s);
875 void set_sound (bool s) {
876 maybe_set (_sound, s, SOUND);
879 void set_sound_output (std::string o) {
880 maybe_set (_sound_output, o, SOUND_OUTPUT);
883 void set_last_player_load_directory (boost::filesystem::path d) {
884 maybe_set (_last_player_load_directory, d);
887 void set_last_kdm_write_type (KDMWriteType t) {
888 maybe_set (_last_kdm_write_type, t);
891 void set_last_dkdm_write_type (DKDMWriteType t) {
892 maybe_set (_last_dkdm_write_type, t);
895 void unset_sound_output () {
896 if (!_sound_output) {
900 _sound_output = boost::none;
904 void set_kdm_container_name_format (dcp::NameFormat n) {
905 maybe_set (_kdm_container_name_format, n);
908 void set_kdm_filename_format (dcp::NameFormat n) {
909 maybe_set (_kdm_filename_format, n);
912 void set_dkdm_filename_format (dcp::NameFormat n) {
913 maybe_set (_dkdm_filename_format, n);
916 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
917 maybe_set (_dcp_metadata_filename_format, n);
920 void set_dcp_asset_filename_format (dcp::NameFormat n) {
921 maybe_set (_dcp_asset_filename_format, n);
924 void set_frames_in_memory_multiplier (int m) {
925 maybe_set (_frames_in_memory_multiplier, m);
928 void set_decode_reduction (boost::optional<int> r) {
929 maybe_set (_decode_reduction, r);
932 void set_default_notify (bool n) {
933 maybe_set (_default_notify, n);
936 void clear_history () {
941 void clear_player_history () {
942 _player_history.clear ();
946 void add_to_history (boost::filesystem::path p);
947 void clean_history ();
948 void add_to_player_history (boost::filesystem::path p);
949 void clean_player_history ();
951 void set_jump_to_selected (bool j) {
952 maybe_set (_jump_to_selected, j);
955 void set_nagged (Nag nag, bool nagged) {
956 maybe_set (_nagged[nag], nagged);
959 void set_cover_sheet (std::string s) {
960 maybe_set (_cover_sheet, s);
963 void reset_cover_sheet ();
965 void set_notification (Notification n, bool v) {
966 maybe_set (_notification[n], v);
969 void set_barco_username (std::string u) {
970 maybe_set (_barco_username, u);
973 void unset_barco_username () {
974 maybe_set (_barco_username, boost::optional<std::string>());
977 void set_barco_password (std::string p) {
978 maybe_set (_barco_password, p);
981 void unset_barco_password () {
982 maybe_set (_barco_password, boost::optional<std::string>());
985 void set_christie_username (std::string u) {
986 maybe_set (_christie_username, u);
989 void unset_christie_username () {
990 maybe_set (_christie_username, boost::optional<std::string>());
993 void set_christie_password (std::string p) {
994 maybe_set (_christie_password, p);
997 void unset_christie_password () {
998 maybe_set (_christie_password, boost::optional<std::string>());
1001 void set_gdc_username (std::string u) {
1002 maybe_set (_gdc_username, u);
1005 void unset_gdc_username () {
1006 maybe_set (_gdc_username, boost::optional<std::string>());
1009 void set_gdc_password (std::string p) {
1010 maybe_set (_gdc_password, p);
1013 void unset_gdc_password () {
1014 maybe_set (_gdc_password, boost::optional<std::string>());
1017 void set_interface_complexity (Interface i) {
1018 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
1021 void set_player_mode (PlayerMode m) {
1022 maybe_set (_player_mode, m);
1025 void set_image_display (int n) {
1026 maybe_set (_image_display, n);
1029 void set_video_view_type (VideoViewType v) {
1030 maybe_set (_video_view_type, v);
1033 void set_respect_kdm_validity_periods (bool r) {
1034 maybe_set (_respect_kdm_validity_periods, r);
1037 void set_player_activity_log_file (boost::filesystem::path p) {
1038 maybe_set (_player_activity_log_file, p);
1041 void unset_player_activity_log_file () {
1042 if (!_player_activity_log_file) {
1045 _player_activity_log_file = boost::none;
1049 void set_player_debug_log_file (boost::filesystem::path p) {
1050 maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
1053 void unset_player_debug_log_file () {
1054 if (!_player_debug_log_file) {
1057 _player_debug_log_file = boost::none;
1058 changed (PLAYER_DEBUG_LOG);
1061 void set_player_content_directory (boost::filesystem::path p) {
1062 maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
1065 void unset_player_content_directory () {
1066 if (!_player_content_directory) {
1069 _player_content_directory = boost::none;
1070 changed (PLAYER_CONTENT_DIRECTORY);
1073 void set_player_playlist_directory (boost::filesystem::path p) {
1074 maybe_set (_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
1077 void unset_player_playlist_directory () {
1078 if (!_player_playlist_directory) {
1081 _player_playlist_directory = boost::none;
1082 changed (PLAYER_PLAYLIST_DIRECTORY);
1085 void set_player_kdm_directory (boost::filesystem::path p) {
1086 maybe_set (_player_kdm_directory, p);
1089 void unset_player_kdm_directory () {
1090 if (!_player_kdm_directory) {
1093 _player_kdm_directory = boost::none;
1097 void set_audio_mapping (AudioMapping m);
1098 void set_audio_mapping_to_default ();
1100 #ifdef DCPOMATIC_VARIANT_SWAROOP
1101 void set_player_background_image (boost::filesystem::path p) {
1102 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
1105 void unset_player_background_image () {
1106 if (!_player_background_image) {
1109 _player_background_image = boost::none;
1110 changed (PLAYER_BACKGROUND_IMAGE);
1113 void set_kdm_server_url (std::string s) {
1114 maybe_set (_kdm_server_url, s);
1117 void set_player_watermark_theatre (std::string p) {
1118 maybe_set (_player_watermark_theatre, p);
1121 void set_player_watermark_period (int minutes) {
1122 maybe_set (_player_watermark_period, minutes);
1125 void set_player_watermark_duration (int milliseconds) {
1126 maybe_set (_player_watermark_duration, milliseconds);
1129 void set_required_monitors (std::vector<Monitor> monitors) {
1130 maybe_set (_required_monitors, monitors);
1133 void set_player_lock_file (boost::filesystem::path p) {
1134 maybe_set (_player_lock_file, p);
1137 void unset_player_lock_file () {
1138 if (!_player_lock_file) {
1141 _player_lock_file = boost::none;
1146 void changed (Property p = OTHER);
1147 boost::signals2::signal<void (Property)> Changed;
1148 /** Emitted if read() failed on an existing Config file. There is nothing
1149 a listener can do about it: this is just for information.
1151 static boost::signals2::signal<void ()> FailedToLoad;
1152 /** Emitted if read() issued a warning which the user might want to know about */
1153 static boost::signals2::signal<void (std::string)> Warning;
1154 /** Emitted if there is a something wrong the contents of our config. Handler can call
1155 * true to ask Config to solve the problem (by discarding and recreating the bad thing)
1158 BAD_SIGNER_UTF8_STRINGS, ///< signer chain contains UTF-8 strings (not PRINTABLESTRING)
1159 BAD_SIGNER_INCONSISTENT, ///< signer chain is somehow inconsistent
1160 BAD_DECRYPTION_INCONSISTENT, ///< KDM decryption chain is somehow inconsistent
1163 static boost::signals2::signal<bool (BadReason)> Bad;
1165 void write () const;
1166 void write_config () const;
1167 void write_cinemas () const;
1168 void write_dkdm_recipients () const;
1169 void link (boost::filesystem::path new_file) const;
1170 void copy_and_link (boost::filesystem::path new_file) const;
1171 bool have_write_permission () const;
1173 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1174 bool existing_template (std::string name) const;
1175 std::list<std::string> templates () const;
1176 boost::filesystem::path template_path (std::string name) const;
1177 void rename_template (std::string old_name, std::string new_name) const;
1178 void delete_template (std::string name) const;
1180 static Config* instance ();
1181 static void drop ();
1182 static void restore_defaults ();
1183 static bool have_existing (std::string);
1184 static boost::filesystem::path config_file ();
1189 void set_defaults ();
1190 void set_kdm_email_to_default ();
1191 void set_notification_email_to_default ();
1192 void set_cover_sheet_to_default ();
1193 void read_cinemas (cxml::Document const & f);
1194 void read_dkdm_recipients (cxml::Document const & f);
1195 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1196 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1197 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1198 void clean_history_internal (std::vector<boost::filesystem::path>& h);
1202 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1203 if (member == new_value) {
1211 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1212 if (member && member.get() == new_value) {
1219 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1220 int _master_encoding_threads;
1221 /** number of threads which a server should use for J2K encoding on the local machine */
1222 int _server_encoding_threads;
1223 /** default directory to put new films in */
1224 boost::optional<boost::filesystem::path> _default_directory;
1225 /** base port number to use for J2K encoding servers;
1226 * this port and the two above it will be used.
1228 int _server_port_base;
1229 /** true to broadcast on the `any' address to look for servers */
1230 bool _use_any_servers;
1231 /** J2K encoding servers that should definitely be used */
1232 std::vector<std::string> _servers;
1233 bool _only_servers_encode;
1234 FileTransferProtocol _tms_protocol;
1235 /** The IP address of a TMS that we can copy DCPs to */
1236 std::string _tms_ip;
1237 /** The path on a TMS that we should write DCPs to */
1238 std::string _tms_path;
1239 /** User name to log into the TMS with */
1240 std::string _tms_user;
1241 /** Password to log into the TMS with */
1242 std::string _tms_password;
1243 /** The list of possible DCP frame rates that DCP-o-matic will use */
1244 std::list<int> _allowed_dcp_frame_rates;
1245 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1246 bool _allow_any_dcp_frame_rate;
1247 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1248 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1249 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1251 bool _allow_any_container;
1252 /** Offer the upmixers in the audio processor settings */
1253 bool _show_experimental_audio_processors;
1254 /** Default ISDCF metadata for newly-created Films */
1255 ISDCFMetadata _default_isdcf_metadata;
1256 boost::optional<std::string> _language;
1257 /** Default length of still image content (seconds) */
1258 int _default_still_length;
1259 Ratio const * _default_container;
1260 DCPContentType const * _default_dcp_content_type;
1261 int _default_dcp_audio_channels;
1262 std::string _dcp_issuer;
1263 std::string _dcp_creator;
1264 std::string _dcp_company_name;
1265 std::string _dcp_product_name;
1266 std::string _dcp_product_version;
1267 std::string _dcp_j2k_comment;
1268 int _default_j2k_bandwidth;
1269 int _default_audio_delay;
1270 bool _default_interop;
1271 /** Default directory to offer to write KDMs to; if it's not set,
1272 the home directory will be offered.
1274 boost::optional<boost::filesystem::path> _default_kdm_directory;
1275 bool _upload_after_make_dcp;
1276 std::list<boost::shared_ptr<Cinema> > _cinemas;
1277 std::list<boost::shared_ptr<DKDMRecipient> > _dkdm_recipients;
1278 std::string _mail_server;
1280 EmailProtocol _mail_protocol;
1281 std::string _mail_user;
1282 std::string _mail_password;
1283 std::string _kdm_subject;
1284 std::string _kdm_from;
1285 std::vector<std::string> _kdm_cc;
1286 std::string _kdm_bcc;
1287 std::string _kdm_email;
1288 std::string _notification_subject;
1289 std::string _notification_from;
1290 std::string _notification_to;
1291 std::vector<std::string> _notification_cc;
1292 std::string _notification_bcc;
1293 std::string _notification_email;
1294 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1295 #ifdef DCPOMATIC_VARIANT_SWAROOP
1296 boost::filesystem::path _signer_chain_path;
1298 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1299 * certificate for making KDMs given to DCP-o-matic.
1301 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1302 #ifdef DCPOMATIC_VARIANT_SWAROOP
1303 boost::filesystem::path _decryption_chain_path;
1305 /** true to check for updates on startup */
1306 bool _check_for_updates;
1307 bool _check_for_test_updates;
1308 /** maximum allowed J2K bandwidth in bits per second */
1309 int _maximum_j2k_bandwidth;
1311 bool _analyse_ebur128;
1312 bool _automatic_audio_analysis;
1313 #ifdef DCPOMATIC_WINDOWS
1314 bool _win32_console;
1316 std::vector<boost::filesystem::path> _history;
1317 std::vector<boost::filesystem::path> _player_history;
1318 boost::shared_ptr<DKDMGroup> _dkdms;
1319 boost::filesystem::path _cinemas_file;
1320 boost::filesystem::path _dkdm_recipients_file;
1321 bool _show_hints_before_make_dcp;
1322 bool _confirm_kdm_email;
1323 dcp::NameFormat _kdm_filename_format;
1324 dcp::NameFormat _dkdm_filename_format;
1325 dcp::NameFormat _kdm_container_name_format;
1326 dcp::NameFormat _dcp_metadata_filename_format;
1327 dcp::NameFormat _dcp_asset_filename_format;
1328 bool _jump_to_selected;
1329 bool _nagged[NAG_COUNT];
1331 /** name of a specific sound output stream to use, or empty to use the default */
1332 boost::optional<std::string> _sound_output;
1333 std::string _cover_sheet;
1334 boost::optional<boost::filesystem::path> _last_player_load_directory;
1335 boost::optional<KDMWriteType> _last_kdm_write_type;
1336 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1337 int _frames_in_memory_multiplier;
1338 boost::optional<int> _decode_reduction;
1339 bool _default_notify;
1340 bool _notification[NOTIFICATION_COUNT];
1341 boost::optional<std::string> _barco_username;
1342 boost::optional<std::string> _barco_password;
1343 boost::optional<std::string> _christie_username;
1344 boost::optional<std::string> _christie_password;
1345 boost::optional<std::string> _gdc_username;
1346 boost::optional<std::string> _gdc_password;
1347 Interface _interface_complexity;
1348 PlayerMode _player_mode;
1350 VideoViewType _video_view_type;
1351 bool _respect_kdm_validity_periods;
1352 /** Log file containing things the player does (e.g. started, stopped, loaded
1353 playlist etc.) Does not contain debugging information.
1355 boost::optional<boost::filesystem::path> _player_activity_log_file;
1356 /** Log file containing debug information for the player */
1357 boost::optional<boost::filesystem::path> _player_debug_log_file;
1358 /** A directory containing DCPs whose contents are presented to the user
1359 in the dual-screen player mode. DCPs on the list can be loaded
1362 boost::optional<boost::filesystem::path> _player_content_directory;
1363 boost::optional<boost::filesystem::path> _player_playlist_directory;
1364 boost::optional<boost::filesystem::path> _player_kdm_directory;
1365 boost::optional<AudioMapping> _audio_mapping;
1366 #ifdef DCPOMATIC_VARIANT_SWAROOP
1367 boost::optional<boost::filesystem::path> _player_background_image;
1368 std::string _kdm_server_url;
1369 std::string _player_watermark_theatre;
1370 /** watermark period in minutes */
1371 int _player_watermark_period;
1372 /** watermark duration in milliseconds */
1373 int _player_watermark_duration;
1374 std::vector<Monitor> _required_monitors;
1375 /** a file which, if specified, must be present for the player to work */
1376 boost::optional<boost::filesystem::path> _player_lock_file;
1379 static int const _current_version;
1381 /** Singleton instance, or 0 */
1382 static Config* _instance;