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"
30 #include <dcp/name_format.h>
31 #include <dcp/certificate_chain.h>
32 #include <dcp/encrypted_kdm.h>
33 #include <boost/shared_ptr.hpp>
34 #include <boost/signals2.hpp>
35 #include <boost/filesystem.hpp>
38 class CinemaSoundProcessor;
46 * @brief A singleton class holding configuration.
48 class Config : public boost::noncopyable
51 /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
52 int master_encoding_threads () const {
53 return _master_encoding_threads;
56 /** @return number of threads which a server should use for J2K encoding on the local machine */
57 int server_encoding_threads () const {
58 return _server_encoding_threads;
61 boost::optional<boost::filesystem::path> default_directory () const {
62 return _default_directory;
65 boost::optional<boost::filesystem::path> default_kdm_directory () const {
66 return _default_kdm_directory;
69 boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
70 boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
80 #ifdef DCPOMATIC_VARIANT_SWAROOP
81 PLAYER_BACKGROUND_IMAGE,
87 /** @return base port number to use for J2K encoding servers */
88 int server_port_base () const {
89 return _server_port_base;
92 void set_use_any_servers (bool u) {
94 changed (USE_ANY_SERVERS);
97 bool use_any_servers () const {
98 return _use_any_servers;
101 /** @param s New list of servers */
102 void set_servers (std::vector<std::string> s) {
107 /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
108 std::vector<std::string> servers () const {
112 bool only_servers_encode () const {
113 return _only_servers_encode;
116 Protocol tms_protocol () const {
117 return _tms_protocol;
120 /** @return The IP address of a TMS that we can copy DCPs to */
121 std::string tms_ip () const {
125 /** @return The path on a TMS that we should changed DCPs to */
126 std::string tms_path () const {
130 /** @return User name to log into the TMS with */
131 std::string tms_user () const {
135 /** @return Password to log into the TMS with */
136 std::string tms_password () const {
137 return _tms_password;
140 /** @return The cinema sound processor that we are using */
141 CinemaSoundProcessor const * cinema_sound_processor () const {
142 return _cinema_sound_processor;
145 std::list<boost::shared_ptr<Cinema> > cinemas () const {
149 std::list<int> allowed_dcp_frame_rates () const {
150 return _allowed_dcp_frame_rates;
153 bool allow_any_dcp_frame_rate () const {
154 return _allow_any_dcp_frame_rate;
157 bool allow_any_container () const {
158 return _allow_any_container;
161 ISDCFMetadata default_isdcf_metadata () const {
162 return _default_isdcf_metadata;
165 boost::optional<std::string> language () const {
169 int default_still_length () const {
170 return _default_still_length;
173 Ratio const * default_container () const {
174 return _default_container;
177 Ratio const * default_scale_to () const {
178 return _default_scale_to;
181 DCPContentType const * default_dcp_content_type () const {
182 return _default_dcp_content_type;
185 int default_dcp_audio_channels () const {
186 return _default_dcp_audio_channels;
189 std::string dcp_issuer () const {
193 std::string dcp_creator () const {
197 int default_j2k_bandwidth () const {
198 return _default_j2k_bandwidth;
201 int default_audio_delay () const {
202 return _default_audio_delay;
205 bool default_interop () const {
206 return _default_interop;
209 bool default_upload_after_make_dcp () {
210 return _default_upload_after_make_dcp;
213 void set_default_kdm_directory (boost::filesystem::path d) {
214 if (_default_kdm_directory && _default_kdm_directory.get() == d) {
217 _default_kdm_directory = d;
221 std::string mail_server () const {
225 int mail_port () const {
229 std::string mail_user () const {
233 std::string mail_password () const {
234 return _mail_password;
237 std::string kdm_subject () const {
241 std::string kdm_from () const {
245 std::vector<std::string> kdm_cc () const {
249 std::string kdm_bcc () const {
253 std::string kdm_email () const {
257 std::string notification_subject () const {
258 return _notification_subject;
261 std::string notification_from () const {
262 return _notification_from;
265 std::string notification_to () const {
266 return _notification_to;
269 std::vector<std::string> notification_cc () const {
270 return _notification_cc;
273 std::string notification_bcc () const {
274 return _notification_bcc;
277 std::string notification_email () const {
278 return _notification_email;
281 boost::shared_ptr<const dcp::CertificateChain> signer_chain () const {
282 return _signer_chain;
285 boost::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
286 return _decryption_chain;
289 bool check_for_updates () const {
290 return _check_for_updates;
293 bool check_for_test_updates () const {
294 return _check_for_test_updates;
297 int maximum_j2k_bandwidth () const {
298 return _maximum_j2k_bandwidth;
301 int log_types () const {
305 bool analyse_ebur128 () const {
306 return _analyse_ebur128;
309 bool automatic_audio_analysis () const {
310 return _automatic_audio_analysis;
313 #ifdef DCPOMATIC_WINDOWS
314 bool win32_console () const {
315 return _win32_console;
319 std::vector<boost::filesystem::path> history () const {
323 std::vector<boost::filesystem::path> player_history () const {
324 return _player_history;
327 boost::shared_ptr<DKDMGroup> dkdms () const {
331 boost::filesystem::path cinemas_file () const {
332 return _cinemas_file;
335 bool show_hints_before_make_dcp () const {
336 return _show_hints_before_make_dcp;
339 bool confirm_kdm_email () const {
340 return _confirm_kdm_email;
343 dcp::NameFormat kdm_container_name_format () const {
344 return _kdm_container_name_format;
347 dcp::NameFormat kdm_filename_format () const {
348 return _kdm_filename_format;
351 dcp::NameFormat dcp_metadata_filename_format () const {
352 return _dcp_metadata_filename_format;
355 dcp::NameFormat dcp_asset_filename_format () const {
356 return _dcp_asset_filename_format;
359 bool jump_to_selected () const {
360 return _jump_to_selected;
365 NAG_ENCRYPTED_METADATA,
366 NAG_REMAKE_DECRYPTION_CHAIN,
367 NAG_BAD_SIGNER_CHAIN,
368 /* Not really a nag but it's the same idea */
373 bool nagged (Nag nag) const {
377 bool sound () const {
381 std::string cover_sheet () const {
385 boost::optional<std::string> sound_output () const {
386 return _sound_output;
389 boost::optional<boost::filesystem::path> last_player_load_directory () const {
390 return _last_player_load_directory;
399 boost::optional<KDMWriteType> last_kdm_write_type () const {
400 return _last_kdm_write_type;
408 boost::optional<DKDMWriteType> last_dkdm_write_type () const {
409 return _last_dkdm_write_type;
412 int frames_in_memory_multiplier () const {
413 return _frames_in_memory_multiplier;
416 boost::optional<int> decode_reduction () const {
417 return _decode_reduction;
420 bool default_notify () const {
421 return _default_notify;
430 bool notification (Notification n) const {
431 return _notification[n];
434 boost::optional<std::string> barco_username () const {
435 return _barco_username;
438 boost::optional<std::string> barco_password () const {
439 return _barco_password;
442 boost::optional<std::string> christie_username () const {
443 return _christie_username;
446 boost::optional<std::string> christie_password () const {
447 return _christie_password;
450 boost::optional<std::string> gdc_username () const {
451 return _gdc_username;
454 boost::optional<std::string> gdc_password () const {
455 return _gdc_password;
463 Interface interface_complexity () const {
464 return _interface_complexity;
473 PlayerMode player_mode () const {
477 int image_display () const {
478 return _image_display;
481 bool respect_kdm_validity_periods () const {
482 return _respect_kdm_validity_periods;
485 boost::optional<boost::filesystem::path> player_log_file () const {
486 return _player_log_file;
489 boost::optional<boost::filesystem::path> player_dcp_directory () const {
490 return _player_dcp_directory;
493 boost::optional<boost::filesystem::path> player_kdm_directory () const {
494 return _player_kdm_directory;
497 #ifdef DCPOMATIC_VARIANT_SWAROOP
498 boost::optional<boost::filesystem::path> player_background_image () const {
499 return _player_background_image;
502 std::string kdm_server_url () const {
503 return _kdm_server_url;
506 boost::optional<boost::filesystem::path> player_watermark () const {
507 return _player_watermark;
513 void set_master_encoding_threads (int n) {
514 maybe_set (_master_encoding_threads, n);
517 void set_server_encoding_threads (int n) {
518 maybe_set (_server_encoding_threads, n);
521 void set_default_directory (boost::filesystem::path d) {
522 if (_default_directory && *_default_directory == d) {
525 _default_directory = d;
529 /** @param p New server port */
530 void set_server_port_base (int p) {
531 maybe_set (_server_port_base, p);
534 void set_only_servers_encode (bool o) {
535 maybe_set (_only_servers_encode, o);
538 void set_tms_protocol (Protocol p) {
539 maybe_set (_tms_protocol, p);
542 /** @param i IP address of a TMS that we can copy DCPs to */
543 void set_tms_ip (std::string i) {
544 maybe_set (_tms_ip, i);
547 /** @param p Path on a TMS that we should changed DCPs to */
548 void set_tms_path (std::string p) {
549 maybe_set (_tms_path, p);
552 /** @param u User name to log into the TMS with */
553 void set_tms_user (std::string u) {
554 maybe_set (_tms_user, u);
557 /** @param p Password to log into the TMS with */
558 void set_tms_password (std::string p) {
559 maybe_set (_tms_password, p);
562 void add_cinema (boost::shared_ptr<Cinema> c) {
563 _cinemas.push_back (c);
567 void remove_cinema (boost::shared_ptr<Cinema> c) {
572 void set_allowed_dcp_frame_rates (std::list<int> const & r) {
573 maybe_set (_allowed_dcp_frame_rates, r);
576 void set_allow_any_dcp_frame_rate (bool a) {
577 maybe_set (_allow_any_dcp_frame_rate, a);
580 void set_allow_any_container (bool a) {
581 maybe_set (_allow_any_container, a);
584 void set_default_isdcf_metadata (ISDCFMetadata d) {
585 maybe_set (_default_isdcf_metadata, d);
588 void set_language (std::string l) {
589 if (_language && _language.get() == l) {
596 void unset_language () {
601 _language = boost::none;
605 void set_default_still_length (int s) {
606 maybe_set (_default_still_length, s);
609 void set_default_container (Ratio const * c) {
610 maybe_set (_default_container, c);
613 void set_default_scale_to (Ratio const * c) {
614 maybe_set (_default_scale_to, c);
617 void set_default_dcp_content_type (DCPContentType const * t) {
618 maybe_set (_default_dcp_content_type, t);
621 void set_default_dcp_audio_channels (int c) {
622 maybe_set (_default_dcp_audio_channels, c);
625 void set_dcp_issuer (std::string i) {
626 maybe_set (_dcp_issuer, i);
629 void set_dcp_creator (std::string c) {
630 maybe_set (_dcp_creator, c);
633 void set_default_j2k_bandwidth (int b) {
634 maybe_set (_default_j2k_bandwidth, b);
637 void set_default_audio_delay (int d) {
638 maybe_set (_default_audio_delay, d);
641 void set_default_interop (bool i) {
642 maybe_set (_default_interop, i);
645 void set_default_upload_after_make_dcp (bool u) {
646 maybe_set (_default_upload_after_make_dcp, u);
649 void set_mail_server (std::string s) {
650 maybe_set (_mail_server, s);
653 void set_mail_port (int p) {
654 maybe_set (_mail_port, p);
657 void set_mail_user (std::string u) {
658 maybe_set (_mail_user, u);
661 void set_mail_password (std::string p) {
662 maybe_set (_mail_password, p);
665 void set_kdm_subject (std::string s) {
666 maybe_set (_kdm_subject, s);
669 void set_kdm_from (std::string f) {
670 maybe_set (_kdm_from, f);
673 void set_kdm_cc (std::vector<std::string> f) {
674 maybe_set (_kdm_cc, f);
677 void set_kdm_bcc (std::string f) {
678 maybe_set (_kdm_bcc, f);
681 void set_kdm_email (std::string e) {
682 maybe_set (_kdm_email, e);
685 void reset_kdm_email ();
687 void set_notification_subject (std::string s) {
688 maybe_set (_notification_subject, s);
691 void set_notification_from (std::string f) {
692 maybe_set (_notification_from, f);
695 void set_notification_to (std::string t) {
696 maybe_set (_notification_to, t);
699 void set_notification_cc (std::vector<std::string> f) {
700 maybe_set (_notification_cc, f);
703 void set_notification_bcc (std::string f) {
704 maybe_set (_notification_bcc, f);
707 void set_notification_email (std::string e) {
708 maybe_set (_notification_email, e);
711 void reset_notification_email ();
713 void set_signer_chain (boost::shared_ptr<const dcp::CertificateChain> s) {
714 maybe_set (_signer_chain, s);
717 void set_decryption_chain (boost::shared_ptr<const dcp::CertificateChain> c) {
718 maybe_set (_decryption_chain, c);
721 void set_check_for_updates (bool c) {
722 maybe_set (_check_for_updates, c);
724 set_check_for_test_updates (false);
728 void set_check_for_test_updates (bool c) {
729 maybe_set (_check_for_test_updates, c);
732 void set_maximum_j2k_bandwidth (int b) {
733 maybe_set (_maximum_j2k_bandwidth, b);
736 void set_log_types (int t) {
737 maybe_set (_log_types, t);
740 void set_analyse_ebur128 (bool a) {
741 maybe_set (_analyse_ebur128, a);
744 void set_automatic_audio_analysis (bool a) {
745 maybe_set (_automatic_audio_analysis, a);
748 #ifdef DCPOMATIC_WINDOWS
749 void set_win32_console (bool c) {
750 maybe_set (_win32_console, c);
754 void set_dkdms (boost::shared_ptr<DKDMGroup> dkdms) {
759 void set_cinemas_file (boost::filesystem::path file);
761 void set_show_hints_before_make_dcp (bool s) {
762 maybe_set (_show_hints_before_make_dcp, s);
765 void set_confirm_kdm_email (bool s) {
766 maybe_set (_confirm_kdm_email, s);
769 void set_sound (bool s) {
770 maybe_set (_sound, s, SOUND);
773 void set_sound_output (std::string o) {
774 maybe_set (_sound_output, o, SOUND_OUTPUT);
777 void set_last_player_load_directory (boost::filesystem::path d) {
778 maybe_set (_last_player_load_directory, d);
781 void set_last_kdm_write_type (KDMWriteType t) {
782 maybe_set (_last_kdm_write_type, t);
785 void set_last_dkdm_write_type (DKDMWriteType t) {
786 maybe_set (_last_dkdm_write_type, t);
789 void unset_sound_output () {
790 if (!_sound_output) {
794 _sound_output = boost::none;
798 void set_kdm_container_name_format (dcp::NameFormat n) {
799 maybe_set (_kdm_container_name_format, n);
802 void set_kdm_filename_format (dcp::NameFormat n) {
803 maybe_set (_kdm_filename_format, n);
806 void set_dcp_metadata_filename_format (dcp::NameFormat n) {
807 maybe_set (_dcp_metadata_filename_format, n);
810 void set_dcp_asset_filename_format (dcp::NameFormat n) {
811 maybe_set (_dcp_asset_filename_format, n);
814 void set_frames_in_memory_multiplier (int m) {
815 maybe_set (_frames_in_memory_multiplier, m);
818 void set_decode_reduction (boost::optional<int> r) {
819 maybe_set (_decode_reduction, r);
822 void set_default_notify (bool n) {
823 maybe_set (_default_notify, n);
826 void clear_history () {
831 void clear_player_history () {
832 _player_history.clear ();
836 void add_to_history (boost::filesystem::path p);
837 void add_to_player_history (boost::filesystem::path p);
839 void set_jump_to_selected (bool j) {
840 maybe_set (_jump_to_selected, j);
843 void set_nagged (Nag nag, bool nagged) {
844 maybe_set (_nagged[nag], nagged);
847 void set_cover_sheet (std::string s) {
848 maybe_set (_cover_sheet, s);
851 void reset_cover_sheet ();
853 void set_notification (Notification n, bool v) {
854 maybe_set (_notification[n], v);
857 void set_barco_username (std::string u) {
858 maybe_set (_barco_username, u);
861 void unset_barco_username () {
862 maybe_set (_barco_username, boost::optional<std::string>());
865 void set_barco_password (std::string p) {
866 maybe_set (_barco_password, p);
869 void unset_barco_password () {
870 maybe_set (_barco_password, boost::optional<std::string>());
873 void set_christie_username (std::string u) {
874 maybe_set (_christie_username, u);
877 void unset_christie_username () {
878 maybe_set (_christie_username, boost::optional<std::string>());
881 void set_christie_password (std::string p) {
882 maybe_set (_christie_password, p);
885 void unset_christie_password () {
886 maybe_set (_christie_password, boost::optional<std::string>());
889 void set_gdc_username (std::string u) {
890 maybe_set (_gdc_username, u);
893 void unset_gdc_username () {
894 maybe_set (_gdc_username, boost::optional<std::string>());
897 void set_gdc_password (std::string p) {
898 maybe_set (_gdc_password, p);
901 void unset_gdc_password () {
902 maybe_set (_gdc_password, boost::optional<std::string>());
905 void set_interface_complexity (Interface i) {
906 maybe_set (_interface_complexity, i, INTERFACE_COMPLEXITY);
909 void set_player_mode (PlayerMode m) {
910 maybe_set (_player_mode, m);
913 void set_image_display (int n) {
914 maybe_set (_image_display, n);
917 void set_respect_kdm_validity_periods (bool r) {
918 maybe_set (_respect_kdm_validity_periods, r);
921 void set_player_log_file (boost::filesystem::path p) {
922 maybe_set (_player_log_file, p);
925 void unset_player_log_file () {
926 if (!_player_log_file) {
929 _player_log_file = boost::none;
933 void set_player_dcp_directory (boost::filesystem::path p) {
934 maybe_set (_player_dcp_directory, p, PLAYER_DCP_DIRECTORY);
937 void unset_player_dcp_directory () {
938 if (!_player_dcp_directory) {
941 _player_dcp_directory = boost::none;
942 changed (PLAYER_DCP_DIRECTORY);
945 void set_player_kdm_directory (boost::filesystem::path p) {
946 maybe_set (_player_kdm_directory, p);
949 void unset_player_kdm_directory () {
950 if (!_player_kdm_directory) {
953 _player_kdm_directory = boost::none;
957 #ifdef DCPOMATIC_VARIANT_SWAROOP
958 void set_player_background_image (boost::filesystem::path p) {
959 maybe_set (_player_background_image, p, PLAYER_BACKGROUND_IMAGE);
962 void unset_player_background_image () {
963 if (!_player_background_image) {
966 _player_background_image = boost::none;
967 changed (PLAYER_BACKGROUND_IMAGE);
970 void set_kdm_server_url (std::string s) {
971 maybe_set (_kdm_server_url, s);
974 void set_player_watermark (boost::filesystem::path p) {
975 maybe_set (_player_watermark, p, PLAYER_WATERMARK);
978 void unset_player_watermark () {
979 if (!_player_watermark) {
982 _player_watermark = boost::none;
983 changed (PLAYER_WATERMARK);
987 void changed (Property p = OTHER);
988 boost::signals2::signal<void (Property)> Changed;
989 /** Emitted if read() failed on an existing Config file. There is nothing
990 a listener can do about it: this is just for information.
992 static boost::signals2::signal<void ()> FailedToLoad;
993 /** Emitted if read() issued a warning which the user might want to know about */
994 static boost::signals2::signal<void (std::string)> Warning;
995 /** Emitted if there is a bad certificate in the signer chain. Handler can call
996 * true to ask Config to re-create the chain.
998 static boost::signals2::signal<bool (void)> BadSignerChain;
1000 void write () const;
1001 void write_config () const;
1002 void write_cinemas () const;
1003 void link (boost::filesystem::path new_file) const;
1004 void copy_and_link (boost::filesystem::path new_file) const;
1005 bool have_write_permission () const;
1007 void save_template (boost::shared_ptr<const Film> film, std::string name) const;
1008 bool existing_template (std::string name) const;
1009 std::list<std::string> templates () const;
1010 boost::filesystem::path template_path (std::string name) const;
1011 void rename_template (std::string old_name, std::string new_name) const;
1012 void delete_template (std::string name) const;
1014 static Config* instance ();
1015 static void drop ();
1016 static void restore_defaults ();
1017 static bool have_existing (std::string);
1018 static boost::filesystem::path config_file ();
1020 /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
1021 static boost::optional<boost::filesystem::path> override_path;
1025 static boost::filesystem::path path (std::string file, bool create_directories = true);
1027 void set_defaults ();
1028 void set_kdm_email_to_default ();
1029 void set_notification_email_to_default ();
1030 void set_cover_sheet_to_default ();
1031 void read_cinemas (cxml::Document const & f);
1032 boost::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
1033 boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
1034 void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
1038 void maybe_set (T& member, T new_value, Property prop = OTHER) {
1039 if (member == new_value) {
1047 void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
1048 if (member && member.get() == new_value) {
1055 /** number of threads which a master DoM should use for J2K encoding on the local machine */
1056 int _master_encoding_threads;
1057 /** number of threads which a server should use for J2K encoding on the local machine */
1058 int _server_encoding_threads;
1059 /** default directory to put new films in */
1060 boost::optional<boost::filesystem::path> _default_directory;
1061 /** base port number to use for J2K encoding servers;
1062 * this port and the two above it will be used.
1064 int _server_port_base;
1065 /** true to broadcast on the `any' address to look for servers */
1066 bool _use_any_servers;
1067 /** J2K encoding servers that should definitely be used */
1068 std::vector<std::string> _servers;
1069 bool _only_servers_encode;
1070 Protocol _tms_protocol;
1071 /** The IP address of a TMS that we can copy DCPs to */
1072 std::string _tms_ip;
1073 /** The path on a TMS that we should write DCPs to */
1074 std::string _tms_path;
1075 /** User name to log into the TMS with */
1076 std::string _tms_user;
1077 /** Password to log into the TMS with */
1078 std::string _tms_password;
1079 /** Our cinema sound processor */
1080 CinemaSoundProcessor const * _cinema_sound_processor;
1081 std::list<int> _allowed_dcp_frame_rates;
1082 /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
1083 bool _allow_any_dcp_frame_rate;
1084 /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
1085 DCPs at 25fps but will play 16:9, so this is very useful for some users.
1086 https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
1088 bool _allow_any_container;
1089 /** Default ISDCF metadata for newly-created Films */
1090 ISDCFMetadata _default_isdcf_metadata;
1091 boost::optional<std::string> _language;
1092 /** Default length of still image content (seconds) */
1093 int _default_still_length;
1094 Ratio const * _default_container;
1095 Ratio const * _default_scale_to;
1096 DCPContentType const * _default_dcp_content_type;
1097 int _default_dcp_audio_channels;
1098 std::string _dcp_issuer;
1099 std::string _dcp_creator;
1100 int _default_j2k_bandwidth;
1101 int _default_audio_delay;
1102 bool _default_interop;
1103 /** Default directory to offer to write KDMs to; if it's not set,
1104 the home directory will be offered.
1106 boost::optional<boost::filesystem::path> _default_kdm_directory;
1107 bool _default_upload_after_make_dcp;
1108 std::list<boost::shared_ptr<Cinema> > _cinemas;
1109 std::string _mail_server;
1111 std::string _mail_user;
1112 std::string _mail_password;
1113 std::string _kdm_subject;
1114 std::string _kdm_from;
1115 std::vector<std::string> _kdm_cc;
1116 std::string _kdm_bcc;
1117 std::string _kdm_email;
1118 std::string _notification_subject;
1119 std::string _notification_from;
1120 std::string _notification_to;
1121 std::vector<std::string> _notification_cc;
1122 std::string _notification_bcc;
1123 std::string _notification_email;
1124 boost::shared_ptr<const dcp::CertificateChain> _signer_chain;
1125 /** Chain used to decrypt KDMs; the leaf of this chain is the target
1126 * certificate for making KDMs given to DCP-o-matic.
1128 boost::shared_ptr<const dcp::CertificateChain> _decryption_chain;
1129 /** true to check for updates on startup */
1130 bool _check_for_updates;
1131 bool _check_for_test_updates;
1132 /** maximum allowed J2K bandwidth in bits per second */
1133 int _maximum_j2k_bandwidth;
1135 bool _analyse_ebur128;
1136 bool _automatic_audio_analysis;
1137 #ifdef DCPOMATIC_WINDOWS
1138 bool _win32_console;
1140 std::vector<boost::filesystem::path> _history;
1141 std::vector<boost::filesystem::path> _player_history;
1142 boost::shared_ptr<DKDMGroup> _dkdms;
1143 boost::filesystem::path _cinemas_file;
1144 bool _show_hints_before_make_dcp;
1145 bool _confirm_kdm_email;
1146 dcp::NameFormat _kdm_filename_format;
1147 dcp::NameFormat _kdm_container_name_format;
1148 dcp::NameFormat _dcp_metadata_filename_format;
1149 dcp::NameFormat _dcp_asset_filename_format;
1150 bool _jump_to_selected;
1151 bool _nagged[NAG_COUNT];
1153 /** name of a specific sound output stream to use, or empty to use the default */
1154 boost::optional<std::string> _sound_output;
1155 std::string _cover_sheet;
1156 boost::optional<boost::filesystem::path> _last_player_load_directory;
1157 boost::optional<KDMWriteType> _last_kdm_write_type;
1158 boost::optional<DKDMWriteType> _last_dkdm_write_type;
1159 int _frames_in_memory_multiplier;
1160 boost::optional<int> _decode_reduction;
1161 bool _default_notify;
1162 bool _notification[NOTIFICATION_COUNT];
1163 boost::optional<std::string> _barco_username;
1164 boost::optional<std::string> _barco_password;
1165 boost::optional<std::string> _christie_username;
1166 boost::optional<std::string> _christie_password;
1167 boost::optional<std::string> _gdc_username;
1168 boost::optional<std::string> _gdc_password;
1169 Interface _interface_complexity;
1170 PlayerMode _player_mode;
1172 bool _respect_kdm_validity_periods;
1173 boost::optional<boost::filesystem::path> _player_log_file;
1174 /** A directory containing DCPs whose contents are presented to the user
1175 in the dual-screen player mode. DCPs on the list can be loaded
1178 boost::optional<boost::filesystem::path> _player_dcp_directory;
1179 boost::optional<boost::filesystem::path> _player_kdm_directory;
1180 #ifdef DCPOMATIC_VARIANT_SWAROOP
1181 boost::optional<boost::filesystem::path> _player_background_image;
1182 std::string _kdm_server_url;
1183 boost::optional<boost::filesystem::path> _player_watermark;
1186 static int const _current_version;
1188 /** Singleton instance, or 0 */
1189 static Config* _instance;