White space: config.{cc,h} player.{cc,h} about_dialog.{cc,h} hints_dialog.{cc,h}
authorCarl Hetherington <cth@carlh.net>
Sat, 1 Feb 2025 22:26:09 +0000 (23:26 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 2 Feb 2025 11:59:34 +0000 (12:59 +0100)
src/lib/config.cc
src/lib/config.h
src/lib/player.cc
src/lib/player.h
src/wx/about_dialog.cc
src/wx/about_dialog.h
src/wx/hints_dialog.cc
src/wx/hints_dialog.h

index fd5f689939a85d65dd3aa776a28e6db03aa7e4a8..4440aab4d744f17430aeaf879d4e6fcea293998e 100644 (file)
@@ -80,23 +80,23 @@ auto constexpr default_grok_licence_server = "https://grokcompression.com/api/re
 
 
 /** Construct default configuration */
-Config::Config ()
+Config::Config()
         /* DKDMs are not considered a thing to reset on set_defaults() */
-       : _dkdms (new DKDMGroup ("root"))
-       , _default_kdm_duration (1, RoughDuration::Unit::WEEKS)
+       : _dkdms(new DKDMGroup("root"))
+       , _default_kdm_duration(1, RoughDuration::Unit::WEEKS)
        , _export(this)
 {
-       set_defaults ();
+       set_defaults();
 }
 
 void
-Config::set_defaults ()
+Config::set_defaults()
 {
-       _master_encoding_threads = max (2U, boost::thread::hardware_concurrency ());
-       _server_encoding_threads = max (2U, boost::thread::hardware_concurrency ());
+       _master_encoding_threads = max(2U, boost::thread::hardware_concurrency());
+       _server_encoding_threads = max(2U, boost::thread::hardware_concurrency());
        _server_port_base = 6192;
        _use_any_servers = true;
-       _servers.clear ();
+       _servers.clear();
        _only_servers_encode = false;
        _tms_protocol = FileTransferProtocol::SCP;
        _tms_passive = true;
@@ -109,15 +109,15 @@ Config::set_defaults ()
        _allow_96khz_audio = false;
        _use_all_audio_channels = false;
        _show_experimental_audio_processors = false;
-       _language = optional<string> ();
+       _language = optional<string>();
        _default_still_length = 10;
-       _default_dcp_content_type = DCPContentType::from_isdcf_name ("FTR");
+       _default_dcp_content_type = DCPContentType::from_isdcf_name("FTR");
        _default_dcp_audio_channels = 8;
        _default_video_bit_rate[VideoEncoding::JPEG2000] = 150000000;
        _default_video_bit_rate[VideoEncoding::MPEG2] = 5000000;
        _default_audio_delay = 0;
        _default_interop = false;
-       _default_metadata.clear ();
+       _default_metadata.clear();
        _upload_after_make_dcp = false;
        _mail_server = "";
        _mail_port = 25;
@@ -125,11 +125,11 @@ Config::set_defaults ()
        _mail_user = "";
        _mail_password = "";
        _kdm_from = "";
-       _kdm_cc.clear ();
+       _kdm_cc.clear();
        _kdm_bcc = "";
        _notification_from = "";
        _notification_to = "";
-       _notification_cc.clear ();
+       _notification_cc.clear();
        _notification_bcc = "";
        _check_for_updates = false;
        _check_for_test_updates = false;
@@ -151,14 +151,14 @@ Config::set_defaults ()
        _kdm_container_name_format = dcp::NameFormat("KDM_%f_%c");
        _kdm_filename_format = dcp::NameFormat("KDM_%f_%c_%s");
        _dkdm_filename_format = dcp::NameFormat("DKDM_%f_%c_%s");
-       _dcp_metadata_filename_format = dcp::NameFormat ("%t");
-       _dcp_asset_filename_format = dcp::NameFormat ("%t");
+       _dcp_metadata_filename_format = dcp::NameFormat("%t");
+       _dcp_asset_filename_format = dcp::NameFormat("%t");
        _jump_to_selected = true;
        for (int i = 0; i < NAG_COUNT; ++i) {
                _nagged[i] = false;
        }
        _sound = true;
-       _sound_output = optional<string> ();
+       _sound_output = optional<string>();
        _last_kdm_write_type = KDM_WRITE_FLAT;
        _last_dkdm_write_type = DKDM_WRITE_INTERNAL;
        _default_add_file_location = DefaultAddFileLocation::SAME_AS_LAST_TIME;
@@ -195,7 +195,7 @@ Config::set_defaults ()
        _player_playlist_directory = boost::none;
        _player_kdm_directory = boost::none;
        _audio_mapping = boost::none;
-       _custom_languages.clear ();
+       _custom_languages.clear();
        _initial_paths.clear();
        _initial_paths["AddFilesPath"] = boost::none;
        _initial_paths["AddKDMPath"] = boost::none;
@@ -224,17 +224,17 @@ Config::set_defaults ()
        _relative_paths = false;
        _layout_for_short_screen = false;
 
-       _allowed_dcp_frame_rates.clear ();
-       _allowed_dcp_frame_rates.push_back (24);
-       _allowed_dcp_frame_rates.push_back (25);
-       _allowed_dcp_frame_rates.push_back (30);
-       _allowed_dcp_frame_rates.push_back (48);
-       _allowed_dcp_frame_rates.push_back (50);
-       _allowed_dcp_frame_rates.push_back (60);
+       _allowed_dcp_frame_rates.clear();
+       _allowed_dcp_frame_rates.push_back(24);
+       _allowed_dcp_frame_rates.push_back(25);
+       _allowed_dcp_frame_rates.push_back(30);
+       _allowed_dcp_frame_rates.push_back(48);
+       _allowed_dcp_frame_rates.push_back(50);
+       _allowed_dcp_frame_rates.push_back(60);
 
-       set_kdm_email_to_default ();
-       set_notification_email_to_default ();
-       set_cover_sheet_to_default ();
+       set_kdm_email_to_default();
+       set_notification_email_to_default();
+       set_cover_sheet_to_default();
 
 #ifdef DCPOMATIC_GROK
        _grok = boost::none;
@@ -247,16 +247,16 @@ Config::set_defaults ()
 }
 
 void
-Config::restore_defaults ()
+Config::restore_defaults()
 {
-       Config::instance()->set_defaults ();
-       Config::instance()->changed ();
+       Config::instance()->set_defaults();
+       Config::instance()->changed();
 }
 
 shared_ptr<dcp::CertificateChain>
-Config::create_certificate_chain ()
+Config::create_certificate_chain()
 {
-       return make_shared<dcp::CertificateChain> (
+       return make_shared<dcp::CertificateChain>(
                openssl_path(),
                CERTIFICATE_VALIDITY_PERIOD,
                "dcpomatic.com",
@@ -268,7 +268,7 @@ Config::create_certificate_chain ()
 }
 
 void
-Config::backup ()
+Config::backup()
 {
        using namespace boost::filesystem;
 
@@ -295,26 +295,26 @@ Config::backup ()
        /* This uses the State::write_path stuff so, e.g. for a current version 2.16 we might copy
         * ~/.config/dcpomatic2/2.16/config.xml to ~/.config/dcpomatic2/2.16/config.xml.1
         */
-       copy_adding_number (config_write_file());
+       copy_adding_number(config_write_file());
 
        /* These do not use State::write_path, so whatever path is in the Config we will copy
         * adding a number.
         */
-       copy_adding_number (_cinemas_file);
-       copy_adding_number (_dkdm_recipients_file);
+       copy_adding_number(_cinemas_file);
+       copy_adding_number(_dkdm_recipients_file);
 }
 
 void
-Config::read ()
+Config::read()
 try
 {
-       cxml::Document f ("Config");
+       cxml::Document f("Config");
        f.read_file(dcp::filesystem::fix_long_path(config_read_file()));
 
-       auto version = f.optional_number_child<int> ("Version");
+       auto version = f.optional_number_child<int>("Version");
        if (version && *version < _current_version) {
                /* Back up the old config before we re-write it in a back-incompatible way */
-               backup ();
+               backup();
        }
 
        if (f.optional_number_child<int>("NumLocalEncodingThreads")) {
@@ -324,68 +324,68 @@ try
                _server_encoding_threads = f.number_child<int>("ServerEncodingThreads");
        }
 
-       _default_directory = f.optional_string_child ("DefaultDirectory");
-       if (_default_directory && _default_directory->empty ()) {
+       _default_directory = f.optional_string_child("DefaultDirectory");
+       if (_default_directory && _default_directory->empty()) {
                /* We used to store an empty value for this to mean "none set" */
-               _default_directory = boost::optional<boost::filesystem::path> ();
+               _default_directory = boost::optional<boost::filesystem::path>();
        }
 
-       auto b = f.optional_number_child<int> ("ServerPort");
+       auto b = f.optional_number_child<int>("ServerPort");
        if (!b) {
-               b = f.optional_number_child<int> ("ServerPortBase");
+               b = f.optional_number_child<int>("ServerPortBase");
        }
-       _server_port_base = b.get ();
+       _server_port_base = b.get();
 
-       auto u = f.optional_bool_child ("UseAnyServers");
-       _use_any_servers = u.get_value_or (true);
+       auto u = f.optional_bool_child("UseAnyServers");
+       _use_any_servers = u.get_value_or(true);
 
        for (auto i: f.node_children("Server")) {
                if (i->node_children("HostName").size() == 1) {
-                       _servers.push_back (i->string_child ("HostName"));
+                       _servers.push_back(i->string_child("HostName"));
                } else {
-                       _servers.push_back (i->content ());
+                       _servers.push_back(i->content());
                }
        }
 
-       _only_servers_encode = f.optional_bool_child ("OnlyServersEncode").get_value_or (false);
+       _only_servers_encode = f.optional_bool_child("OnlyServersEncode").get_value_or(false);
        _tms_protocol = static_cast<FileTransferProtocol>(f.optional_number_child<int>("TMSProtocol").get_value_or(static_cast<int>(FileTransferProtocol::SCP)));
        _tms_passive = f.optional_bool_child("TMSPassive").get_value_or(true);
-       _tms_ip = f.string_child ("TMSIP");
-       _tms_path = f.string_child ("TMSPath");
-       _tms_user = f.string_child ("TMSUser");
-       _tms_password = f.string_child ("TMSPassword");
+       _tms_ip = f.string_child("TMSIP");
+       _tms_path = f.string_child("TMSPath");
+       _tms_user = f.string_child("TMSUser");
+       _tms_password = f.string_child("TMSPassword");
 
-       _language = f.optional_string_child ("Language");
+       _language = f.optional_string_child("Language");
 
        _default_dcp_content_type = DCPContentType::from_isdcf_name(f.optional_string_child("DefaultDCPContentType").get_value_or("FTR"));
-       _default_dcp_audio_channels = f.optional_number_child<int>("DefaultDCPAudioChannels").get_value_or (6);
+       _default_dcp_audio_channels = f.optional_number_child<int>("DefaultDCPAudioChannels").get_value_or(6);
 
-       if (f.optional_string_child ("DCPMetadataIssuer")) {
-               _dcp_issuer = f.string_child ("DCPMetadataIssuer");
-       } else if (f.optional_string_child ("DCPIssuer")) {
-               _dcp_issuer = f.string_child ("DCPIssuer");
+       if (f.optional_string_child("DCPMetadataIssuer")) {
+               _dcp_issuer = f.string_child("DCPMetadataIssuer");
+       } else if (f.optional_string_child("DCPIssuer")) {
+               _dcp_issuer = f.string_child("DCPIssuer");
        }
 
        auto up = f.optional_bool_child("UploadAfterMakeDCP");
        if (!up) {
                up = f.optional_bool_child("DefaultUploadAfterMakeDCP");
        }
-       _upload_after_make_dcp = up.get_value_or (false);
-       _dcp_creator = f.optional_string_child ("DCPCreator").get_value_or ("");
+       _upload_after_make_dcp = up.get_value_or(false);
+       _dcp_creator = f.optional_string_child("DCPCreator").get_value_or("");
        _dcp_company_name = f.optional_string_child("DCPCompanyName").get_value_or("");
        _dcp_product_name = f.optional_string_child("DCPProductName").get_value_or("");
        _dcp_product_version = f.optional_string_child("DCPProductVersion").get_value_or("");
        _dcp_j2k_comment = f.optional_string_child("DCPJ2KComment").get_value_or("");
 
-       _default_still_length = f.optional_number_child<int>("DefaultStillLength").get_value_or (10);
+       _default_still_length = f.optional_number_child<int>("DefaultStillLength").get_value_or(10);
        if (auto j2k = f.optional_number_child<int>("DefaultJ2KBandwidth")) {
                _default_video_bit_rate[VideoEncoding::JPEG2000] = *j2k;
        } else {
                _default_video_bit_rate[VideoEncoding::JPEG2000] = f.optional_number_child<int64_t>("DefaultJ2KVideoBitRate").get_value_or(200000000);
        }
        _default_video_bit_rate[VideoEncoding::MPEG2] = f.optional_number_child<int64_t>("DefaultMPEG2VideoBitRate").get_value_or(5000000);
-       _default_audio_delay = f.optional_number_child<int>("DefaultAudioDelay").get_value_or (0);
-       _default_interop = f.optional_bool_child("DefaultInterop").get_value_or (false);
+       _default_audio_delay = f.optional_number_child<int>("DefaultAudioDelay").get_value_or(0);
+       _default_interop = f.optional_bool_child("DefaultInterop").get_value_or(false);
 
        try {
                auto al = f.optional_string_child("DefaultAudioLanguage");
@@ -407,8 +407,8 @@ try
 
        _default_kdm_directory = f.optional_string_child("DefaultKDMDirectory");
 
-       _mail_server = f.string_child ("MailServer");
-       _mail_port = f.optional_number_child<int> ("MailPort").get_value_or (25);
+       _mail_server = f.string_child("MailServer");
+       _mail_port = f.optional_number_child<int>("MailPort").get_value_or(25);
 
        {
                /* Make sure this matches the code in write_config */
@@ -424,25 +424,25 @@ try
                }
        }
 
-       _mail_user = f.optional_string_child("MailUser").get_value_or ("");
-       _mail_password = f.optional_string_child("MailPassword").get_value_or ("");
+       _mail_user = f.optional_string_child("MailUser").get_value_or("");
+       _mail_password = f.optional_string_child("MailPassword").get_value_or("");
 
-       _kdm_subject = f.optional_string_child ("KDMSubject").get_value_or (_("KDM delivery: $CPL_NAME"));
-       _kdm_from = f.string_child ("KDMFrom");
+       _kdm_subject = f.optional_string_child("KDMSubject").get_value_or(_("KDM delivery: $CPL_NAME"));
+       _kdm_from = f.string_child("KDMFrom");
        for (auto i: f.node_children("KDMCC")) {
                if (!i->content().empty()) {
-                       _kdm_cc.push_back (i->content ());
+                       _kdm_cc.push_back(i->content());
                }
        }
-       _kdm_bcc = f.optional_string_child ("KDMBCC").get_value_or ("");
-       _kdm_email = f.string_child ("KDMEmail");
+       _kdm_bcc = f.optional_string_child("KDMBCC").get_value_or("");
+       _kdm_email = f.string_child("KDMEmail");
 
        _notification_subject = f.optional_string_child("NotificationSubject").get_value_or(variant::insert_dcpomatic(_("%1 notification")));
        _notification_from = f.optional_string_child("NotificationFrom").get_value_or("");
        _notification_to = f.optional_string_child("NotificationTo").get_value_or("");
        for (auto i: f.node_children("NotificationCC")) {
                if (!i->content().empty()) {
-                       _notification_cc.push_back (i->content ());
+                       _notification_cc.push_back(i->content());
                }
        }
        _notification_bcc = f.optional_string_child("NotificationBCC").get_value_or("");
@@ -450,8 +450,8 @@ try
                _notification_email = f.string_child("NotificationEmail");
        }
 
-       _check_for_updates = f.optional_bool_child("CheckForUpdates").get_value_or (false);
-       _check_for_test_updates = f.optional_bool_child("CheckForTestUpdates").get_value_or (false);
+       _check_for_updates = f.optional_bool_child("CheckForUpdates").get_value_or(false);
+       _check_for_test_updates = f.optional_bool_child("CheckForTestUpdates").get_value_or(false);
 
        if (auto j2k = f.optional_number_child<int>("MaximumJ2KBandwidth")) {
                _maximum_video_bit_rate[VideoEncoding::JPEG2000] = *j2k;
@@ -459,51 +459,51 @@ try
                _maximum_video_bit_rate[VideoEncoding::JPEG2000] = f.optional_number_child<int64_t>("MaximumJ2KVideoBitRate").get_value_or(250000000);
        }
        _maximum_video_bit_rate[VideoEncoding::MPEG2] = f.optional_number_child<int64_t>("MaximumMPEG2VideoBitRate").get_value_or(50000000);
-       _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate").get_value_or (false);
-       _allow_any_container = f.optional_bool_child ("AllowAnyContainer").get_value_or (false);
+       _allow_any_dcp_frame_rate = f.optional_bool_child("AllowAnyDCPFrameRate").get_value_or(false);
+       _allow_any_container = f.optional_bool_child("AllowAnyContainer").get_value_or(false);
        _allow_96khz_audio = f.optional_bool_child("Allow96kHzAudio").get_value_or(false);
        _use_all_audio_channels = f.optional_bool_child("UseAllAudioChannels").get_value_or(false);
-       _show_experimental_audio_processors = f.optional_bool_child ("ShowExperimentalAudioProcessors").get_value_or (false);
+       _show_experimental_audio_processors = f.optional_bool_child("ShowExperimentalAudioProcessors").get_value_or(false);
 
-       _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
-       _analyse_ebur128 = f.optional_bool_child("AnalyseEBUR128").get_value_or (true);
-       _automatic_audio_analysis = f.optional_bool_child ("AutomaticAudioAnalysis").get_value_or (false);
+       _log_types = f.optional_number_child<int>("LogTypes").get_value_or(LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
+       _analyse_ebur128 = f.optional_bool_child("AnalyseEBUR128").get_value_or(true);
+       _automatic_audio_analysis = f.optional_bool_child("AutomaticAudioAnalysis").get_value_or(false);
 #ifdef DCPOMATIC_WINDOWS
-       _win32_console = f.optional_bool_child ("Win32Console").get_value_or (false);
+       _win32_console = f.optional_bool_child("Win32Console").get_value_or(false);
 #endif
 
        for (auto i: f.node_children("History")) {
-               _history.push_back (i->content ());
+               _history.push_back(i->content());
        }
 
        for (auto i: f.node_children("PlayerHistory")) {
-               _player_history.push_back (i->content ());
+               _player_history.push_back(i->content());
        }
 
-       auto signer = f.optional_node_child ("Signer");
+       auto signer = f.optional_node_child("Signer");
        if (signer) {
                auto c = make_shared<dcp::CertificateChain>();
                /* Read the signing certificates and private key in from the config file */
-               for (auto i: signer->node_children ("Certificate")) {
-                       c->add (dcp::Certificate (i->content ()));
+               for (auto i: signer->node_children("Certificate")) {
+                       c->add(dcp::Certificate(i->content()));
                }
-               c->set_key (signer->string_child ("PrivateKey"));
+               c->set_key(signer->string_child("PrivateKey"));
                _signer_chain = c;
        } else {
                /* Make a new set of signing certificates and key */
-               _signer_chain = create_certificate_chain ();
+               _signer_chain = create_certificate_chain();
        }
 
-       auto decryption = f.optional_node_child ("Decryption");
+       auto decryption = f.optional_node_child("Decryption");
        if (decryption) {
                auto c = make_shared<dcp::CertificateChain>();
-               for (auto i: decryption->node_children ("Certificate")) {
-                       c->add (dcp::Certificate (i->content ()));
+               for (auto i: decryption->node_children("Certificate")) {
+                       c->add(dcp::Certificate(i->content ()));
                }
-               c->set_key (decryption->string_child ("PrivateKey"));
+               c->set_key(decryption->string_child("PrivateKey"));
                _decryption_chain = c;
        } else {
-               _decryption_chain = create_certificate_chain ();
+               _decryption_chain = create_certificate_chain();
        }
 
        /* These must be done before we call Bad as that might set one
@@ -516,7 +516,7 @@ try
                }
        }
 
-       auto bad = check_certificates ();
+       auto bad = check_certificates();
        if (bad) {
                auto const remake = Bad(*bad);
                if (remake && *remake) {
@@ -525,10 +525,10 @@ try
                        case BAD_SIGNER_INCONSISTENT:
                        case BAD_SIGNER_VALIDITY_TOO_LONG:
                        case BAD_SIGNER_DN_QUALIFIER:
-                               _signer_chain = create_certificate_chain ();
+                               _signer_chain = create_certificate_chain();
                                break;
                        case BAD_DECRYPTION_INCONSISTENT:
-                               _decryption_chain = create_certificate_chain ();
+                               _decryption_chain = create_certificate_chain();
                                break;
                        }
                }
@@ -536,26 +536,26 @@ try
 
        if (f.optional_node_child("DKDMGroup")) {
                /* New-style: all DKDMs in a group */
-               _dkdms = dynamic_pointer_cast<DKDMGroup> (DKDMBase::read (f.node_child("DKDMGroup")));
+               _dkdms = dynamic_pointer_cast<DKDMGroup>(DKDMBase::read(f.node_child("DKDMGroup")));
        } else {
                /* Old-style: one or more DKDM nodes */
                _dkdms = make_shared<DKDMGroup>("root");
                for (auto i: f.node_children("DKDM")) {
-                       _dkdms->add (DKDMBase::read (i));
+                       _dkdms->add(DKDMBase::read(i));
                }
        }
        _cinemas_file = f.optional_string_child("CinemasFile").get_value_or(read_path("cinemas.sqlite3").string());
        _dkdm_recipients_file = f.optional_string_child("DKDMRecipientsFile").get_value_or(read_path("dkdm_recipients.sqlite3").string());
-       _show_hints_before_make_dcp = f.optional_bool_child("ShowHintsBeforeMakeDCP").get_value_or (true);
-       _confirm_kdm_email = f.optional_bool_child("ConfirmKDMEmail").get_value_or (true);
-       _kdm_container_name_format = dcp::NameFormat (f.optional_string_child("KDMContainerNameFormat").get_value_or ("KDM %f %c"));
-       _kdm_filename_format = dcp::NameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s"));
-       _dkdm_filename_format = dcp::NameFormat (f.optional_string_child("DKDMFilenameFormat").get_value_or("DKDM %f %c %s"));
-       _dcp_metadata_filename_format = dcp::NameFormat (f.optional_string_child("DCPMetadataFilenameFormat").get_value_or ("%t"));
-       _dcp_asset_filename_format = dcp::NameFormat (f.optional_string_child("DCPAssetFilenameFormat").get_value_or ("%t"));
-       _jump_to_selected = f.optional_bool_child("JumpToSelected").get_value_or (true);
+       _show_hints_before_make_dcp = f.optional_bool_child("ShowHintsBeforeMakeDCP").get_value_or(true);
+       _confirm_kdm_email = f.optional_bool_child("ConfirmKDMEmail").get_value_or(true);
+       _kdm_container_name_format = dcp::NameFormat(f.optional_string_child("KDMContainerNameFormat").get_value_or("KDM %f %c"));
+       _kdm_filename_format = dcp::NameFormat(f.optional_string_child("KDMFilenameFormat").get_value_or("KDM %f %c %s"));
+       _dkdm_filename_format = dcp::NameFormat(f.optional_string_child("DKDMFilenameFormat").get_value_or("DKDM %f %c %s"));
+       _dcp_metadata_filename_format = dcp::NameFormat(f.optional_string_child("DCPMetadataFilenameFormat").get_value_or("%t"));
+       _dcp_asset_filename_format = dcp::NameFormat(f.optional_string_child("DCPAssetFilenameFormat").get_value_or("%t"));
+       _jump_to_selected = f.optional_bool_child("JumpToSelected").get_value_or(true);
        /* The variable was renamed but not the XML tag */
-       _sound = f.optional_bool_child("PreviewSound").get_value_or (true);
+       _sound = f.optional_bool_child("PreviewSound").get_value_or(true);
        _sound_output = f.optional_string_child("PreviewSoundOutput");
        if (f.optional_string_child("CoverSheet")) {
                _cover_sheet = f.optional_string_child("CoverSheet").get();
@@ -621,7 +621,7 @@ try
        _player_kdm_directory = f.optional_string_child("PlayerKDMDirectory");
 
        if (f.optional_node_child("AudioMapping")) {
-               _audio_mapping = AudioMapping (f.node_child("AudioMapping"), Film::current_state_version);
+               _audio_mapping = AudioMapping(f.node_child("AudioMapping"), Film::current_state_version);
        }
 
        for (auto i: f.node_children("CustomLanguage")) {
@@ -629,7 +629,7 @@ try
                        /* This will fail if it's called before dcp::init() as it won't recognise the
                         * tag.  That's OK because the Config will be reloaded again later.
                         */
-                       _custom_languages.push_back (dcp::LanguageTag(i->content()));
+                       _custom_languages.push_back(dcp::LanguageTag(i->content()));
                } catch (std::runtime_error& e) {}
        }
 
@@ -675,26 +675,26 @@ try
 }
 catch (...) {
        if (have_existing("config.xml")) {
-               backup ();
+               backup();
                /* We have a config file but it didn't load */
                FailedToLoad(LoadFailure::CONFIG);
        }
-       set_defaults ();
+       set_defaults();
        /* Make a new set of signing certificates and key */
-       _signer_chain = create_certificate_chain ();
+       _signer_chain = create_certificate_chain();
        /* And similar for decryption of KDMs */
-       _decryption_chain = create_certificate_chain ();
+       _decryption_chain = create_certificate_chain();
        write_config();
 }
 
 
 /** @return Singleton instance */
 Config *
-Config::instance ()
+Config::instance()
 {
        if (_instance == nullptr) {
                _instance = new Config;
-               _instance->read ();
+               _instance->read();
 
                auto cinemas_file = _instance->cinemas_file();
                if (cinemas_file.extension() == ".xml") {
@@ -728,16 +728,16 @@ Config::instance ()
 
 /** Write our configuration to disk */
 void
-Config::write () const
+Config::write() const
 {
-       write_config ();
+       write_config();
 }
 
 void
-Config::write_config () const
+Config::write_config() const
 {
        xmlpp::Document doc;
-       auto root = doc.create_root_node ("Config");
+       auto root = doc.create_root_node("Config");
 
        /* [XML] Version The version number of the configuration file format. */
        cxml::add_text_child(root, "Version", fmt::to_string(_current_version));
@@ -809,7 +809,7 @@ Config::write_config () const
        }
        if (_default_kdm_directory) {
                /* [XML:opt] DefaultKDMDirectory Default directory to write KDMs to. */
-               cxml::add_text_child(root, "DefaultKDMDirectory", _default_kdm_directory->string ());
+               cxml::add_text_child(root, "DefaultKDMDirectory", _default_kdm_directory->string());
        }
        _default_kdm_duration.as_xml(cxml::add_child(root, "DefaultKDMDuration"));
        /* [XML] MailServer Hostname of SMTP server to use. */
@@ -907,17 +907,17 @@ Config::write_config () const
           tags in order and a <code>&lt;PrivateKey&gt;</code> tag all containing PEM-encoded certificates or private keys as appropriate.
        */
        auto signer = cxml::add_child(root, "Signer");
-       DCPOMATIC_ASSERT (_signer_chain);
+       DCPOMATIC_ASSERT(_signer_chain);
        for (auto const& i: _signer_chain->unordered()) {
-               cxml::add_text_child(signer, "Certificate", i.certificate (true));
+               cxml::add_text_child(signer, "Certificate", i.certificate(true));
        }
-       cxml::add_text_child(signer, "PrivateKey", _signer_chain->key().get ());
+       cxml::add_text_child(signer, "PrivateKey", _signer_chain->key().get());
 
        /* [XML] Decryption Certificate chain and private key to use when decrypting KDMs */
        auto decryption = cxml::add_child(root, "Decryption");
-       DCPOMATIC_ASSERT (_decryption_chain);
+       DCPOMATIC_ASSERT(_decryption_chain);
        for (auto const& i: _decryption_chain->unordered()) {
-               cxml::add_text_child(decryption, "Certificate", i.certificate (true));
+               cxml::add_text_child(decryption, "Certificate", i.certificate(true));
        }
        cxml::add_text_child(decryption, "PrivateKey", _decryption_chain->key().get());
 
@@ -939,7 +939,7 @@ Config::write_config () const
           or <code>&lt;DKDM&gt;</code> tags.
        */
        /* [XML] DKDM A DKDM as XML */
-       _dkdms->as_xml (root);
+       _dkdms->as_xml(root);
 
        /* [XML] CinemasFile Filename of cinemas list file. */
        cxml::add_text_child(root, "CinemasFile", _cinemas_file.string());
@@ -965,7 +965,7 @@ Config::write_config () const
        for (int i = 0; i < NAG_COUNT; ++i) {
                auto e = cxml::add_child(root, "Nagged");
                e->set_attribute("id", fmt::to_string(i));
-               e->add_child_text (_nagged[i] ? "1" : "0");
+               e->add_child_text(_nagged[i] ? "1" : "0");
        }
        /* [XML] PreviewSound 1 to use sound in the GUI preview and player, otherwise 0. */
        cxml::add_text_child(root, "PreviewSound", _sound ? "1" : "0");
@@ -1020,7 +1020,7 @@ Config::write_config () const
        for (int i = 0; i < NOTIFICATION_COUNT; ++i) {
                auto e = cxml::add_child(root, "Notification");
                e->set_attribute("id", fmt::to_string(i));
-               e->add_child_text (_notification[i] ? "1" : "0");
+               e->add_child_text(_notification[i] ? "1" : "0");
        }
 
        if (_barco_username) {
@@ -1155,30 +1155,30 @@ Config::write_config () const
        auto target = config_write_file();
 
        try {
-               auto const s = doc.write_to_string_formatted ();
-               boost::filesystem::path tmp (string(target.string()).append(".tmp"));
+               auto const s = doc.write_to_string_formatted();
+               boost::filesystem::path tmp(string(target.string()).append(".tmp"));
                dcp::File f(tmp, "w");
                if (!f) {
-                       throw FileError (_("Could not open file for writing"), tmp);
+                       throw FileError(_("Could not open file for writing"), tmp);
                }
                f.checked_write(s.c_str(), s.bytes());
                f.close();
                dcp::filesystem::remove(target);
                dcp::filesystem::rename(tmp, target);
        } catch (xmlpp::exception& e) {
-               string s = e.what ();
-               trim (s);
-               throw FileError (s, target);
+               string s = e.what();
+               trim(s);
+               throw FileError(s, target);
        }
 }
 
 
 template <class T>
 void
-write_file (string root_node, string node, string version, list<shared_ptr<T>> things, boost::filesystem::path file)
+write_file(string root_node, string node, string version, list<shared_ptr<T>> things, boost::filesystem::path file)
 {
        xmlpp::Document doc;
-       auto root = doc.create_root_node (root_node);
+       auto root = doc.create_root_node(root_node);
        cxml::add_text_child(root, "Version", version);
 
        for (auto i: things) {
@@ -1186,31 +1186,31 @@ write_file (string root_node, string node, string version, list<shared_ptr<T>> t
        }
 
        try {
-               doc.write_to_file_formatted (file.string() + ".tmp");
+               doc.write_to_file_formatted(file.string() + ".tmp");
                dcp::filesystem::remove(file);
                dcp::filesystem::rename(file.string() + ".tmp", file);
        } catch (xmlpp::exception& e) {
-               string s = e.what ();
-               trim (s);
-               throw FileError (s, file);
+               string s = e.what();
+               trim(s);
+               throw FileError(s, file);
        }
 }
 
 
 boost::filesystem::path
-Config::default_directory_or (boost::filesystem::path a) const
+Config::default_directory_or(boost::filesystem::path a) const
 {
-       return directory_or (_default_directory, a);
+       return directory_or(_default_directory, a);
 }
 
 boost::filesystem::path
-Config::default_kdm_directory_or (boost::filesystem::path a) const
+Config::default_kdm_directory_or(boost::filesystem::path a) const
 {
-       return directory_or (_default_kdm_directory, a);
+       return directory_or(_default_kdm_directory, a);
 }
 
 boost::filesystem::path
-Config::directory_or (optional<boost::filesystem::path> dir, boost::filesystem::path a) const
+Config::directory_or(optional<boost::filesystem::path> dir, boost::filesystem::path a) const
 {
        if (!dir) {
                return a;
@@ -1226,20 +1226,20 @@ Config::directory_or (optional<boost::filesystem::path> dir, boost::filesystem::
 }
 
 void
-Config::drop ()
+Config::drop()
 {
        delete _instance;
        _instance = nullptr;
 }
 
 void
-Config::changed (Property what)
+Config::changed(Property what)
 {
-       Changed (what);
+       Changed(what);
 }
 
 void
-Config::set_kdm_email_to_default ()
+Config::set_kdm_email_to_default()
 {
        _kdm_subject = _("KDM delivery: $CPL_NAME");
 
@@ -1254,7 +1254,7 @@ Config::set_kdm_email_to_default ()
 }
 
 void
-Config::set_notification_email_to_default ()
+Config::set_notification_email_to_default()
 {
        _notification_subject = variant::insert_dcpomatic(_("%1 notification"));
 
@@ -1264,21 +1264,21 @@ Config::set_notification_email_to_default ()
 }
 
 void
-Config::reset_kdm_email ()
+Config::reset_kdm_email()
 {
-       set_kdm_email_to_default ();
-       changed ();
+       set_kdm_email_to_default();
+       changed();
 }
 
 void
-Config::reset_notification_email ()
+Config::reset_notification_email()
 {
-       set_notification_email_to_default ();
-       changed ();
+       set_notification_email_to_default();
+       changed();
 }
 
 void
-Config::set_cover_sheet_to_default ()
+Config::set_cover_sheet_to_default()
 {
        _cover_sheet = _(
                "$CPL_NAME\n\n"
@@ -1294,54 +1294,54 @@ Config::set_cover_sheet_to_default ()
 }
 
 void
-Config::add_to_history (boost::filesystem::path p)
+Config::add_to_history(boost::filesystem::path p)
 {
-       add_to_history_internal (_history, p);
+       add_to_history_internal(_history, p);
 }
 
 /** Remove non-existent items from the history */
 void
-Config::clean_history ()
+Config::clean_history()
 {
-       clean_history_internal (_history);
+       clean_history_internal(_history);
 }
 
 void
-Config::add_to_player_history (boost::filesystem::path p)
+Config::add_to_player_history(boost::filesystem::path p)
 {
-       add_to_history_internal (_player_history, p);
+       add_to_history_internal(_player_history, p);
 }
 
 /** Remove non-existent items from the player history */
 void
-Config::clean_player_history ()
+Config::clean_player_history()
 {
-       clean_history_internal (_player_history);
+       clean_history_internal(_player_history);
 }
 
 void
-Config::add_to_history_internal (vector<boost::filesystem::path>& h, boost::filesystem::path p)
+Config::add_to_history_internal(vector<boost::filesystem::path>& h, boost::filesystem::path p)
 {
        /* Remove existing instances of this path in the history */
-       h.erase (remove (h.begin(), h.end(), p), h.end ());
+       h.erase(remove(h.begin(), h.end(), p), h.end());
 
-       h.insert (h.begin (), p);
+       h.insert(h.begin(), p);
        if (h.size() > HISTORY_SIZE) {
                h.resize(HISTORY_SIZE);
        }
 
-       changed (HISTORY);
+       changed(HISTORY);
 }
 
 void
-Config::clean_history_internal (vector<boost::filesystem::path>& h)
+Config::clean_history_internal(vector<boost::filesystem::path>& h)
 {
        auto old = h;
-       h.clear ();
+       h.clear();
        for (auto i: old) {
                try {
                        if (dcp::filesystem::is_directory(i)) {
-                               h.push_back (i);
+                               h.push_back(i);
                        }
                } catch (...) {
                        /* We couldn't find out if it's a directory for some reason; just ignore it */
@@ -1351,14 +1351,14 @@ Config::clean_history_internal (vector<boost::filesystem::path>& h)
 
 
 bool
-Config::have_existing (string file)
+Config::have_existing(string file)
 {
        return dcp::filesystem::exists(read_path(file));
 }
 
 
 void
-Config::set_cinemas_file (boost::filesystem::path file)
+Config::set_cinemas_file(boost::filesystem::path file)
 {
        if (file == _cinemas_file) {
                return;
@@ -1391,14 +1391,14 @@ Config::save_default_template(shared_ptr<const Film> film) const
 
 
 void
-Config::save_template (shared_ptr<const Film> film, string name) const
+Config::save_template(shared_ptr<const Film> film, string name) const
 {
-       film->write_template (template_write_path(name));
+       film->write_template(template_write_path(name));
 }
 
 
 vector<string>
-Config::templates () const
+Config::templates() const
 {
        if (!dcp::filesystem::exists(read_path("templates"))) {
                return {};
@@ -1406,22 +1406,22 @@ Config::templates () const
 
        vector<string> n;
        for (auto const& i: dcp::filesystem::directory_iterator(read_path("templates"))) {
-               n.push_back (i.path().filename().string());
+               n.push_back(i.path().filename().string());
        }
        return n;
 }
 
 bool
-Config::existing_template (string name) const
+Config::existing_template(string name) const
 {
        return dcp::filesystem::exists(template_read_path(name));
 }
 
 
 boost::filesystem::path
-Config::template_read_path (string name) const
+Config::template_read_path(string name) const
 {
-       return read_path("templates") / tidy_for_filename (name);
+       return read_path("templates") / tidy_for_filename(name);
 }
 
 
@@ -1438,29 +1438,29 @@ Config::default_template_read_path() const
 
 
 boost::filesystem::path
-Config::template_write_path (string name) const
+Config::template_write_path(string name) const
 {
-       return write_path("templates") / tidy_for_filename (name);
+       return write_path("templates") / tidy_for_filename(name);
 }
 
 
 void
-Config::rename_template (string old_name, string new_name) const
+Config::rename_template(string old_name, string new_name) const
 {
        dcp::filesystem::rename(template_read_path(old_name), template_write_path(new_name));
 }
 
 void
-Config::delete_template (string name) const
+Config::delete_template(string name) const
 {
        dcp::filesystem::remove(template_write_path(name));
 }
 
 /** @return Path to the config.xml containing the actual settings, following a link if required */
 boost::filesystem::path
-config_file (boost::filesystem::path main)
+config_file(boost::filesystem::path main)
 {
-       cxml::Document f ("Config");
+       cxml::Document f("Config");
        if (!dcp::filesystem::exists(main)) {
                /* It doesn't exist, so there can't be any links; just return it */
                return main;
@@ -1484,50 +1484,50 @@ config_file (boost::filesystem::path main)
 
 
 boost::filesystem::path
-Config::config_read_file ()
+Config::config_read_file()
 {
-       return config_file (read_path("config.xml"));
+       return config_file(read_path("config.xml"));
 }
 
 
 boost::filesystem::path
-Config::config_write_file ()
+Config::config_write_file()
 {
-       return config_file (write_path("config.xml"));
+       return config_file(write_path("config.xml"));
 }
 
 
 void
-Config::reset_cover_sheet ()
+Config::reset_cover_sheet()
 {
-       set_cover_sheet_to_default ();
-       changed ();
+       set_cover_sheet_to_default();
+       changed();
 }
 
 void
-Config::link (boost::filesystem::path new_file) const
+Config::link(boost::filesystem::path new_file) const
 {
        xmlpp::Document doc;
        cxml::add_text_child(doc.create_root_node("Config"), "Link", new_file.string());
        try {
                doc.write_to_file_formatted(write_path("config.xml").string());
        } catch (xmlpp::exception& e) {
-               string s = e.what ();
-               trim (s);
-               throw FileError (s, write_path("config.xml"));
+               string s = e.what();
+               trim(s);
+               throw FileError(s, write_path("config.xml"));
        }
 }
 
 void
-Config::copy_and_link (boost::filesystem::path new_file) const
+Config::copy_and_link(boost::filesystem::path new_file) const
 {
-       write ();
+       write();
        dcp::filesystem::copy_file(config_read_file(), new_file, dcp::filesystem::CopyOptions::OVERWRITE_EXISTING);
-       link (new_file);
+       link(new_file);
 }
 
 bool
-Config::have_write_permission () const
+Config::have_write_permission() const
 {
        dcp::File f(config_write_file(), "r+");
        return static_cast<bool>(f);
@@ -1537,28 +1537,28 @@ Config::have_write_permission () const
  *  @return Audio mapping for this output channel count (may be a default).
  */
 AudioMapping
-Config::audio_mapping (int output_channels)
+Config::audio_mapping(int output_channels)
 {
        if (!_audio_mapping || _audio_mapping->output_channels() != output_channels) {
                /* Set up a default */
-               _audio_mapping = AudioMapping (MAX_DCP_AUDIO_CHANNELS, output_channels);
+               _audio_mapping = AudioMapping(MAX_DCP_AUDIO_CHANNELS, output_channels);
                if (output_channels == 2) {
                        /* Special case for stereo output.
                           Map so that Lt = L(-3dB) + Ls(-3dB) + C(-6dB) + Lfe(-10dB)
                           Rt = R(-3dB) + Rs(-3dB) + C(-6dB) + Lfe(-10dB)
                        */
-                       _audio_mapping->set (dcp::Channel::LEFT,   0, 1 / sqrt(2));  // L   -> Lt
-                       _audio_mapping->set (dcp::Channel::RIGHT,  1, 1 / sqrt(2));  // R   -> Rt
-                       _audio_mapping->set (dcp::Channel::CENTRE, 0, 1 / 2.0);      // C   -> Lt
-                       _audio_mapping->set (dcp::Channel::CENTRE, 1, 1 / 2.0);      // C   -> Rt
-                       _audio_mapping->set (dcp::Channel::LFE,    0, 1 / sqrt(10)); // Lfe -> Lt
-                       _audio_mapping->set (dcp::Channel::LFE,    1, 1 / sqrt(10)); // Lfe -> Rt
-                       _audio_mapping->set (dcp::Channel::LS,     0, 1 / sqrt(2));  // Ls  -> Lt
-                       _audio_mapping->set (dcp::Channel::RS,     1, 1 / sqrt(2));  // Rs  -> Rt
+                       _audio_mapping->set(dcp::Channel::LEFT,   0, 1 / sqrt(2));  // L   -> Lt
+                       _audio_mapping->set(dcp::Channel::RIGHT,  1, 1 / sqrt(2));  // R   -> Rt
+                       _audio_mapping->set(dcp::Channel::CENTRE, 0, 1 / 2.0);      // C   -> Lt
+                       _audio_mapping->set(dcp::Channel::CENTRE, 1, 1 / 2.0);      // C   -> Rt
+                       _audio_mapping->set(dcp::Channel::LFE,    0, 1 / sqrt(10)); // Lfe -> Lt
+                       _audio_mapping->set(dcp::Channel::LFE,    1, 1 / sqrt(10)); // Lfe -> Rt
+                       _audio_mapping->set(dcp::Channel::LS,     0, 1 / sqrt(2));  // Ls  -> Lt
+                       _audio_mapping->set(dcp::Channel::RS,     1, 1 / sqrt(2));  // Rs  -> Rt
                } else {
                        /* 1:1 mapping */
-                       for (int i = 0; i < min (MAX_DCP_AUDIO_CHANNELS, output_channels); ++i) {
-                               _audio_mapping->set (i, i, 1);
+                       for (int i = 0; i < min(MAX_DCP_AUDIO_CHANNELS, output_channels); ++i) {
+                               _audio_mapping->set(i, i, 1);
                        }
                }
        }
@@ -1567,35 +1567,35 @@ Config::audio_mapping (int output_channels)
 }
 
 void
-Config::set_audio_mapping (AudioMapping m)
+Config::set_audio_mapping(AudioMapping m)
 {
        _audio_mapping = m;
-       changed (AUDIO_MAPPING);
+       changed(AUDIO_MAPPING);
 }
 
 void
-Config::set_audio_mapping_to_default ()
+Config::set_audio_mapping_to_default()
 {
-       DCPOMATIC_ASSERT (_audio_mapping);
-       auto const ch = _audio_mapping->output_channels ();
+       DCPOMATIC_ASSERT(_audio_mapping);
+       auto const ch = _audio_mapping->output_channels();
        _audio_mapping = boost::none;
-       _audio_mapping = audio_mapping (ch);
-       changed (AUDIO_MAPPING);
+       _audio_mapping = audio_mapping(ch);
+       changed(AUDIO_MAPPING);
 }
 
 
 void
-Config::add_custom_language (dcp::LanguageTag tag)
+Config::add_custom_language(dcp::LanguageTag tag)
 {
        if (find(_custom_languages.begin(), _custom_languages.end(), tag) == _custom_languages.end()) {
-               _custom_languages.push_back (tag);
-               changed ();
+               _custom_languages.push_back(tag);
+               changed();
        }
 }
 
 
 optional<Config::BadReason>
-Config::check_certificates () const
+Config::check_certificates() const
 {
        optional<BadReason> bad;
 
@@ -1624,12 +1624,12 @@ Config::check_certificates () const
 
 
 void
-save_all_config_as_zip (boost::filesystem::path zip_file)
+save_all_config_as_zip(boost::filesystem::path zip_file)
 {
-       Zipper zipper (zip_file);
+       Zipper zipper(zip_file);
 
        auto config = Config::instance();
-       zipper.add ("config.xml", dcp::file_to_string(config->config_read_file()));
+       zipper.add("config.xml", dcp::file_to_string(config->config_read_file()));
        if (dcp::filesystem::exists(config->cinemas_file())) {
                zipper.add("cinemas.sqlite3", dcp::file_to_string(config->cinemas_file()));
        }
@@ -1637,7 +1637,7 @@ save_all_config_as_zip (boost::filesystem::path zip_file)
                zipper.add("dkdm_recipients.sqlite3", dcp::file_to_string(config->dkdm_recipients_file()));
        }
 
-       zipper.close ();
+       zipper.close();
 }
 
 
index 5387f915f9d334b8f3ee127a1db61bacb8a7906f..f598ffbc68816dbdc46beeafc63d60ba28251cdf 100644 (file)
@@ -53,7 +53,7 @@ class Ratio;
 #undef IGNORE
 
 
-extern void save_all_config_as_zip (boost::filesystem::path zip_file);
+extern void save_all_config_as_zip(boost::filesystem::path zip_file);
 
 
 /** @class Config
@@ -63,25 +63,25 @@ class Config : public State
 {
 public:
        /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
-       int master_encoding_threads () const {
+       int master_encoding_threads() const {
                return _master_encoding_threads;
        }
 
        /** @return number of threads which a server should use for J2K encoding on the local machine */
-       int server_encoding_threads () const {
+       int server_encoding_threads() const {
                return _server_encoding_threads;
        }
 
-       boost::optional<boost::filesystem::path> default_directory () const {
+       boost::optional<boost::filesystem::path> default_directory() const {
                return _default_directory;
        }
 
-       boost::optional<boost::filesystem::path> default_kdm_directory () const {
+       boost::optional<boost::filesystem::path> default_kdm_directory() const {
                return _default_kdm_directory;
        }
 
-       boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
-       boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
+       boost::filesystem::path default_directory_or(boost::filesystem::path a) const;
+       boost::filesystem::path default_kdm_directory_or(boost::filesystem::path a) const;
 
        enum class CinemasAction
        {
@@ -125,35 +125,35 @@ public:
        };
 
        /** @return base port number to use for J2K encoding servers */
-       int server_port_base () const {
+       int server_port_base() const {
                return _server_port_base;
        }
 
-       void set_use_any_servers (bool u) {
+       void set_use_any_servers(bool u) {
                _use_any_servers = u;
-               changed (USE_ANY_SERVERS);
+               changed(USE_ANY_SERVERS);
        }
 
-       bool use_any_servers () const {
+       bool use_any_servers() const {
                return _use_any_servers;
        }
 
        /** @param s New list of servers */
-       void set_servers (std::vector<std::string> s) {
+       void set_servers(std::vector<std::string> s) {
                _servers = s;
-               changed (SERVERS);
+               changed(SERVERS);
        }
 
        /** @return Host names / IP addresses of J2K encoding servers that should definitely be used */
-       std::vector<std::string> servers () const {
+       std::vector<std::string> servers() const {
                return _servers;
        }
 
-       bool only_servers_encode () const {
+       bool only_servers_encode() const {
                return _only_servers_encode;
        }
 
-       FileTransferProtocol tms_protocol () const {
+       FileTransferProtocol tms_protocol() const {
                return _tms_protocol;
        }
 
@@ -162,86 +162,86 @@ public:
        }
 
        /** @return The IP address of a TMS that we can copy DCPs to */
-       std::string tms_ip () const {
+       std::string tms_ip() const {
                return _tms_ip;
        }
 
        /** @return The path on a TMS that we should changed DCPs to */
-       std::string tms_path () const {
+       std::string tms_path() const {
                return _tms_path;
        }
 
        /** @return User name to log into the TMS with */
-       std::string tms_user () const {
+       std::string tms_user() const {
                return _tms_user;
        }
 
        /** @return Password to log into the TMS with */
-       std::string tms_password () const {
+       std::string tms_password() const {
                return _tms_password;
        }
 
-       std::list<int> allowed_dcp_frame_rates () const {
+       std::list<int> allowed_dcp_frame_rates() const {
                return _allowed_dcp_frame_rates;
        }
 
-       bool allow_any_dcp_frame_rate () const {
+       bool allow_any_dcp_frame_rate() const {
                return _allow_any_dcp_frame_rate;
        }
 
-       bool allow_any_container () const {
+       bool allow_any_container() const {
                return _allow_any_container;
        }
 
-       bool allow_96khz_audio () const {
+       bool allow_96khz_audio() const {
                return _allow_96khz_audio;
        }
 
-       bool use_all_audio_channels () const {
+       bool use_all_audio_channels() const {
                return _use_all_audio_channels;
        }
 
-       bool show_experimental_audio_processors () const {
+       bool show_experimental_audio_processors() const {
                return _show_experimental_audio_processors;
        }
 
-       boost::optional<std::string> language () const {
+       boost::optional<std::string> language() const {
                return _language;
        }
 
-       int default_still_length () const {
+       int default_still_length() const {
                return _default_still_length;
        }
 
-       DCPContentType const * default_dcp_content_type () const {
+       DCPContentType const * default_dcp_content_type() const {
                return _default_dcp_content_type;
        }
 
-       int default_dcp_audio_channels () const {
+       int default_dcp_audio_channels() const {
                return _default_dcp_audio_channels;
        }
 
-       std::string dcp_issuer () const {
+       std::string dcp_issuer() const {
                return _dcp_issuer;
        }
 
-       std::string dcp_creator () const {
+       std::string dcp_creator() const {
                return _dcp_creator;
        }
 
-       std::string dcp_company_name () const {
+       std::string dcp_company_name() const {
                return _dcp_company_name;
        }
 
-       std::string dcp_product_name () const {
+       std::string dcp_product_name() const {
                return _dcp_product_name;
        }
 
-       std::string dcp_product_version () const {
+       std::string dcp_product_version() const {
                return _dcp_product_version;
        }
 
-       std::string dcp_j2k_comment () const {
+       std::string dcp_j2k_comment() const {
                return _dcp_j2k_comment;
        }
 
@@ -249,11 +249,11 @@ public:
                return _default_video_bit_rate[encoding];
        }
 
-       int default_audio_delay () const {
+       int default_audio_delay() const {
                return _default_audio_delay;
        }
 
-       bool default_interop () const {
+       bool default_interop() const {
                return _default_interop;
        }
 
@@ -265,99 +265,99 @@ public:
                return _default_territory;
        }
 
-       std::map<std::string, std::string> default_metadata () const {
+       std::map<std::string, std::string> default_metadata() const {
                return _default_metadata;
        }
 
-       bool upload_after_make_dcp () {
+       bool upload_after_make_dcp() {
                return _upload_after_make_dcp;
        }
 
-       void set_default_kdm_directory (boost::filesystem::path d) {
+       void set_default_kdm_directory(boost::filesystem::path d) {
                if (_default_kdm_directory && _default_kdm_directory.get() == d) {
                        return;
                }
                _default_kdm_directory = d;
-               changed ();
+               changed();
        }
 
-       std::string mail_server () const {
+       std::string mail_server() const {
                return _mail_server;
        }
 
-       int mail_port () const {
+       int mail_port() const {
                return _mail_port;
        }
 
-       EmailProtocol mail_protocol () const {
+       EmailProtocol mail_protocol() const {
                return _mail_protocol;
        }
 
-       std::string mail_user () const {
+       std::string mail_user() const {
                return _mail_user;
        }
 
-       std::string mail_password () const {
+       std::string mail_password() const {
                return _mail_password;
        }
 
-       std::string kdm_subject () const {
+       std::string kdm_subject() const {
                return _kdm_subject;
        }
 
-       std::string kdm_from () const {
+       std::string kdm_from() const {
                return _kdm_from;
        }
 
-       std::vector<std::string> kdm_cc () const {
+       std::vector<std::string> kdm_cc() const {
                return _kdm_cc;
        }
 
-       std::string kdm_bcc () const {
+       std::string kdm_bcc() const {
                return _kdm_bcc;
        }
 
-       std::string kdm_email () const {
+       std::string kdm_email() const {
                return _kdm_email;
        }
 
-       std::string notification_subject () const {
+       std::string notification_subject() const {
                return _notification_subject;
        }
 
-       std::string notification_from () const {
+       std::string notification_from() const {
                return _notification_from;
        }
 
-       std::string notification_to () const {
+       std::string notification_to() const {
                return _notification_to;
        }
 
-       std::vector<std::string> notification_cc () const {
+       std::vector<std::string> notification_cc() const {
                return _notification_cc;
        }
 
-       std::string notification_bcc () const {
+       std::string notification_bcc() const {
                return _notification_bcc;
        }
 
-       std::string notification_email () const {
+       std::string notification_email() const {
                return _notification_email;
        }
 
-       std::shared_ptr<const dcp::CertificateChain> signer_chain () const {
+       std::shared_ptr<const dcp::CertificateChain> signer_chain() const {
                return _signer_chain;
        }
 
-       std::shared_ptr<const dcp::CertificateChain> decryption_chain () const {
+       std::shared_ptr<const dcp::CertificateChain> decryption_chain() const {
                return _decryption_chain;
        }
 
-       bool check_for_updates () const {
+       bool check_for_updates() const {
                return _check_for_updates;
        }
 
-       bool check_for_test_updates () const {
+       bool check_for_test_updates() const {
                return _check_for_test_updates;
        }
 
@@ -365,73 +365,73 @@ public:
                return _maximum_video_bit_rate[encoding];
        }
 
-       int log_types () const {
+       int log_types() const {
                return _log_types;
        }
 
-       bool analyse_ebur128 () const {
+       bool analyse_ebur128() const {
                return _analyse_ebur128;
        }
 
-       bool automatic_audio_analysis () const {
+       bool automatic_audio_analysis() const {
                return _automatic_audio_analysis;
        }
 
 #ifdef DCPOMATIC_WINDOWS
-       bool win32_console () const {
+       bool win32_console() const {
                return _win32_console;
        }
 #endif
 
-       std::vector<boost::filesystem::path> history () const {
+       std::vector<boost::filesystem::path> history() const {
                return _history;
        }
 
-       std::vector<boost::filesystem::path> player_history () const {
+       std::vector<boost::filesystem::path> player_history() const {
                return _player_history;
        }
 
-       std::shared_ptr<DKDMGroup> dkdms () const {
+       std::shared_ptr<DKDMGroup> dkdms() const {
                return _dkdms;
        }
 
-       boost::filesystem::path cinemas_file () const {
+       boost::filesystem::path cinemas_file() const {
                return _cinemas_file;
        }
 
-       boost::filesystem::path dkdm_recipients_file () const {
+       boost::filesystem::path dkdm_recipients_file() const {
                return _dkdm_recipients_file;
        }
 
-       bool show_hints_before_make_dcp () const {
+       bool show_hints_before_make_dcp() const {
                return _show_hints_before_make_dcp;
        }
 
-       bool confirm_kdm_email () const {
+       bool confirm_kdm_email() const {
                return _confirm_kdm_email;
        }
 
-       dcp::NameFormat kdm_container_name_format () const {
+       dcp::NameFormat kdm_container_name_format() const {
                return _kdm_container_name_format;
        }
 
-       dcp::NameFormat kdm_filename_format () const {
+       dcp::NameFormat kdm_filename_format() const {
                return _kdm_filename_format;
        }
 
-       dcp::NameFormat dkdm_filename_format () const {
+       dcp::NameFormat dkdm_filename_format() const {
                return _dkdm_filename_format;
        }
 
-       dcp::NameFormat dcp_metadata_filename_format () const {
+       dcp::NameFormat dcp_metadata_filename_format() const {
                return _dcp_metadata_filename_format;
        }
 
-       dcp::NameFormat dcp_asset_filename_format () const {
+       dcp::NameFormat dcp_asset_filename_format() const {
                return _dcp_asset_filename_format;
        }
 
-       bool jump_to_selected () const {
+       bool jump_to_selected() const {
                return _jump_to_selected;
        }
 
@@ -452,23 +452,23 @@ public:
                NAG_COUNT
        };
 
-       bool nagged (Nag nag) const {
+       bool nagged(Nag nag) const {
                return _nagged[nag];
        }
 
-       bool sound () const {
+       bool sound() const {
                return _sound;
        }
 
-       std::string cover_sheet () const {
+       std::string cover_sheet() const {
                return _cover_sheet;
        }
 
-       boost::optional<std::string> sound_output () const {
+       boost::optional<std::string> sound_output() const {
                return _sound_output;
        }
 
-       boost::optional<boost::filesystem::path> last_player_load_directory () const {
+       boost::optional<boost::filesystem::path> last_player_load_directory() const {
                return _last_player_load_directory;
        }
 
@@ -478,7 +478,7 @@ public:
                KDM_WRITE_ZIP
        };
 
-       boost::optional<KDMWriteType> last_kdm_write_type () const {
+       boost::optional<KDMWriteType> last_kdm_write_type() const {
                return _last_kdm_write_type;
        }
 
@@ -487,19 +487,19 @@ public:
                DKDM_WRITE_FILE
        };
 
-       boost::optional<DKDMWriteType> last_dkdm_write_type () const {
+       boost::optional<DKDMWriteType> last_dkdm_write_type() const {
                return _last_dkdm_write_type;
        }
 
-       int frames_in_memory_multiplier () const {
+       int frames_in_memory_multiplier() const {
                return _frames_in_memory_multiplier;
        }
 
-       boost::optional<int> decode_reduction () const {
+       boost::optional<int> decode_reduction() const {
                return _decode_reduction;
        }
 
-       bool default_notify () const {
+       bool default_notify() const {
                return _default_notify;
        }
 
@@ -509,31 +509,31 @@ public:
                NOTIFICATION_COUNT
        };
 
-       bool notification (Notification n) const {
+       bool notification(Notification n) const {
                return _notification[n];
        }
 
-       boost::optional<std::string> barco_username () const {
+       boost::optional<std::string> barco_username() const {
                return _barco_username;
        }
 
-       boost::optional<std::string> barco_password () const {
+       boost::optional<std::string> barco_password() const {
                return _barco_password;
        }
 
-       boost::optional<std::string> christie_username () const {
+       boost::optional<std::string> christie_username() const {
                return _christie_username;
        }
 
-       boost::optional<std::string> christie_password () const {
+       boost::optional<std::string> christie_password() const {
                return _christie_password;
        }
 
-       boost::optional<std::string> gdc_username () const {
+       boost::optional<std::string> gdc_username() const {
                return _gdc_username;
        }
 
-       boost::optional<std::string> gdc_password () const {
+       boost::optional<std::string> gdc_password() const {
                return _gdc_password;
        }
 
@@ -543,7 +543,7 @@ public:
                PLAYER_MODE_DUAL    ///< image on one monitor and extended controls on the other
        };
 
-       PlayerMode player_mode () const {
+       PlayerMode player_mode() const {
                return _player_mode;
        }
 
@@ -555,7 +555,7 @@ public:
                return _playlist_editor_restricted_menus;
        }
 
-       int image_display () const {
+       int image_display() const {
                return _image_display;
        }
 
@@ -564,63 +564,63 @@ public:
                VIDEO_VIEW_OPENGL
        };
 
-       VideoViewType video_view_type () const {
+       VideoViewType video_view_type() const {
                return _video_view_type;
        }
 
-       bool respect_kdm_validity_periods () const {
+       bool respect_kdm_validity_periods() const {
                return _respect_kdm_validity_periods;
        }
 
-       boost::optional<boost::filesystem::path> player_debug_log_file () const {
+       boost::optional<boost::filesystem::path> player_debug_log_file() const {
                return _player_debug_log_file;
        }
 
-       boost::optional<boost::filesystem::path> player_content_directory () const {
+       boost::optional<boost::filesystem::path> player_content_directory() const {
                return _player_content_directory;
        }
 
-       boost::optional<boost::filesystem::path> player_playlist_directory () const {
+       boost::optional<boost::filesystem::path> player_playlist_directory() const {
                return _player_playlist_directory;
        }
 
-       boost::optional<boost::filesystem::path> player_kdm_directory () const {
+       boost::optional<boost::filesystem::path> player_kdm_directory() const {
                return _player_kdm_directory;
        }
 
-       AudioMapping audio_mapping (int output_channels);
+       AudioMapping audio_mapping(int output_channels);
 
-       std::vector<dcp::LanguageTag> custom_languages () const {
+       std::vector<dcp::LanguageTag> custom_languages() const {
                return _custom_languages;
        }
 
        boost::optional<boost::filesystem::path> initial_path(std::string id) const;
 
-       bool use_isdcf_name_by_default () const {
+       bool use_isdcf_name_by_default() const {
                return _use_isdcf_name_by_default;
        }
 
-       bool write_kdms_to_disk () const {
+       bool write_kdms_to_disk() const {
                return _write_kdms_to_disk;
        }
 
-       bool email_kdms () const {
+       bool email_kdms() const {
                return _email_kdms;
        }
 
-       dcp::Formulation default_kdm_type () const {
+       dcp::Formulation default_kdm_type() const {
                return _default_kdm_type;
        }
 
-       RoughDuration default_kdm_duration () const {
+       RoughDuration default_kdm_duration() const {
                return _default_kdm_duration;
        }
 
-       double auto_crop_threshold () const {
+       double auto_crop_threshold() const {
                return _auto_crop_threshold;
        }
 
-       boost::optional<std::string> last_release_notes_version () const {
+       boost::optional<std::string> last_release_notes_version() const {
                return _last_release_notes_version;
        }
 
@@ -688,33 +688,33 @@ public:
 
        /* SET (mostly) */
 
-       void set_master_encoding_threads (int n) {
-               maybe_set (_master_encoding_threads, n);
+       void set_master_encoding_threads(int n) {
+               maybe_set(_master_encoding_threads, n);
        }
 
-       void set_server_encoding_threads (int n) {
-               maybe_set (_server_encoding_threads, n);
+       void set_server_encoding_threads(int n) {
+               maybe_set(_server_encoding_threads, n);
        }
 
-       void set_default_directory (boost::filesystem::path d) {
+       void set_default_directory(boost::filesystem::path d) {
                if (_default_directory && *_default_directory == d) {
                        return;
                }
                _default_directory = d;
-               changed ();
+               changed();
        }
 
        /** @param p New server port */
-       void set_server_port_base (int p) {
-               maybe_set (_server_port_base, p);
+       void set_server_port_base(int p) {
+               maybe_set(_server_port_base, p);
        }
 
-       void set_only_servers_encode (bool o) {
-               maybe_set (_only_servers_encode, o);
+       void set_only_servers_encode(bool o) {
+               maybe_set(_only_servers_encode, o);
        }
 
-       void set_tms_protocol (FileTransferProtocol p) {
-               maybe_set (_tms_protocol, p);
+       void set_tms_protocol(FileTransferProtocol p) {
+               maybe_set(_tms_protocol, p);
        }
 
        void set_tms_passive(bool passive) {
@@ -722,96 +722,96 @@ public:
        }
 
        /** @param i IP address of a TMS that we can copy DCPs to */
-       void set_tms_ip (std::string i) {
-               maybe_set (_tms_ip, i);
+       void set_tms_ip(std::string i) {
+               maybe_set(_tms_ip, i);
        }
 
        /** @param p Path on a TMS that we should changed DCPs to */
-       void set_tms_path (std::string p) {
-               maybe_set (_tms_path, p);
+       void set_tms_path(std::string p) {
+               maybe_set(_tms_path, p);
        }
 
        /** @param u User name to log into the TMS with */
-       void set_tms_user (std::string u) {
-               maybe_set (_tms_user, u);
+       void set_tms_user(std::string u) {
+               maybe_set(_tms_user, u);
        }
 
        /** @param p Password to log into the TMS with */
-       void set_tms_password (std::string p) {
-               maybe_set (_tms_password, p);
+       void set_tms_password(std::string p) {
+               maybe_set(_tms_password, p);
        }
 
-       void set_allowed_dcp_frame_rates (std::list<int> const & r) {
-               maybe_set (_allowed_dcp_frame_rates, r);
+       void set_allowed_dcp_frame_rates(std::list<int> const & r) {
+               maybe_set(_allowed_dcp_frame_rates, r);
        }
 
-       void set_allow_any_dcp_frame_rate (bool a) {
-               maybe_set (_allow_any_dcp_frame_rate, a);
+       void set_allow_any_dcp_frame_rate(bool a) {
+               maybe_set(_allow_any_dcp_frame_rate, a);
        }
 
-       void set_allow_any_container (bool a) {
+       void set_allow_any_container(bool a) {
                maybe_set(_allow_any_container, a, ALLOW_ANY_CONTAINER);
        }
 
-       void set_allow_96hhz_audio (bool a) {
-               maybe_set (_allow_96khz_audio, a);
+       void set_allow_96hhz_audio(bool a) {
+               maybe_set(_allow_96khz_audio, a);
        }
 
-       void set_use_all_audio_channels (bool a) {
-               maybe_set (_use_all_audio_channels, a);
+       void set_use_all_audio_channels(bool a) {
+               maybe_set(_use_all_audio_channels, a);
        }
 
-       void set_show_experimental_audio_processors (bool e) {
-               maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
+       void set_show_experimental_audio_processors(bool e) {
+               maybe_set(_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
        }
 
-       void set_language (std::string l) {
+       void set_language(std::string l) {
                if (_language && _language.get() == l) {
                        return;
                }
                _language = l;
-               changed ();
+               changed();
        }
 
-       void unset_language () {
+       void unset_language() {
                if (!_language) {
                        return;
                }
 
                _language = boost::none;
-               changed ();
+               changed();
        }
 
-       void set_default_still_length (int s) {
-               maybe_set (_default_still_length, s);
+       void set_default_still_length(int s) {
+               maybe_set(_default_still_length, s);
        }
 
-       void set_dcp_issuer (std::string i) {
-               maybe_set (_dcp_issuer, i);
+       void set_dcp_issuer(std::string i) {
+               maybe_set(_dcp_issuer, i);
        }
 
-       void set_dcp_creator (std::string c) {
-               maybe_set (_dcp_creator, c);
+       void set_dcp_creator(std::string c) {
+               maybe_set(_dcp_creator, c);
        }
 
-       void set_dcp_company_name (std::string c) {
-               maybe_set (_dcp_company_name, c);
+       void set_dcp_company_name(std::string c) {
+               maybe_set(_dcp_company_name, c);
        }
 
-       void set_dcp_product_name (std::string c) {
-               maybe_set (_dcp_product_name, c);
+       void set_dcp_product_name(std::string c) {
+               maybe_set(_dcp_product_name, c);
        }
 
-       void set_dcp_product_version (std::string c) {
-               maybe_set (_dcp_product_version, c);
+       void set_dcp_product_version(std::string c) {
+               maybe_set(_dcp_product_version, c);
        }
 
-       void set_dcp_j2k_comment (std::string c) {
-               maybe_set (_dcp_j2k_comment, c);
+       void set_dcp_j2k_comment(std::string c) {
+               maybe_set(_dcp_j2k_comment, c);
        }
 
-       void set_default_audio_delay (int d) {
-               maybe_set (_default_audio_delay, d);
+       void set_default_audio_delay(int d) {
+               maybe_set(_default_audio_delay, d);
        }
 
        void set_default_audio_language(dcp::LanguageTag tag) {
@@ -822,157 +822,157 @@ public:
                maybe_set(_default_audio_language, boost::optional<dcp::LanguageTag>());
        }
 
-       void set_upload_after_make_dcp (bool u) {
-               maybe_set (_upload_after_make_dcp, u);
+       void set_upload_after_make_dcp(bool u) {
+               maybe_set(_upload_after_make_dcp, u);
        }
 
-       void set_mail_server (std::string s) {
-               maybe_set (_mail_server, s);
+       void set_mail_server(std::string s) {
+               maybe_set(_mail_server, s);
        }
 
-       void set_mail_port (int p) {
-               maybe_set (_mail_port, p);
+       void set_mail_port(int p) {
+               maybe_set(_mail_port, p);
        }
 
-       void set_mail_protocol (EmailProtocol p) {
-               maybe_set (_mail_protocol, p);
+       void set_mail_protocol(EmailProtocol p) {
+               maybe_set(_mail_protocol, p);
        }
 
-       void set_mail_user (std::string u) {
-               maybe_set (_mail_user, u);
+       void set_mail_user(std::string u) {
+               maybe_set(_mail_user, u);
        }
 
-       void set_mail_password (std::string p) {
-               maybe_set (_mail_password, p);
+       void set_mail_password(std::string p) {
+               maybe_set(_mail_password, p);
        }
 
-       void set_kdm_subject (std::string s) {
-               maybe_set (_kdm_subject, s);
+       void set_kdm_subject(std::string s) {
+               maybe_set(_kdm_subject, s);
        }
 
-       void set_kdm_from (std::string f) {
-               maybe_set (_kdm_from, f);
+       void set_kdm_from(std::string f) {
+               maybe_set(_kdm_from, f);
        }
 
-       void set_kdm_cc (std::vector<std::string> f) {
-               maybe_set (_kdm_cc, f);
+       void set_kdm_cc(std::vector<std::string> f) {
+               maybe_set(_kdm_cc, f);
        }
 
-       void set_kdm_bcc (std::string f) {
-               maybe_set (_kdm_bcc, f);
+       void set_kdm_bcc(std::string f) {
+               maybe_set(_kdm_bcc, f);
        }
 
-       void set_kdm_email (std::string e) {
-               maybe_set (_kdm_email, e);
+       void set_kdm_email(std::string e) {
+               maybe_set(_kdm_email, e);
        }
 
-       void reset_kdm_email ();
+       void reset_kdm_email();
 
-       void set_notification_subject (std::string s) {
-               maybe_set (_notification_subject, s);
+       void set_notification_subject(std::string s) {
+               maybe_set(_notification_subject, s);
        }
 
-       void set_notification_from (std::string f) {
-               maybe_set (_notification_from, f);
+       void set_notification_from(std::string f) {
+               maybe_set(_notification_from, f);
        }
 
-       void set_notification_to (std::string t) {
-               maybe_set (_notification_to, t);
+       void set_notification_to(std::string t) {
+               maybe_set(_notification_to, t);
        }
 
-       void set_notification_cc (std::vector<std::string> f) {
-               maybe_set (_notification_cc, f);
+       void set_notification_cc(std::vector<std::string> f) {
+               maybe_set(_notification_cc, f);
        }
 
-       void set_notification_bcc (std::string f) {
-               maybe_set (_notification_bcc, f);
+       void set_notification_bcc(std::string f) {
+               maybe_set(_notification_bcc, f);
        }
 
-       void set_notification_email (std::string e) {
-               maybe_set (_notification_email, e);
+       void set_notification_email(std::string e) {
+               maybe_set(_notification_email, e);
        }
 
-       void reset_notification_email ();
+       void reset_notification_email();
 
-       void set_signer_chain (std::shared_ptr<const dcp::CertificateChain> s) {
-               maybe_set (_signer_chain, s);
+       void set_signer_chain(std::shared_ptr<const dcp::CertificateChain> s) {
+               maybe_set(_signer_chain, s);
        }
 
-       void set_decryption_chain (std::shared_ptr<const dcp::CertificateChain> c) {
-               maybe_set (_decryption_chain, c);
+       void set_decryption_chain(std::shared_ptr<const dcp::CertificateChain> c) {
+               maybe_set(_decryption_chain, c);
        }
 
-       void set_check_for_updates (bool c) {
-               maybe_set (_check_for_updates, c);
+       void set_check_for_updates(bool c) {
+               maybe_set(_check_for_updates, c);
                if (!c) {
-                       set_check_for_test_updates (false);
+                       set_check_for_test_updates(false);
                }
        }
 
-       void set_check_for_test_updates (bool c) {
-               maybe_set (_check_for_test_updates, c);
+       void set_check_for_test_updates(bool c) {
+               maybe_set(_check_for_test_updates, c);
        }
 
        void set_maximum_video_bit_rate(VideoEncoding encoding, int64_t b) {
                maybe_set(_maximum_video_bit_rate[encoding], b);
        }
 
-       void set_log_types (int t) {
-               maybe_set (_log_types, t);
+       void set_log_types(int t) {
+               maybe_set(_log_types, t);
        }
 
-       void set_analyse_ebur128 (bool a) {
-               maybe_set (_analyse_ebur128, a);
+       void set_analyse_ebur128(bool a) {
+               maybe_set(_analyse_ebur128, a);
        }
 
-       void set_automatic_audio_analysis (bool a) {
-               maybe_set (_automatic_audio_analysis, a);
+       void set_automatic_audio_analysis(bool a) {
+               maybe_set(_automatic_audio_analysis, a);
        }
 
 #ifdef DCPOMATIC_WINDOWS
-       void set_win32_console (bool c) {
-               maybe_set (_win32_console, c);
+       void set_win32_console(bool c) {
+               maybe_set(_win32_console, c);
        }
 #endif
 
-       void set_dkdms (std::shared_ptr<DKDMGroup> dkdms) {
+       void set_dkdms(std::shared_ptr<DKDMGroup> dkdms) {
                _dkdms = dkdms;
-               changed ();
+               changed();
        }
 
-       void set_cinemas_file (boost::filesystem::path file);
+       void set_cinemas_file(boost::filesystem::path file);
 
        void set_dkdm_recipients_file(boost::filesystem::path file);
 
-       void set_show_hints_before_make_dcp (bool s) {
-               maybe_set (_show_hints_before_make_dcp, s);
+       void set_show_hints_before_make_dcp(bool s) {
+               maybe_set(_show_hints_before_make_dcp, s);
        }
 
-       void set_confirm_kdm_email (bool s) {
-               maybe_set (_confirm_kdm_email, s);
+       void set_confirm_kdm_email(bool s) {
+               maybe_set(_confirm_kdm_email, s);
        }
 
-       void set_sound (bool s) {
-               maybe_set (_sound, s, SOUND);
+       void set_sound(bool s) {
+               maybe_set(_sound, s, SOUND);
        }
 
-       void set_sound_output (std::string o) {
-               maybe_set (_sound_output, o, SOUND_OUTPUT);
+       void set_sound_output(std::string o) {
+               maybe_set(_sound_output, o, SOUND_OUTPUT);
        }
 
-       void set_last_player_load_directory (boost::filesystem::path d) {
-               maybe_set (_last_player_load_directory, d);
+       void set_last_player_load_directory(boost::filesystem::path d) {
+               maybe_set(_last_player_load_directory, d);
        }
 
-       void set_last_kdm_write_type (KDMWriteType t) {
-               maybe_set (_last_kdm_write_type, t);
+       void set_last_kdm_write_type(KDMWriteType t) {
+               maybe_set(_last_kdm_write_type, t);
        }
 
-       void set_last_dkdm_write_type (DKDMWriteType t) {
-               maybe_set (_last_dkdm_write_type, t);
+       void set_last_dkdm_write_type(DKDMWriteType t) {
+               maybe_set(_last_dkdm_write_type, t);
        }
 
-       void unset_sound_output () {
+       void unset_sound_output() {
                if (!_sound_output) {
                        return;
                }
@@ -981,216 +981,216 @@ public:
                changed(SOUND_OUTPUT);
        }
 
-       void set_kdm_container_name_format (dcp::NameFormat n) {
-               maybe_set (_kdm_container_name_format, n);
+       void set_kdm_container_name_format(dcp::NameFormat n) {
+               maybe_set(_kdm_container_name_format, n);
        }
 
-       void set_kdm_filename_format (dcp::NameFormat n) {
-               maybe_set (_kdm_filename_format, n);
+       void set_kdm_filename_format(dcp::NameFormat n) {
+               maybe_set(_kdm_filename_format, n);
        }
 
-       void set_dkdm_filename_format (dcp::NameFormat n) {
-               maybe_set (_dkdm_filename_format, n);
+       void set_dkdm_filename_format(dcp::NameFormat n) {
+               maybe_set(_dkdm_filename_format, n);
        }
 
-       void set_dcp_metadata_filename_format (dcp::NameFormat n) {
-               maybe_set (_dcp_metadata_filename_format, n);
+       void set_dcp_metadata_filename_format(dcp::NameFormat n) {
+               maybe_set(_dcp_metadata_filename_format, n);
        }
 
-       void set_dcp_asset_filename_format (dcp::NameFormat n) {
-               maybe_set (_dcp_asset_filename_format, n);
+       void set_dcp_asset_filename_format(dcp::NameFormat n) {
+               maybe_set(_dcp_asset_filename_format, n);
        }
 
-       void set_frames_in_memory_multiplier (int m) {
-               maybe_set (_frames_in_memory_multiplier, m);
+       void set_frames_in_memory_multiplier(int m) {
+               maybe_set(_frames_in_memory_multiplier, m);
        }
 
-       void set_decode_reduction (boost::optional<int> r) {
-               maybe_set (_decode_reduction, r);
+       void set_decode_reduction(boost::optional<int> r) {
+               maybe_set(_decode_reduction, r);
        }
 
-       void set_default_notify (bool n) {
-               maybe_set (_default_notify, n);
+       void set_default_notify(bool n) {
+               maybe_set(_default_notify, n);
        }
 
-       void clear_history () {
-               _history.clear ();
-               changed ();
+       void clear_history() {
+               _history.clear();
+               changed();
        }
 
-       void clear_player_history () {
-               _player_history.clear ();
-               changed ();
+       void clear_player_history() {
+               _player_history.clear();
+               changed();
        }
 
-       void add_to_history (boost::filesystem::path p);
-       void clean_history ();
-       void add_to_player_history (boost::filesystem::path p);
-       void clean_player_history ();
+       void add_to_history(boost::filesystem::path p);
+       void clean_history();
+       void add_to_player_history(boost::filesystem::path p);
+       void clean_player_history();
 
-       void set_jump_to_selected (bool j) {
-               maybe_set (_jump_to_selected, j);
+       void set_jump_to_selected(bool j) {
+               maybe_set(_jump_to_selected, j);
        }
 
-       void set_nagged (Nag nag, bool nagged) {
-               maybe_set (_nagged[nag], nagged);
+       void set_nagged(Nag nag, bool nagged) {
+               maybe_set(_nagged[nag], nagged);
        }
 
-       void set_cover_sheet (std::string s) {
-               maybe_set (_cover_sheet, s);
+       void set_cover_sheet(std::string s) {
+               maybe_set(_cover_sheet, s);
        }
 
-       void reset_cover_sheet ();
+       void reset_cover_sheet();
 
-       void set_notification (Notification n, bool v) {
-               maybe_set (_notification[n], v);
+       void set_notification(Notification n, bool v) {
+               maybe_set(_notification[n], v);
        }
 
-       void set_barco_username (std::string u) {
-               maybe_set (_barco_username, u);
+       void set_barco_username(std::string u) {
+               maybe_set(_barco_username, u);
        }
 
-       void unset_barco_username () {
-               maybe_set (_barco_username, boost::optional<std::string>());
+       void unset_barco_username() {
+               maybe_set(_barco_username, boost::optional<std::string>());
        }
 
-       void set_barco_password (std::string p) {
-               maybe_set (_barco_password, p);
+       void set_barco_password(std::string p) {
+               maybe_set(_barco_password, p);
        }
 
-       void unset_barco_password () {
-               maybe_set (_barco_password, boost::optional<std::string>());
+       void unset_barco_password() {
+               maybe_set(_barco_password, boost::optional<std::string>());
        }
 
-       void set_christie_username (std::string u) {
-               maybe_set (_christie_username, u);
+       void set_christie_username(std::string u) {
+               maybe_set(_christie_username, u);
        }
 
-       void unset_christie_username () {
-               maybe_set (_christie_username, boost::optional<std::string>());
+       void unset_christie_username() {
+               maybe_set(_christie_username, boost::optional<std::string>());
        }
 
-       void set_christie_password (std::string p) {
-               maybe_set (_christie_password, p);
+       void set_christie_password(std::string p) {
+               maybe_set(_christie_password, p);
        }
 
-       void unset_christie_password () {
-               maybe_set (_christie_password, boost::optional<std::string>());
+       void unset_christie_password() {
+               maybe_set(_christie_password, boost::optional<std::string>());
        }
 
-       void set_gdc_username (std::string u) {
-               maybe_set (_gdc_username, u);
+       void set_gdc_username(std::string u) {
+               maybe_set(_gdc_username, u);
        }
 
-       void unset_gdc_username () {
-               maybe_set (_gdc_username, boost::optional<std::string>());
+       void unset_gdc_username() {
+               maybe_set(_gdc_username, boost::optional<std::string>());
        }
 
-       void set_gdc_password (std::string p) {
-               maybe_set (_gdc_password, p);
+       void set_gdc_password(std::string p) {
+               maybe_set(_gdc_password, p);
        }
 
-       void unset_gdc_password () {
-               maybe_set (_gdc_password, boost::optional<std::string>());
+       void unset_gdc_password() {
+               maybe_set(_gdc_password, boost::optional<std::string>());
        }
 
-       void set_player_mode (PlayerMode m) {
-               maybe_set (_player_mode, m);
+       void set_player_mode(PlayerMode m) {
+               maybe_set(_player_mode, m);
        }
 
-       void set_image_display (int n) {
-               maybe_set (_image_display, n);
+       void set_image_display(int n) {
+               maybe_set(_image_display, n);
        }
 
-       void set_video_view_type (VideoViewType v) {
-               maybe_set (_video_view_type, v);
+       void set_video_view_type(VideoViewType v) {
+               maybe_set(_video_view_type, v);
        }
 
-       void set_respect_kdm_validity_periods (bool r) {
-               maybe_set (_respect_kdm_validity_periods, r);
+       void set_respect_kdm_validity_periods(bool r) {
+               maybe_set(_respect_kdm_validity_periods, r);
        }
 
-       void set_player_debug_log_file (boost::filesystem::path p) {
-               maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
+       void set_player_debug_log_file(boost::filesystem::path p) {
+               maybe_set(_player_debug_log_file, p, PLAYER_DEBUG_LOG);
        }
 
-       void unset_player_debug_log_file () {
+       void unset_player_debug_log_file() {
                if (!_player_debug_log_file) {
                        return;
                }
                _player_debug_log_file = boost::none;
-               changed (PLAYER_DEBUG_LOG);
+               changed(PLAYER_DEBUG_LOG);
        }
 
-       void set_player_content_directory (boost::filesystem::path p) {
-               maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
+       void set_player_content_directory(boost::filesystem::path p) {
+               maybe_set(_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
        }
 
-       void unset_player_content_directory () {
+       void unset_player_content_directory() {
                if (!_player_content_directory) {
                        return;
                }
                _player_content_directory = boost::none;
-               changed (PLAYER_CONTENT_DIRECTORY);
+               changed(PLAYER_CONTENT_DIRECTORY);
        }
 
-       void set_player_playlist_directory (boost::filesystem::path p) {
-               maybe_set (_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
+       void set_player_playlist_directory(boost::filesystem::path p) {
+               maybe_set(_player_playlist_directory, p, PLAYER_PLAYLIST_DIRECTORY);
        }
 
-       void unset_player_playlist_directory () {
+       void unset_player_playlist_directory() {
                if (!_player_playlist_directory) {
                        return;
                }
                _player_playlist_directory = boost::none;
-               changed (PLAYER_PLAYLIST_DIRECTORY);
+               changed(PLAYER_PLAYLIST_DIRECTORY);
        }
 
-       void set_player_kdm_directory (boost::filesystem::path p) {
-               maybe_set (_player_kdm_directory, p);
+       void set_player_kdm_directory(boost::filesystem::path p) {
+               maybe_set(_player_kdm_directory, p);
        }
 
-       void unset_player_kdm_directory () {
+       void unset_player_kdm_directory() {
                if (!_player_kdm_directory) {
                        return;
                }
                _player_kdm_directory = boost::none;
-               changed ();
+               changed();
        }
 
-       void set_audio_mapping (AudioMapping m);
-       void set_audio_mapping_to_default ();
+       void set_audio_mapping(AudioMapping m);
+       void set_audio_mapping_to_default();
 
-       void add_custom_language (dcp::LanguageTag tag);
+       void add_custom_language(dcp::LanguageTag tag);
 
        void set_initial_path(std::string id, boost::filesystem::path path);
 
-       void set_use_isdcf_name_by_default (bool use) {
-               maybe_set (_use_isdcf_name_by_default, use);
+       void set_use_isdcf_name_by_default(bool use) {
+               maybe_set(_use_isdcf_name_by_default, use);
        }
 
-       void set_write_kdms_to_disk (bool write) {
-               maybe_set (_write_kdms_to_disk, write);
+       void set_write_kdms_to_disk(bool write) {
+               maybe_set(_write_kdms_to_disk, write);
        }
 
-       void set_email_kdms (bool email) {
-               maybe_set (_email_kdms, email);
+       void set_email_kdms(bool email) {
+               maybe_set(_email_kdms, email);
        }
 
-       void set_default_kdm_type (dcp::Formulation type) {
-               maybe_set (_default_kdm_type, type);
+       void set_default_kdm_type(dcp::Formulation type) {
+               maybe_set(_default_kdm_type, type);
        }
 
-       void set_default_kdm_duration (RoughDuration duration) {
-               maybe_set (_default_kdm_duration, duration);
+       void set_default_kdm_duration(RoughDuration duration) {
+               maybe_set(_default_kdm_duration, duration);
        }
 
-       void set_auto_crop_threshold (double threshold) {
-               maybe_set (_auto_crop_threshold, threshold, AUTO_CROP_THRESHOLD);
+       void set_auto_crop_threshold(double threshold) {
+               maybe_set(_auto_crop_threshold, threshold, AUTO_CROP_THRESHOLD);
        }
 
-       void set_last_release_notes_version (std::string version) {
-               maybe_set (_last_release_notes_version, version);
+       void set_last_release_notes_version(std::string version) {
+               maybe_set(_last_release_notes_version, version);
        }
 
        void unset_last_release_notes_version() {
@@ -1242,7 +1242,7 @@ public:
        }
 
 
-       void changed (Property p = OTHER);
+       void changed(Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
        /** Emitted if read() failed on an existing Config file.  There is nothing
            a listener can do about it: this is just for information.
@@ -1266,64 +1266,64 @@ public:
 
        static boost::signals2::signal<bool (BadReason)> Bad;
 
-       void write () const override;
-       void write_config () const;
-       void link (boost::filesystem::path new_file) const;
-       void copy_and_link (boost::filesystem::path new_file) const;
-       bool have_write_permission () const;
+       void write() const override;
+       void write_config() const;
+       void link(boost::filesystem::path new_file) const;
+       void copy_and_link(boost::filesystem::path new_file) const;
+       bool have_write_permission() const;
 
        void save_default_template(std::shared_ptr<const Film> film) const;
-       void save_template (std::shared_ptr<const Film> film, std::string name) const;
-       bool existing_template (std::string name) const;
-       /** @return Template names (not including the default) */
+       void save_template(std::shared_ptr<const Film> film, std::string name) const;
+       bool existing_template(std::string name) const;
+       /** @return Template names(not including the default) */
        std::vector<std::string> templates() const;
-       boost::filesystem::path template_read_path (std::string name) const;
+       boost::filesystem::path template_read_path(std::string name) const;
        boost::filesystem::path default_template_read_path() const;
-       void rename_template (std::string old_name, std::string new_name) const;
-       void delete_template (std::string name) const;
+       void rename_template(std::string old_name, std::string new_name) const;
+       void delete_template(std::string name) const;
 
-       boost::optional<BadReason> check_certificates () const;
+       boost::optional<BadReason> check_certificates() const;
 
-       static Config* instance ();
-       static void drop ();
-       static void restore_defaults ();
-       static bool have_existing (std::string);
-       static boost::filesystem::path config_read_file ();
-       static boost::filesystem::path config_write_file ();
+       static Config* instance();
+       static void drop();
+       static void restore_defaults();
+       static bool have_existing(std::string);
+       static boost::filesystem::path config_read_file();
+       static boost::filesystem::path config_write_file();
        static bool zip_contains_cinemas(boost::filesystem::path zip);
        static boost::filesystem::path cinemas_file_from_zip(boost::filesystem::path zip);
 
 
        template <class T>
-       void maybe_set (T& member, T new_value, Property prop = OTHER) {
+       void maybe_set(T& member, T new_value, Property prop = OTHER) {
                if (member == new_value) {
                        return;
                }
                member = new_value;
-               changed (prop);
+               changed(prop);
        }
 
        template <class T>
-       void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
+       void maybe_set(boost::optional<T>& member, T new_value, Property prop = OTHER) {
                if (member && member.get() == new_value) {
                        return;
                }
                member = new_value;
-               changed (prop);
+               changed(prop);
        }
 
 private:
-       Config ();
-       void read () override;
-       void set_defaults ();
-       void set_kdm_email_to_default ();
-       void set_notification_email_to_default ();
-       void set_cover_sheet_to_default ();
-       std::shared_ptr<dcp::CertificateChain> create_certificate_chain ();
-       boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
-       void add_to_history_internal (std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
-       void clean_history_internal (std::vector<boost::filesystem::path>& h);
-       void backup ();
+       Config();
+       void read() override;
+       void set_defaults();
+       void set_kdm_email_to_default();
+       void set_notification_email_to_default();
+       void set_cover_sheet_to_default();
+       std::shared_ptr<dcp::CertificateChain> create_certificate_chain();
+       boost::filesystem::path directory_or(boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
+       void add_to_history_internal(std::vector<boost::filesystem::path>& h, boost::filesystem::path p);
+       void clean_history_internal(std::vector<boost::filesystem::path>& h);
+       void backup();
        boost::filesystem::path template_write_path(std::string name) const;
 
        /** number of threads which a master DoM should use for J2K encoding on the local machine */
index 7048435b554a9296b74ebb5954e13b0fcd526b31..89df880d861b358ef73204505c38f96d1f354730 100644 (file)
@@ -97,9 +97,9 @@ int const PlayerProperty::ALWAYS_BURN_OPEN_SUBTITLES = 709;
 int const PlayerProperty::PLAY_REFERENCED = 710;
 
 
-Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment, bool tolerant)
-       : _film (film)
-       , _suspended (0)
+Player::Player(shared_ptr<const Film> film, Image::Alignment subtitle_alignment, bool tolerant)
+       : _film(film)
+       , _suspended(0)
        , _ignore_video(false)
        , _ignore_audio(false)
        , _ignore_text(false)
@@ -108,16 +108,16 @@ Player::Player (shared_ptr<const Film> film, Image::Alignment subtitle_alignment
        , _tolerant(tolerant)
        , _play_referenced(false)
        , _audio_merger(film->audio_frame_rate())
-       , _subtitle_alignment (subtitle_alignment)
+       , _subtitle_alignment(subtitle_alignment)
 {
-       construct ();
+       construct();
 }
 
 
 Player::Player(shared_ptr<const Film> film, shared_ptr<const Playlist> playlist_, bool tolerant)
-       : _film (film)
-       , _playlist (playlist_)
-       , _suspended (0)
+       : _film(film)
+       , _playlist(playlist_)
+       , _suspended(0)
        , _ignore_video(false)
        , _ignore_audio(false)
        , _ignore_text(false)
@@ -127,12 +127,12 @@ Player::Player(shared_ptr<const Film> film, shared_ptr<const Playlist> playlist_
        , _play_referenced(false)
        , _audio_merger(film->audio_frame_rate())
 {
-       construct ();
+       construct();
 }
 
 
 void
-Player::construct ()
+Player::construct()
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
@@ -142,8 +142,8 @@ Player::construct ()
 
        film_change(ChangeType::DONE, FilmProperty::AUDIO_PROCESSOR);
 
-       setup_pieces ();
-       seek (DCPTime (), true);
+       setup_pieces();
+       seek(DCPTime(), true);
 }
 
 
@@ -157,8 +157,8 @@ Player::connect()
        /* The butler must hear about this first, so since we are proxying this through to the butler we must
           be first.
        */
-       _playlist_change_connection = playlist()->Change.connect (bind (&Player::playlist_change, this, _1), boost::signals2::at_front);
-       _playlist_content_change_connection = playlist()->ContentChange.connect (bind(&Player::playlist_content_change, this, _1, _3, _4));
+       _playlist_change_connection = playlist()->Change.connect(bind(&Player::playlist_change, this, _1), boost::signals2::at_front);
+       _playlist_content_change_connection = playlist()->ContentChange.connect(bind(&Player::playlist_content_change, this, _1, _3, _4));
 }
 
 
@@ -239,26 +239,26 @@ Player::operator=(Player&& other)
 
 
 bool
-have_video (shared_ptr<const Content> content)
+have_video(shared_ptr<const Content> content)
 {
        return static_cast<bool>(content->video) && content->video->use() && content->can_be_played();
 }
 
 
 bool
-have_audio (shared_ptr<const Content> content)
+have_audio(shared_ptr<const Content> content)
 {
        return content->has_mapped_audio() && content->can_be_played();
 }
 
 
 void
-Player::setup_pieces ()
+Player::setup_pieces()
 {
-       boost::mutex::scoped_lock lm (_mutex);
+       boost::mutex::scoped_lock lm(_mutex);
 
        auto old_pieces = _pieces;
-       _pieces.clear ();
+       _pieces.clear();
 
        auto film = _film.lock();
        if (!film) {
@@ -301,58 +301,58 @@ Player::setup_pieces ()
                }
 
                auto decoder = decoder_factory(film, content, _fast, _tolerant, old_decoder);
-               DCPOMATIC_ASSERT (decoder);
+               DCPOMATIC_ASSERT(decoder);
 
                FrameRateChange frc(film, content);
 
                if (decoder->video && _ignore_video) {
-                       decoder->video->set_ignore (true);
+                       decoder->video->set_ignore(true);
                }
 
                if (decoder->audio && _ignore_audio) {
-                       decoder->audio->set_ignore (true);
+                       decoder->audio->set_ignore(true);
                }
 
                if (_ignore_text) {
                        for (auto i: decoder->text) {
-                               i->set_ignore (true);
+                               i->set_ignore(true);
                        }
                }
 
-               auto dcp = dynamic_pointer_cast<DCPDecoder> (decoder);
+               auto dcp = dynamic_pointer_cast<DCPDecoder>(decoder);
                if (dcp) {
-                       dcp->set_decode_referenced (_play_referenced);
+                       dcp->set_decode_referenced(_play_referenced);
                        if (_play_referenced) {
-                               dcp->set_forced_reduction (_dcp_decode_reduction);
+                               dcp->set_forced_reduction(_dcp_decode_reduction);
                        }
                }
 
                auto piece = make_shared<Piece>(content, decoder, frc);
-               _pieces.push_back (piece);
+               _pieces.push_back(piece);
 
                if (decoder->video) {
                        if (have_threed) {
                                /* We need a Shuffler to cope with 3D L/R video data arriving out of sequence */
-                               decoder->video->Data.connect (bind(&Shuffler::video, _shuffler.get(), weak_ptr<Piece>(piece), _1));
+                               decoder->video->Data.connect(bind(&Shuffler::video, _shuffler.get(), weak_ptr<Piece>(piece), _1));
                        } else {
-                               decoder->video->Data.connect (bind(&Player::video, this, weak_ptr<Piece>(piece), _1));
+                               decoder->video->Data.connect(bind(&Player::video, this, weak_ptr<Piece>(piece), _1));
                        }
                }
 
                if (decoder->audio) {
-                       decoder->audio->Data.connect (bind (&Player::audio, this, weak_ptr<Piece> (piece), _1, _2));
+                       decoder->audio->Data.connect(bind(&Player::audio, this, weak_ptr<Piece>(piece), _1, _2));
                }
 
                auto j = decoder->text.begin();
 
                while (j != decoder->text.end()) {
-                       (*j)->BitmapStart.connect (
+                       (*j)->BitmapStart.connect(
                                bind(&Player::bitmap_text_start, this, weak_ptr<Piece>(piece), weak_ptr<const TextContent>((*j)->content()), _1)
                                );
-                       (*j)->PlainStart.connect (
+                       (*j)->PlainStart.connect(
                                bind(&Player::plain_text_start, this, weak_ptr<Piece>(piece), weak_ptr<const TextContent>((*j)->content()), _1)
                                );
-                       (*j)->Stop.connect (
+                       (*j)->Stop.connect(
                                bind(&Player::subtitle_stop, this, weak_ptr<Piece>(piece), weak_ptr<const TextContent>((*j)->content()), _1)
                                );
 
@@ -360,11 +360,11 @@ Player::setup_pieces ()
                }
 
                if (decoder->atmos) {
-                       decoder->atmos->Data.connect (bind(&Player::atmos, this, weak_ptr<Piece>(piece), _1));
+                       decoder->atmos->Data.connect(bind(&Player::atmos, this, weak_ptr<Piece>(piece), _1));
                }
        }
 
-       _stream_states.clear ();
+       _stream_states.clear();
        for (auto i: _pieces) {
                if (i->content->has_mapped_audio()) {
                        for (auto j: i->content->audio->streams()) {
@@ -414,7 +414,7 @@ Player::setup_pieces ()
 
 
 void
-Player::playlist_content_change (ChangeType type, int property, bool frequent)
+Player::playlist_content_change(ChangeType type, int property, bool frequent)
 {
        auto film = _film.lock();
        if (!film) {
@@ -423,7 +423,7 @@ Player::playlist_content_change (ChangeType type, int property, bool frequent)
 
        if (property == VideoContentProperty::CROP) {
                if (type == ChangeType::DONE) {
-                       boost::mutex::scoped_lock lm (_mutex);
+                       boost::mutex::scoped_lock lm(_mutex);
                        for (auto const& i: _delay) {
                                i.first->reset_metadata(film, _video_container_size);
                        }
@@ -437,19 +437,19 @@ Player::playlist_content_change (ChangeType type, int property, bool frequent)
                        ++_suspended;
                } else if (type == ChangeType::DONE) {
                        /* A change in our content has gone through.  Re-build our pieces. */
-                       setup_pieces ();
+                       setup_pieces();
                        --_suspended;
                } else if (type == ChangeType::CANCELLED) {
                        --_suspended;
                }
        }
 
-       Change (type, property, frequent);
+       Change(type, property, frequent);
 }
 
 
 void
-Player::set_video_container_size (dcp::Size s)
+Player::set_video_container_size(dcp::Size s)
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::VIDEO_CONTAINER_SIZE);
 
@@ -463,18 +463,18 @@ Player::set_video_container_size (dcp::Size s)
        {
                boost::mutex::scoped_lock lm(_black_image_mutex);
                _black_image = make_shared<Image>(AV_PIX_FMT_RGB24, _video_container_size, Image::Alignment::PADDED);
-               _black_image->make_black ();
+               _black_image->make_black();
        }
 }
 
 
 void
-Player::playlist_change (ChangeType type)
+Player::playlist_change(ChangeType type)
 {
        if (type == ChangeType::DONE) {
-               setup_pieces ();
+               setup_pieces();
        }
-       Change (type, PlayerProperty::PLAYLIST, false);
+       Change(type, PlayerProperty::PLAYLIST, false);
 }
 
 
@@ -492,35 +492,35 @@ Player::film_change(ChangeType type, FilmProperty p)
        }
 
        if (p == FilmProperty::CONTAINER) {
-               Change (type, PlayerProperty::FILM_CONTAINER, false);
+               Change(type, PlayerProperty::FILM_CONTAINER, false);
        } else if (p == FilmProperty::VIDEO_FRAME_RATE) {
                /* Pieces contain a FrameRateChange which contains the DCP frame rate,
                   so we need new pieces here.
                */
                if (type == ChangeType::DONE) {
-                       setup_pieces ();
+                       setup_pieces();
                }
-               Change (type, PlayerProperty::FILM_VIDEO_FRAME_RATE, false);
+               Change(type, PlayerProperty::FILM_VIDEO_FRAME_RATE, false);
        } else if (p == FilmProperty::AUDIO_PROCESSOR) {
-               if (type == ChangeType::DONE && film->audio_processor ()) {
-                       boost::mutex::scoped_lock lm (_mutex);
+               if (type == ChangeType::DONE && film->audio_processor()) {
+                       boost::mutex::scoped_lock lm(_mutex);
                        _audio_processor = film->audio_processor()->clone(film->audio_frame_rate());
                }
        } else if (p == FilmProperty::AUDIO_CHANNELS) {
                if (type == ChangeType::DONE) {
-                       boost::mutex::scoped_lock lm (_mutex);
-                       _audio_merger.clear ();
+                       boost::mutex::scoped_lock lm(_mutex);
+                       _audio_merger.clear();
                }
        }
 }
 
 
 shared_ptr<PlayerVideo>
-Player::black_player_video_frame (Eyes eyes) const
+Player::black_player_video_frame(Eyes eyes) const
 {
        boost::mutex::scoped_lock lm(_black_image_mutex);
 
-       return std::make_shared<PlayerVideo> (
+       return std::make_shared<PlayerVideo>(
                make_shared<const RawImageProxy>(_black_image),
                Crop(),
                optional<double>(),
@@ -538,14 +538,14 @@ Player::black_player_video_frame (Eyes eyes) const
 
 
 Frame
-Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
+Player::dcp_to_content_video(shared_ptr<const Piece> piece, DCPTime t) const
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
 
-       auto s = t - piece->content->position ();
-       s = min (piece->content->length_after_trim(film), s);
-       s = max (DCPTime(), s + DCPTime (piece->content->trim_start(), piece->frc));
+       auto s = t - piece->content->position();
+       s = min(piece->content->length_after_trim(film), s);
+       s = max(DCPTime(), s + DCPTime(piece->content->trim_start(), piece->frc));
 
        /* It might seem more logical here to convert s to a ContentTime (using the FrameRateChange)
           then convert that ContentTime to frames at the content's rate.  However this fails for
@@ -554,74 +554,74 @@ Player::dcp_to_content_video (shared_ptr<const Piece> piece, DCPTime t) const
 
           Instead we convert the DCPTime using the DCP video rate then account for any skip/repeat.
        */
-       return s.frames_floor (piece->frc.dcp) / piece->frc.factor ();
+       return s.frames_floor(piece->frc.dcp) / piece->frc.factor();
 }
 
 
 DCPTime
-Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const
+Player::content_video_to_dcp(shared_ptr<const Piece> piece, Frame f) const
 {
        /* See comment in dcp_to_content_video */
-       auto const d = DCPTime::from_frames (f * piece->frc.factor(), piece->frc.dcp) - DCPTime(piece->content->trim_start(), piece->frc);
+       auto const d = DCPTime::from_frames(f * piece->frc.factor(), piece->frc.dcp) - DCPTime(piece->content->trim_start(), piece->frc);
        return d + piece->content->position();
 }
 
 
 Frame
-Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const
+Player::dcp_to_resampled_audio(shared_ptr<const Piece> piece, DCPTime t) const
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
 
-       auto s = t - piece->content->position ();
-       s = min (piece->content->length_after_trim(film), s);
+       auto s = t - piece->content->position();
+       s = min(piece->content->length_after_trim(film), s);
        /* See notes in dcp_to_content_video */
-       return max (DCPTime(), DCPTime(piece->content->trim_start(), piece->frc) + s).frames_floor(film->audio_frame_rate());
+       return max(DCPTime(), DCPTime(piece->content->trim_start(), piece->frc) + s).frames_floor(film->audio_frame_rate());
 }
 
 
 DCPTime
-Player::resampled_audio_to_dcp (shared_ptr<const Piece> piece, Frame f) const
+Player::resampled_audio_to_dcp(shared_ptr<const Piece> piece, Frame f) const
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
 
        /* See comment in dcp_to_content_video */
        return DCPTime::from_frames(f, film->audio_frame_rate())
-               - DCPTime (piece->content->trim_start(), piece->frc)
+               - DCPTime(piece->content->trim_start(), piece->frc)
                + piece->content->position();
 }
 
 
 ContentTime
-Player::dcp_to_content_time (shared_ptr<const Piece> piece, DCPTime t) const
+Player::dcp_to_content_time(shared_ptr<const Piece> piece, DCPTime t) const
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
 
-       auto s = t - piece->content->position ();
-       s = min (piece->content->length_after_trim(film), s);
-       return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start());
+       auto s = t - piece->content->position();
+       s = min(piece->content->length_after_trim(film), s);
+       return max(ContentTime(), ContentTime(s, piece->frc) + piece->content->trim_start());
 }
 
 
 DCPTime
-Player::content_time_to_dcp (shared_ptr<const Piece> piece, ContentTime t) const
+Player::content_time_to_dcp(shared_ptr<const Piece> piece, ContentTime t) const
 {
        return DCPTime(t - piece->content->trim_start(), piece->frc) + piece->content->position();
 }
 
 
 vector<shared_ptr<Font>>
-Player::get_subtitle_fonts ()
+Player::get_subtitle_fonts()
 {
-       boost::mutex::scoped_lock lm (_mutex);
+       boost::mutex::scoped_lock lm(_mutex);
 
        vector<shared_ptr<Font>> fonts;
        for (auto piece: _pieces) {
                for (auto text: piece->content->text) {
                        auto text_fonts = text->fonts();
-                       copy (text_fonts.begin(), text_fonts.end(), back_inserter(fonts));
+                       copy(text_fonts.begin(), text_fonts.end(), back_inserter(fonts));
                }
        }
 
@@ -631,7 +631,7 @@ Player::get_subtitle_fonts ()
 
 /** Set this player never to produce any video data */
 void
-Player::set_ignore_video ()
+Player::set_ignore_video()
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::IGNORE_VIDEO);
        _ignore_video = true;
@@ -640,7 +640,7 @@ Player::set_ignore_video ()
 
 
 void
-Player::set_ignore_audio ()
+Player::set_ignore_audio()
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::IGNORE_AUDIO);
        _ignore_audio = true;
@@ -649,7 +649,7 @@ Player::set_ignore_audio ()
 
 
 void
-Player::set_ignore_text ()
+Player::set_ignore_text()
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::IGNORE_TEXT);
        _ignore_text = true;
@@ -659,7 +659,7 @@ Player::set_ignore_text ()
 
 /** Set the player to always burn open texts into the image regardless of the content settings */
 void
-Player::set_always_burn_open_subtitles ()
+Player::set_always_burn_open_subtitles()
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::ALWAYS_BURN_OPEN_SUBTITLES);
        _always_burn_open_subtitles = true;
@@ -668,7 +668,7 @@ Player::set_always_burn_open_subtitles ()
 
 /** Sets up the player to be faster, possibly at the expense of quality */
 void
-Player::set_fast ()
+Player::set_fast()
 {
        _fast = true;
        setup_pieces();
@@ -676,7 +676,7 @@ Player::set_fast ()
 
 
 void
-Player::set_play_referenced ()
+Player::set_play_referenced()
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::PLAY_REFERENCED);
        _play_referenced = true;
@@ -718,13 +718,13 @@ Player::earliest_piece_and_time() const
 
 
 bool
-Player::pass ()
+Player::pass()
 {
-       boost::mutex::scoped_lock lm (_mutex);
+       boost::mutex::scoped_lock lm(_mutex);
 
        if (_suspended) {
                /* We can't pass in this state */
-               LOG_DEBUG_PLAYER_NC ("Player is suspended");
+               LOG_DEBUG_PLAYER_NC("Player is suspended");
                return false;
        }
 
@@ -756,20 +756,20 @@ Player::pass ()
        }
 
        if (!_black.done() && !_ignore_video && (!earliest_time || _black.position() < *earliest_time)) {
-               earliest_time = _black.position ();
+               earliest_time = _black.position();
                which = BLACK;
        }
 
        if (!_silent.done() && !_ignore_audio && (!earliest_time || _silent.position() < *earliest_time)) {
-               earliest_time = _silent.position ();
+               earliest_time = _silent.position();
                which = SILENT;
        }
 
        switch (which) {
        case CONTENT:
        {
-               LOG_DEBUG_PLAYER ("Calling pass() on %1", earliest_content->content->path(0));
-               earliest_content->done = earliest_content->decoder->pass ();
+               LOG_DEBUG_PLAYER("Calling pass() on %1", earliest_content->content->path(0));
+               earliest_content->done = earliest_content->decoder->pass();
                auto dcp = dynamic_pointer_cast<DCPContent>(earliest_content->content);
                if (dcp && !_play_referenced) {
                        if (dcp->reference_video()) {
@@ -786,7 +786,7 @@ Player::pass ()
                break;
        }
        case BLACK:
-               LOG_DEBUG_PLAYER ("Emit black for gap at %1", to_string(_black.position()));
+               LOG_DEBUG_PLAYER("Emit black for gap at %1", to_string(_black.position()));
                if (!_next_video_time) {
                        /* Deciding to emit black has the same effect as getting some video from the content
                         * when we are inaccurately seeking.
@@ -799,12 +799,12 @@ Player::pass ()
                } else {
                        use_video(black_player_video_frame(Eyes::BOTH), _black.position(), _black.period_at_position().to);
                }
-               _black.set_position (_black.position() + one_video_frame());
+               _black.set_position(_black.position() + one_video_frame());
                break;
        case SILENT:
        {
-               LOG_DEBUG_PLAYER ("Emit silence for gap at %1", to_string(_silent.position()));
-               DCPTimePeriod period (_silent.period_at_position());
+               LOG_DEBUG_PLAYER("Emit silence for gap at %1", to_string(_silent.position()));
+               DCPTimePeriod period(_silent.period_at_position());
                if (_next_audio_time) {
                        /* Sometimes the thing that happened last finishes fractionally before
                           or after this silence.  Bodge the start time of the silence to fix it.
@@ -817,14 +817,14 @@ Player::pass ()
                        if (error >= too_much_error) {
                                film->log()->log(String::compose("Silence starting before or after last audio by %1", error), LogEntry::TYPE_ERROR);
                        }
-                       DCPOMATIC_ASSERT (error < too_much_error);
+                       DCPOMATIC_ASSERT(error < too_much_error);
                        period.from = *_next_audio_time;
                }
                if (period.duration() > one_video_frame()) {
                        period.to = period.from + one_video_frame();
                }
-               fill_audio (period);
-               _silent.set_position (period.to);
+               fill_audio(period);
+               _silent.set_position(period.to);
                break;
        }
        case NONE:
@@ -882,21 +882,21 @@ Player::pass ()
        }
 
        LOG_DEBUG_PLAYER("Emitting audio up to %1", to_string(pull_to));
-       auto audio = _audio_merger.pull (pull_to);
+       auto audio = _audio_merger.pull(pull_to);
        for (auto i = audio.begin(); i != audio.end(); ++i) {
                if (_next_audio_time && i->second < *_next_audio_time) {
                        /* This new data comes before the last we emitted (or the last seek); discard it */
-                       auto cut = discard_audio (i->first, i->second, *_next_audio_time);
+                       auto cut = discard_audio(i->first, i->second, *_next_audio_time);
                        if (!cut.first) {
                                continue;
                        }
                        *i = cut;
                } else if (_next_audio_time && i->second > *_next_audio_time) {
                        /* There's a gap between this data and the last we emitted; fill with silence */
-                       fill_audio (DCPTimePeriod (*_next_audio_time, i->second));
+                       fill_audio(DCPTimePeriod(*_next_audio_time, i->second));
                }
 
-               emit_audio (i->first, i->second);
+               emit_audio(i->first, i->second);
        }
 
        if (done) {
@@ -906,7 +906,7 @@ Player::pass ()
                }
 
                if (_shuffler) {
-                       _shuffler->flush ();
+                       _shuffler->flush();
                }
                for (auto const& i: _delay) {
                        emit_video(i.first, i.second);
@@ -942,12 +942,12 @@ Player::open_texts_for_frame(DCPTime time) const
                                }
 
                                /* i.image will already have been scaled to fit _video_container_size */
-                               dcp::Size scaled_size (i.rectangle.width * _video_container_size.load().width, i.rectangle.height * _video_container_size.load().height);
+                               dcp::Size scaled_size(i.rectangle.width * _video_container_size.load().width, i.rectangle.height * _video_container_size.load().height);
 
                                texts.push_back(
-                                       PositionImage (
+                                       PositionImage(
                                                i.image,
-                                               Position<int> (
+                                               Position<int>(
                                                        lrint(_video_container_size.load().width * i.rectangle.x),
                                                        lrint(_video_container_size.load().height * i.rectangle.y)
                                                        )
@@ -1033,13 +1033,13 @@ Player::emit_video_until(DCPTime time)
 
 
 void
-Player::video (weak_ptr<Piece> weak_piece, ContentVideo video)
+Player::video(weak_ptr<Piece> weak_piece, ContentVideo video)
 {
        if (_suspended) {
                return;
        }
 
-       auto piece = weak_piece.lock ();
+       auto piece = weak_piece.lock();
        if (!piece) {
                return;
        }
@@ -1139,15 +1139,15 @@ Player::use_video(shared_ptr<PlayerVideo> pv, DCPTime time, DCPTime end)
 
 
 void
-Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio content_audio)
+Player::audio(weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio content_audio)
 {
        if (_suspended) {
                return;
        }
 
-       DCPOMATIC_ASSERT (content_audio.audio->frames() > 0);
+       DCPOMATIC_ASSERT(content_audio.audio->frames() > 0);
 
-       auto piece = weak_piece.lock ();
+       auto piece = weak_piece.lock();
        if (!piece) {
                return;
        }
@@ -1158,12 +1158,12 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
        }
 
        auto content = piece->content->audio;
-       DCPOMATIC_ASSERT (content);
+       DCPOMATIC_ASSERT(content);
 
        int const rfr = content->resampled_frame_rate(film);
 
        /* Compute time in the DCP */
-       auto time = resampled_audio_to_dcp (piece, content_audio.frame);
+       auto time = resampled_audio_to_dcp(piece, content_audio.frame);
 
        /* And the end of this block in the DCP */
        auto end = time + DCPTime::from_frames(content_audio.audio->frames(), rfr);
@@ -1171,7 +1171,7 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
 
        /* Remove anything that comes before the start or after the end of the content */
        if (time < piece->content->position()) {
-               auto cut = discard_audio (content_audio.audio, time, piece->content->position());
+               auto cut = discard_audio(content_audio.audio, time, piece->content->position());
                if (!cut.first) {
                        /* This audio is entirely discarded */
                        return;
@@ -1189,20 +1189,20 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
                content_audio.audio = make_shared<AudioBuffers>(content_audio.audio, remaining_frames, 0);
        }
 
-       DCPOMATIC_ASSERT (content_audio.audio->frames() > 0);
+       DCPOMATIC_ASSERT(content_audio.audio->frames() > 0);
 
        /* Gain and fade */
 
-       auto const fade_coeffs = content->fade (stream, content_audio.frame, content_audio.audio->frames(), rfr);
+       auto const fade_coeffs = content->fade(stream, content_audio.frame, content_audio.audio->frames(), rfr);
        if (content->gain() != 0 || !fade_coeffs.empty()) {
                auto gain_buffers = make_shared<AudioBuffers>(content_audio.audio);
                if (!fade_coeffs.empty()) {
                        /* Apply both fade and gain */
-                       DCPOMATIC_ASSERT (fade_coeffs.size() == static_cast<size_t>(gain_buffers->frames()));
+                       DCPOMATIC_ASSERT(fade_coeffs.size() == static_cast<size_t>(gain_buffers->frames()));
                        auto const channels = gain_buffers->channels();
                        auto const frames = fade_coeffs.size();
                        auto data = gain_buffers->data();
-                       auto const gain = db_to_linear (content->gain());
+                       auto const gain = db_to_linear(content->gain());
                        for (auto channel = 0; channel < channels; ++channel) {
                                for (auto frame = 0U; frame < frames; ++frame) {
                                        data[channel][frame] *= gain * fade_coeffs[frame];
@@ -1210,7 +1210,7 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
                        }
                } else {
                        /* Just apply gain */
-                       gain_buffers->apply_gain (content->gain());
+                       gain_buffers->apply_gain(content->gain());
                }
                content_audio.audio = gain_buffers;
        }
@@ -1227,21 +1227,21 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
 
        /* Push */
 
-       _audio_merger.push (content_audio.audio, time);
-       DCPOMATIC_ASSERT (_stream_states.find (stream) != _stream_states.end ());
+       _audio_merger.push(content_audio.audio, time);
+       DCPOMATIC_ASSERT(_stream_states.find(stream) != _stream_states.end());
        _stream_states[stream].last_push_end = time + DCPTime::from_frames(content_audio.audio->frames(), film->audio_frame_rate());
 }
 
 
 void
-Player::bitmap_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> weak_content, ContentBitmapText subtitle)
+Player::bitmap_text_start(weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> weak_content, ContentBitmapText subtitle)
 {
        if (_suspended) {
                return;
        }
 
-       auto piece = weak_piece.lock ();
-       auto content = weak_content.lock ();
+       auto piece = weak_piece.lock();
+       auto content = weak_content.lock();
        if (!piece || !content) {
                return;
        }
@@ -1250,16 +1250,16 @@ Player::bitmap_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextConten
        for (auto& sub: subtitle.subs)
        {
                /* Apply content's subtitle offsets */
-               sub.rectangle.x += content->x_offset ();
-               sub.rectangle.y -= content->y_offset ();
+               sub.rectangle.x += content->x_offset();
+               sub.rectangle.y -= content->y_offset();
 
                /* Apply a corrective translation to keep the subtitle centred after the scale that is coming up */
                sub.rectangle.x -= sub.rectangle.width * ((content->x_scale() - 1) / 2);
                sub.rectangle.y -= sub.rectangle.height * ((content->y_scale() - 1) / 2);
 
                /* Apply content's subtitle scale */
-               sub.rectangle.width *= content->x_scale ();
-               sub.rectangle.height *= content->y_scale ();
+               sub.rectangle.width *= content->x_scale();
+               sub.rectangle.height *= content->y_scale();
 
                auto image = sub.image;
 
@@ -1270,8 +1270,8 @@ Player::bitmap_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextConten
                        return;
                }
 
-               dcp::Size scaled_size (width, height);
-               ps.bitmap.push_back (BitmapText(image->scale(scaled_size, dcp::YUVToRGB::REC601, image->pixel_format(), Image::Alignment::PADDED, _fast), sub.rectangle));
+               dcp::Size scaled_size(width, height);
+               ps.bitmap.push_back(BitmapText(image->scale(scaled_size, dcp::YUVToRGB::REC601, image->pixel_format(), Image::Alignment::PADDED, _fast), sub.rectangle));
        }
 
        DCPTime from(content_time_to_dcp(piece, subtitle.from()));
@@ -1280,29 +1280,29 @@ Player::bitmap_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextConten
 
 
 void
-Player::plain_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> weak_content, ContentStringText subtitle)
+Player::plain_text_start(weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> weak_content, ContentStringText subtitle)
 {
        if (_suspended) {
                return;
        }
 
-       auto piece = weak_piece.lock ();
-       auto content = weak_content.lock ();
+       auto piece = weak_piece.lock();
+       auto content = weak_content.lock();
        auto film = _film.lock();
        if (!piece || !content || !film) {
                return;
        }
 
        PlayerText ps;
-       DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
+       DCPTime const from(content_time_to_dcp(piece, subtitle.from()));
 
        if (from > piece->content->end(film)) {
                return;
        }
 
        for (auto s: subtitle.subs) {
-               s.set_h_position (s.h_position() + content->x_offset());
-               s.set_v_position (s.v_position() + content->y_offset());
+               s.set_h_position(s.h_position() + content->x_offset());
+               s.set_v_position(s.v_position() + content->y_offset());
                float const xs = content->x_scale();
                float const ys = content->y_scale();
                float size = s.size();
@@ -1311,17 +1311,17 @@ Player::plain_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent
                   e.g. if xs = ys = 0.5 we scale size by 2.
                */
                if (xs > 1e-5 && ys > 1e-5) {
-                       size *= 1 / min (1 / xs, 1 / ys);
+                       size *= 1 / min(1 / xs, 1 / ys);
                }
-               s.set_size (size);
+               s.set_size(size);
 
                /* Then express aspect ratio changes */
-               if (fabs (1.0 - xs / ys) > dcp::ASPECT_ADJUST_EPSILON) {
-                       s.set_aspect_adjust (xs / ys);
+               if (fabs(1.0 - xs / ys) > dcp::ASPECT_ADJUST_EPSILON) {
+                       s.set_aspect_adjust(xs / ys);
                }
 
-               s.set_in (dcp::Time(from.seconds(), 1000));
-               ps.string.push_back (s);
+               s.set_in(dcp::Time(from.seconds(), 1000));
+               ps.string.push_back(s);
        }
 
        _active_texts[content->type()].add_from(weak_content, ps, from);
@@ -1329,13 +1329,13 @@ Player::plain_text_start (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent
 
 
 void
-Player::subtitle_stop (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> weak_content, ContentTime to)
+Player::subtitle_stop(weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> weak_content, ContentTime to)
 {
        if (_suspended) {
                return;
        }
 
-       auto content = weak_content.lock ();
+       auto content = weak_content.lock();
        if (!content) {
                return;
        }
@@ -1344,13 +1344,13 @@ Player::subtitle_stop (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> w
                return;
        }
 
-       auto piece = weak_piece.lock ();
+       auto piece = weak_piece.lock();
        auto film = _film.lock();
        if (!piece || !film) {
                return;
        }
 
-       DCPTime const dcp_to = content_time_to_dcp (piece, to);
+       DCPTime const dcp_to = content_time_to_dcp(piece, to);
 
        if (dcp_to > piece->content->end(film)) {
                return;
@@ -1360,15 +1360,15 @@ Player::subtitle_stop (weak_ptr<Piece> weak_piece, weak_ptr<const TextContent> w
 
        bool const always = (content->type() == TextType::OPEN_SUBTITLE && _always_burn_open_subtitles);
        if (content->use() && !always && !content->burn()) {
-               Text (from.first, content->type(), content->dcp_track().get_value_or(DCPTextTrack()), DCPTimePeriod(from.second, dcp_to));
+               Text(from.first, content->type(), content->dcp_track().get_value_or(DCPTextTrack()), DCPTimePeriod(from.second, dcp_to));
        }
 }
 
 
 void
-Player::seek (DCPTime time, bool accurate)
+Player::seek(DCPTime time, bool accurate)
 {
-       boost::mutex::scoped_lock lm (_mutex);
+       boost::mutex::scoped_lock lm(_mutex);
        LOG_DEBUG_PLAYER("Seek to %1 (%2accurate)", to_string(time), accurate ? "" : "in");
 
        if (_suspended) {
@@ -1382,16 +1382,16 @@ Player::seek (DCPTime time, bool accurate)
        }
 
        if (_shuffler) {
-               _shuffler->clear ();
+               _shuffler->clear();
        }
 
-       _delay.clear ();
+       _delay.clear();
 
        if (_audio_processor) {
-               _audio_processor->flush ();
+               _audio_processor->flush();
        }
 
-       _audio_merger.clear ();
+       _audio_merger.clear();
        std::for_each(_active_texts.begin(), _active_texts.end(), [](ActiveText& a) { a.clear(); });
 
        for (auto i: _pieces) {
@@ -1401,11 +1401,11 @@ Player::seek (DCPTime time, bool accurate)
                           content we may not start right at the beginning of the next, causing a gap (if the next content has
                           been trimmed to a point between keyframes, or something).
                        */
-                       i->decoder->seek (dcp_to_content_time (i, i->content->position()), true);
+                       i->decoder->seek(dcp_to_content_time(i, i->content->position()), true);
                        i->done = false;
                } else if (i->content->position() <= time && time < i->content->end(film)) {
                        /* During; seek to position */
-                       i->decoder->seek (dcp_to_content_time (i, time), accurate);
+                       i->decoder->seek(dcp_to_content_time(i, time), accurate);
                        i->done = false;
                } else {
                        /* After; this piece is done */
@@ -1421,8 +1421,8 @@ Player::seek (DCPTime time, bool accurate)
                _next_audio_time = boost::none;
        }
 
-       _black.set_position (time);
-       _silent.set_position (time);
+       _black.set_position(time);
+       _silent.set_position(time);
 
        _last_video[Eyes::LEFT] = {};
        _last_video[Eyes::RIGHT] = {};
@@ -1445,12 +1445,12 @@ Player::emit_video(shared_ptr<PlayerVideo> pv, DCPTime time)
                pv->set_text(texts.get());
        }
 
-       Video (pv, time);
+       Video(pv, time);
 }
 
 
 void
-Player::emit_audio (shared_ptr<AudioBuffers> data, DCPTime time)
+Player::emit_audio(shared_ptr<AudioBuffers> data, DCPTime time)
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
@@ -1461,14 +1461,14 @@ Player::emit_audio (shared_ptr<AudioBuffers> data, DCPTime time)
        }
 
        /* This audio must follow on from the previous, allowing for half a sample (at 48kHz) leeway */
-       DCPOMATIC_ASSERT (!_next_audio_time || labs(time.get() - _next_audio_time->get()) < 2);
+       DCPOMATIC_ASSERT(!_next_audio_time || labs(time.get() - _next_audio_time->get()) < 2);
        Audio(data, time, film->audio_frame_rate());
        _next_audio_time = time + DCPTime::from_frames(data->frames(), film->audio_frame_rate());
 }
 
 
 void
-Player::fill_audio (DCPTimePeriod period)
+Player::fill_audio(DCPTimePeriod period)
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
@@ -1477,16 +1477,16 @@ Player::fill_audio (DCPTimePeriod period)
                return;
        }
 
-       DCPOMATIC_ASSERT (period.from < period.to);
+       DCPOMATIC_ASSERT(period.from < period.to);
 
        DCPTime t = period.from;
        while (t < period.to) {
-               DCPTime block = min (DCPTime::from_seconds (0.5), period.to - t);
+               DCPTime block = min(DCPTime::from_seconds(0.5), period.to - t);
                Frame const samples = block.frames_round(film->audio_frame_rate());
                if (samples) {
                        auto silence = make_shared<AudioBuffers>(film->audio_channels(), samples);
-                       silence->make_silent ();
-                       emit_audio (silence, t);
+                       silence->make_silent();
+                       emit_audio(silence, t);
                }
                t += block;
        }
@@ -1494,17 +1494,17 @@ Player::fill_audio (DCPTimePeriod period)
 
 
 DCPTime
-Player::one_video_frame () const
+Player::one_video_frame() const
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
 
-       return DCPTime::from_frames(1, film->video_frame_rate ());
+       return DCPTime::from_frames(1, film->video_frame_rate());
 }
 
 
 pair<shared_ptr<AudioBuffers>, DCPTime>
-Player::discard_audio (shared_ptr<const AudioBuffers> audio, DCPTime time, DCPTime discard_to) const
+Player::discard_audio(shared_ptr<const AudioBuffers> audio, DCPTime time, DCPTime discard_to) const
 {
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
@@ -1521,7 +1521,7 @@ Player::discard_audio (shared_ptr<const AudioBuffers> audio, DCPTime time, DCPTi
 
 
 void
-Player::set_dcp_decode_reduction (optional<int> reduction)
+Player::set_dcp_decode_reduction(optional<int> reduction)
 {
        ChangeSignaller<Player, int> cc(this, PlayerProperty::DCP_DECODE_REDUCTION);
 
@@ -1536,13 +1536,13 @@ Player::set_dcp_decode_reduction (optional<int> reduction)
 
 
 optional<DCPTime>
-Player::content_time_to_dcp (shared_ptr<const Content> content, ContentTime t) const
+Player::content_time_to_dcp(shared_ptr<const Content> content, ContentTime t) const
 {
-       boost::mutex::scoped_lock lm (_mutex);
+       boost::mutex::scoped_lock lm(_mutex);
 
        for (auto i: _pieces) {
                if (i->content == content) {
-                       return content_time_to_dcp (i, t);
+                       return content_time_to_dcp(i, t);
                }
        }
 
@@ -1552,13 +1552,13 @@ Player::content_time_to_dcp (shared_ptr<const Content> content, ContentTime t) c
 
 
 optional<ContentTime>
-Player::dcp_to_content_time (shared_ptr<const Content> content, DCPTime t) const
+Player::dcp_to_content_time(shared_ptr<const Content> content, DCPTime t) const
 {
-       boost::mutex::scoped_lock lm (_mutex);
+       boost::mutex::scoped_lock lm(_mutex);
 
        for (auto i: _pieces) {
                if (i->content == content) {
-                       return dcp_to_content_time (i, t);
+                       return dcp_to_content_time(i, t);
                }
        }
 
@@ -1568,7 +1568,7 @@ Player::dcp_to_content_time (shared_ptr<const Content> content, DCPTime t) const
 
 
 shared_ptr<const Playlist>
-Player::playlist () const
+Player::playlist() const
 {
        auto film = _film.lock();
        if (!film) {
@@ -1580,7 +1580,7 @@ Player::playlist () const
 
 
 void
-Player::atmos (weak_ptr<Piece> weak_piece, ContentAtmos data)
+Player::atmos(weak_ptr<Piece> weak_piece, ContentAtmos data)
 {
        if (_suspended) {
                return;
@@ -1589,8 +1589,8 @@ Player::atmos (weak_ptr<Piece> weak_piece, ContentAtmos data)
        auto film = _film.lock();
        DCPOMATIC_ASSERT(film);
 
-       auto piece = weak_piece.lock ();
-       DCPOMATIC_ASSERT (piece);
+       auto piece = weak_piece.lock();
+       DCPOMATIC_ASSERT(piece);
 
        auto const vfr = film->video_frame_rate();
 
@@ -1608,7 +1608,7 @@ Player::atmos (weak_ptr<Piece> weak_piece, ContentAtmos data)
                return;
        }
 
-       Atmos (data.data, dcp_time, data.metadata);
+       Atmos(data.data, dcp_time, data.metadata);
 }
 
 
index 2faffe971f89ac602a302126f596f9d432e657fe..70c08047591af2fd26b09777795ed8705cfd1c4e 100644 (file)
@@ -82,36 +82,36 @@ public:
        Player(std::shared_ptr<const Film>, Image::Alignment subtitle_alignment, bool tolerant);
        Player(std::shared_ptr<const Film>, std::shared_ptr<const Playlist> playlist, bool tolerant);
 
-       Player (Player const&) = delete;
-       Player& operator= (Player const&) = delete;
+       Player(Player const&) = delete;
+       Player& operator=(Player const&) = delete;
 
        Player(Player&& other);
        Player& operator=(Player&& other);
 
        /** @return true when playback is finished, and there is no more data to come */
-       bool pass ();
-       void seek (dcpomatic::DCPTime time, bool accurate);
+       bool pass();
+       void seek(dcpomatic::DCPTime time, bool accurate);
        Frame frames_done() const;
        float progress() const;
 
-       std::vector<std::shared_ptr<dcpomatic::Font>> get_subtitle_fonts ();
+       std::vector<std::shared_ptr<dcpomatic::Font>> get_subtitle_fonts();
 
-       dcp::Size video_container_size () const {
+       dcp::Size video_container_size() const {
                return _video_container_size;
        }
 
-       void set_video_container_size (dcp::Size);
-       void set_ignore_video ();
-       void set_ignore_audio ();
-       void set_ignore_text ();
-       void set_always_burn_open_subtitles ();
-       void set_fast ();
-       void set_play_referenced ();
-       void set_dcp_decode_reduction (boost::optional<int> reduction);
+       void set_video_container_size(dcp::Size);
+       void set_ignore_video();
+       void set_ignore_audio();
+       void set_ignore_text();
+       void set_always_burn_open_subtitles();
+       void set_fast();
+       void set_play_referenced();
+       void set_dcp_decode_reduction(boost::optional<int> reduction);
        void set_disable_audio_processor();
 
-       boost::optional<dcpomatic::DCPTime> content_time_to_dcp (std::shared_ptr<const Content> content, dcpomatic::ContentTime t) const;
-       boost::optional<dcpomatic::ContentTime> dcp_to_content_time (std::shared_ptr<const Content> content, dcpomatic::DCPTime t) const;
+       boost::optional<dcpomatic::DCPTime> content_time_to_dcp(std::shared_ptr<const Content> content, dcpomatic::ContentTime t) const;
+       boost::optional<dcpomatic::ContentTime> dcp_to_content_time(std::shared_ptr<const Content> content, dcpomatic::DCPTime t) const;
 
        void signal_change(ChangeType type, int property);
 
@@ -145,40 +145,40 @@ private:
        friend struct check_reuse_old_data_test;
        friend struct overlap_video_test1;
 
-       void construct ();
+       void construct();
        void connect();
-       void setup_pieces ();
+       void setup_pieces();
        void film_change(ChangeType, FilmProperty);
-       void playlist_change (ChangeType);
-       void playlist_content_change (ChangeType, int, bool);
-       Frame dcp_to_content_video (std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
-       dcpomatic::DCPTime content_video_to_dcp (std::shared_ptr<const Piece> piece, Frame f) const;
-       Frame dcp_to_resampled_audio (std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
-       dcpomatic::DCPTime resampled_audio_to_dcp (std::shared_ptr<const Piece> piece, Frame f) const;
-       dcpomatic::ContentTime dcp_to_content_time (std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
-       dcpomatic::DCPTime content_time_to_dcp (std::shared_ptr<const Piece> piece, dcpomatic::ContentTime t) const;
-       std::shared_ptr<PlayerVideo> black_player_video_frame (Eyes eyes) const;
+       void playlist_change(ChangeType);
+       void playlist_content_change(ChangeType, int, bool);
+       Frame dcp_to_content_video(std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
+       dcpomatic::DCPTime content_video_to_dcp(std::shared_ptr<const Piece> piece, Frame f) const;
+       Frame dcp_to_resampled_audio(std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
+       dcpomatic::DCPTime resampled_audio_to_dcp(std::shared_ptr<const Piece> piece, Frame f) const;
+       dcpomatic::ContentTime dcp_to_content_time(std::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
+       dcpomatic::DCPTime content_time_to_dcp(std::shared_ptr<const Piece> piece, dcpomatic::ContentTime t) const;
+       std::shared_ptr<PlayerVideo> black_player_video_frame(Eyes eyes) const;
        void emit_video_until(dcpomatic::DCPTime time);
        void insert_video(std::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time, dcpomatic::DCPTime end);
        std::pair<std::shared_ptr<Piece>, boost::optional<dcpomatic::DCPTime>> earliest_piece_and_time() const;
 
-       void video (std::weak_ptr<Piece>, ContentVideo);
-       void audio (std::weak_ptr<Piece>, AudioStreamPtr, ContentAudio);
-       void bitmap_text_start (std::weak_ptr<Piece>, std::weak_ptr<const TextContent>, ContentBitmapText);
-       void plain_text_start (std::weak_ptr<Piece>, std::weak_ptr<const TextContent>, ContentStringText);
-       void subtitle_stop (std::weak_ptr<Piece>, std::weak_ptr<const TextContent>, dcpomatic::ContentTime);
-       void atmos (std::weak_ptr<Piece>, ContentAtmos);
+       void video(std::weak_ptr<Piece>, ContentVideo);
+       void audio(std::weak_ptr<Piece>, AudioStreamPtr, ContentAudio);
+       void bitmap_text_start(std::weak_ptr<Piece>, std::weak_ptr<const TextContent>, ContentBitmapText);
+       void plain_text_start(std::weak_ptr<Piece>, std::weak_ptr<const TextContent>, ContentStringText);
+       void subtitle_stop(std::weak_ptr<Piece>, std::weak_ptr<const TextContent>, dcpomatic::ContentTime);
+       void atmos(std::weak_ptr<Piece>, ContentAtmos);
 
-       dcpomatic::DCPTime one_video_frame () const;
-       void fill_audio (dcpomatic::DCPTimePeriod period);
-       std::pair<std::shared_ptr<AudioBuffers>, dcpomatic::DCPTime> discard_audio (
+       dcpomatic::DCPTime one_video_frame() const;
+       void fill_audio(dcpomatic::DCPTimePeriod period);
+       std::pair<std::shared_ptr<AudioBuffers>, dcpomatic::DCPTime> discard_audio(
                std::shared_ptr<const AudioBuffers> audio, dcpomatic::DCPTime time, dcpomatic::DCPTime discard_to
                ) const;
        boost::optional<PositionImage> open_texts_for_frame(dcpomatic::DCPTime time) const;
        void emit_video(std::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time);
        void use_video(std::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time, dcpomatic::DCPTime end);
-       void emit_audio (std::shared_ptr<AudioBuffers> data, dcpomatic::DCPTime time);
-       std::shared_ptr<const Playlist> playlist () const;
+       void emit_audio(std::shared_ptr<AudioBuffers> data, dcpomatic::DCPTime time);
+       std::shared_ptr<const Playlist> playlist() const;
 
        /** Mutex to protect the most of the Player state.  When it's used for the preview we have
            seek() and pass() called from the Butler thread and lots of other stuff called
@@ -231,7 +231,7 @@ private:
        class StreamState
        {
        public:
-               StreamState () {}
+               StreamState() {}
 
                explicit StreamState(std::shared_ptr<Piece> p)
                        : piece(p)
index 7a74dcd97395accb288bb82b6dacb5f0051af968..7b4a8453d6fbc68c07cae5125ab6bf94dfce67d0 100644 (file)
 #include "lib/version.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
-#include <wx/notebook.h>
 #include <wx/hyperlink.h>
+#include <wx/notebook.h>
 LIBDCP_ENABLE_WARNINGS
 
 using std::vector;
 
 
-AboutDialog::AboutDialog (wxWindow* parent)
+AboutDialog::AboutDialog(wxWindow* parent)
        : wxDialog(parent, wxID_ANY, variant::wx::insert_dcpomatic(_("About %s")))
 {
-       auto overall_sizer = new wxBoxSizer (wxVERTICAL);
-       auto sizer = new wxBoxSizer (wxVERTICAL);
+       auto overall_sizer = new wxBoxSizer(wxVERTICAL);
+       auto sizer = new wxBoxSizer(wxVERTICAL);
 
-       wxFont title_font (*wxNORMAL_FONT);
-       title_font.SetPointSize (title_font.GetPointSize() + 12);
-       title_font.SetWeight (wxFONTWEIGHT_BOLD);
+       wxFont title_font(*wxNORMAL_FONT);
+       title_font.SetPointSize(title_font.GetPointSize() + 12);
+       title_font.SetWeight(wxFONTWEIGHT_BOLD);
 
-       wxFont subtitle_font (*wxNORMAL_FONT);
-       subtitle_font.SetPointSize (subtitle_font.GetPointSize() + 2);
+       wxFont subtitle_font(*wxNORMAL_FONT);
+       subtitle_font.SetPointSize(subtitle_font.GetPointSize() + 2);
 
-       wxFont version_font (*wxNORMAL_FONT);
-       version_font.SetWeight (wxFONTWEIGHT_BOLD);
+       wxFont version_font(*wxNORMAL_FONT);
+       version_font.SetWeight(wxFONTWEIGHT_BOLD);
 
        auto t = new StaticText(this, variant::wx::dcpomatic());
-       t->SetFont (title_font);
-       sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16));
+       t->SetFont(title_font);
+       sizer->Add(t, wxSizerFlags().Centre().Border(wxALL, 16));
 
        wxString s;
-       if (strcmp (dcpomatic_git_commit, "release") == 0) {
-               t = new StaticText (this, std_to_wx(String::compose("Version %1", dcpomatic_version)));
+       if (strcmp(dcpomatic_git_commit, "release") == 0) {
+               t = new StaticText(this, std_to_wx(String::compose("Version %1", dcpomatic_version)));
        } else {
-               t = new StaticText (this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
+               t = new StaticText(this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
        }
-       t->SetFont (version_font);
-       sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2));
-       sizer->AddSpacer (12);
+       t->SetFont(version_font);
+       sizer->Add(t, wxSizerFlags().Centre().Border(wxALL, 2));
+       sizer->AddSpacer(12);
 
        if (variant::show_tagline())
        {
@@ -92,15 +92,15 @@ AboutDialog::AboutDialog (wxWindow* parent)
 
        if (variant::show_credits())
        {
-               t = new StaticText (
+               t = new StaticText(
                        this,
                        _("(C) 2012-2025 Carl Hetherington, Terrence Meiczinger\nOle Laursen, Aaron Boxer"),
                        wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
                        );
 
-               sizer->Add (t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16));
+               sizer->Add(t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16));
 
-               _notebook = new wxNotebook (this, wxID_ANY);
+               _notebook = new wxNotebook(this, wxID_ANY);
 
                wxArrayString written_by;
                written_by.Add(char_to_wx("Carl Hetherington"));
@@ -109,7 +109,7 @@ AboutDialog::AboutDialog (wxWindow* parent)
                written_by.Add(char_to_wx("Ole Laursen"));
                written_by.Add(char_to_wx("Aaron Boxer"));
                written_by.Add(char_to_wx("Benjamin Radel"));
-               add_section (_("Written by"), written_by);
+               add_section(_("Written by"), written_by);
 
                wxArrayString with_help_from;
                with_help_from.Add(char_to_wx("David Vignoni"));
@@ -118,7 +118,7 @@ AboutDialog::AboutDialog (wxWindow* parent)
                with_help_from.Add(char_to_wx("Gérald Maruccia"));
                with_help_from.Add(char_to_wx("Julian van Mil"));
                with_help_from.Add(char_to_wx("Lilian Lefranc"));
-               add_section (_("With help from"), with_help_from);
+               add_section(_("With help from"), with_help_from);
 
                wxArrayString translated_by;
                translated_by.Add(char_to_wx("Manuel AC"));
@@ -169,19 +169,19 @@ AboutDialog::AboutDialog (wxWindow* parent)
                translated_by.Add(char_to_wx("Rov (若文)"));
                translated_by.Add(char_to_wx("刘汉源"));
                translated_by.Add(char_to_wx("poppinzhang"));
-               add_section (_("Translated by"), translated_by);
+               add_section(_("Translated by"), translated_by);
 
                wxArrayString patrons;
                patrons.Add(char_to_wx("Lightbender Post"));
-               add_section (_("Patrons"), patrons);
+               add_section(_("Patrons"), patrons);
 
                wxArrayString subscribers;
                #include "subscribers.cc"
-               add_section (_("Subscribers"), subscribers);
+               add_section(_("Subscribers"), subscribers);
 
                wxArrayString supported_by;
                #include "supporters.cc"
-               add_section (_("Also supported by"), supported_by);
+               add_section(_("Also supported by"), supported_by);
 
                wxArrayString tested_by;
                tested_by.Add(char_to_wx("Manuel AC"));
@@ -248,37 +248,38 @@ AboutDialog::AboutDialog (wxWindow* parent)
                tested_by.Add(char_to_wx("Wolfgang Woehl"));
                tested_by.Add(char_to_wx("Benno Zwanenburg"));
                tested_by.Add(char_to_wx("Дима Агатов"));
-               add_section (_("Tested by"), tested_by);
+               add_section(_("Tested by"), tested_by);
 
-               sizer->Add (_notebook, wxSizerFlags().Centre().Border(wxALL, 16));
-               overall_sizer->Add (sizer);
+               sizer->Add(_notebook, wxSizerFlags().Centre().Border(wxALL, 16));
+               overall_sizer->Add(sizer);
        } else {
                overall_sizer->Add(sizer, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
        }
 
-       wxSizer* buttons = CreateButtonSizer (wxOK);
+       auto buttons = CreateButtonSizer(wxOK);
        if (buttons) {
-               overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, 4);
+               overall_sizer->Add(buttons, 1, wxEXPAND | wxALL, 4);
        }
 
-       SetSizerAndFit (overall_sizer);
+       SetSizerAndFit(overall_sizer);
 }
 
+
 /** Add a section of credits.
  *  @param name Name of section.
  *  @param credits List of names.
  */
 void
-AboutDialog::add_section (wxString name, wxArrayString credits)
+AboutDialog::add_section(wxString name, wxArrayString credits)
 {
        static auto first = true;
        int const N = 3;
 
-       auto panel = new wxScrolledWindow (_notebook);
-       panel->SetMaxSize (wxSize (-1, 380));
-       panel->EnableScrolling (false, true);
-       panel->SetScrollRate (0, 32);
-       auto overall_sizer = new wxBoxSizer (wxHORIZONTAL);
+       auto panel = new wxScrolledWindow(_notebook);
+       panel->SetMaxSize(wxSize(-1, 380));
+       panel->EnableScrolling(false, true);
+       panel->SetScrollRate(0, 32);
+       auto overall_sizer = new wxBoxSizer(wxHORIZONTAL);
 
        vector<wxString> strings(N);
        int c = 0;
@@ -297,7 +298,7 @@ AboutDialog::add_section (wxString name, wxArrayString credits)
                overall_sizer->Add(sizer, 1, wxEXPAND | wxALL, 6);
        }
 
-       panel->SetSizerAndFit (overall_sizer);
-       _notebook->AddPage (panel, name, first);
+       panel->SetSizerAndFit(overall_sizer);
+       _notebook->AddPage(panel, name, first);
        first = false;
 }
index f9b60ccc62350651bdf9ed304d6639de46818b63..a8a9ec47a8a773fa08be997658bfad10cb8511c6 100644 (file)
@@ -37,10 +37,10 @@ class wxNotebook;
 class AboutDialog : public wxDialog
 {
 public:
-       explicit AboutDialog (wxWindow *);
+       explicit AboutDialog(wxWindow *);
 
 private:
-       void add_section (wxString, wxArrayString);
+       void add_section(wxString, wxArrayString);
 
        wxNotebook* _notebook; ///< notebook used to keep each list of names for the credits
 };
index 65a594ef8cbfb7930bca630a90e2157fe5240010..974d6f4cfe09617e71cbf26c6ae6c437f87a10b9 100644 (file)
@@ -45,30 +45,30 @@ using namespace boost::placeholders;
 #endif
 
 
-HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok)
-       : wxDialog (parent, wxID_ANY, _("Hints"))
-       , _film (film)
-       , _hints (0)
-       , _finished (false)
+HintsDialog::HintsDialog(wxWindow* parent, std::weak_ptr<Film> film, bool ok)
+       : wxDialog(parent, wxID_ANY, _("Hints"))
+       , _film(film)
+       , _hints(0)
+       , _finished(false)
 {
-       auto sizer = new wxBoxSizer (wxVERTICAL);
+       auto sizer = new wxBoxSizer(wxVERTICAL);
 
-       _gauge = new wxGauge (this, wxID_ANY, 100);
-       sizer->Add (_gauge, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
+       _gauge = new wxGauge(this, wxID_ANY, 100);
+       sizer->Add(_gauge, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
        _gauge_message = new StaticText(this, {});
-       sizer->Add (_gauge_message, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
+       sizer->Add(_gauge_message, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
 
-       _text = new wxRichTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (400, 300), wxRE_READONLY);
-       sizer->Add (_text, 1, wxEXPAND | wxALL, 6);
+       _text = new wxRichTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, 300), wxRE_READONLY);
+       sizer->Add(_text, 1, wxEXPAND | wxALL, 6);
 
        if (!ok) {
                auto b = new CheckBox(this, _("Don't show hints again"));
-               sizer->Add (b, 0, wxALL, 6);
+               sizer->Add(b, 0, wxALL, 6);
                b->bind(&HintsDialog::shut_up, this, _1);
        }
 
-       auto buttons = CreateStdDialogButtonSizer (0);
-       sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder());
+       auto buttons = CreateStdDialogButtonSizer(0);
+       sizer->Add(CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder());
        wxButton* default_button = nullptr;
        if (ok) {
                default_button = new wxButton(this, wxID_OK);
@@ -76,122 +76,122 @@ HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok)
        } else {
                default_button = new wxButton(this, wxID_OK, _("Make DCP"));
                buttons->SetAffirmativeButton(default_button);
-               buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Go back")));
+               buttons->SetNegativeButton(new wxButton(this, wxID_CANCEL, _("Go back")));
        }
 
-       buttons->Realize ();
+       buttons->Realize();
 
        default_button->SetFocus();
 
-       SetSizer (sizer);
-       sizer->Layout ();
-       sizer->SetSizeHints (this);
+       SetSizer(sizer);
+       sizer->Layout();
+       sizer->SetSizeHints(this);
 
-       _text->GetCaret()->Hide ();
+       _text->GetCaret()->Hide();
 
-       auto locked_film = _film.lock ();
+       auto locked_film = _film.lock();
        if (locked_film) {
-               _film_change_connection = locked_film->Change.connect (boost::bind (&HintsDialog::film_change, this, _1));
-               _film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1));
+               _film_change_connection = locked_film->Change.connect(boost::bind(&HintsDialog::film_change, this, _1));
+               _film_content_change_connection = locked_film->ContentChange.connect(boost::bind(&HintsDialog::film_content_change, this, _1));
        }
 
-       film_change (ChangeType::DONE);
+       film_change(ChangeType::DONE);
 }
 
 
 void
-HintsDialog::film_change (ChangeType type)
+HintsDialog::film_change(ChangeType type)
 {
        if (type != ChangeType::DONE) {
                return;
        }
 
-       _text->Clear ();
-       _current.clear ();
+       _text->Clear();
+       _current.clear();
 
-       auto film = _film.lock ();
+       auto film = _film.lock();
        if (!film) {
                return;
        }
 
-       _gauge->Show ();
-       _gauge_message->Show ();
-       Layout ();
-       _gauge->SetValue (0);
-       update ();
+       _gauge->Show();
+       _gauge_message->Show();
+       Layout();
+       _gauge->SetValue(0);
+       update();
        _finished = false;
 
-       _hints.reset (new Hints (_film));
+       _hints.reset(new Hints(_film));
        _hints_hint_connection = _hints->Hint.connect(bind(&HintsDialog::hint, this, _1));
        _hints_progress_connection = _hints->Progress.connect(bind(&HintsDialog::progress, this, _1));
        _hints_pulse_connection = _hints->Pulse.connect(bind(&HintsDialog::pulse, this));
        _hints_finished_connection = _hints->Finished.connect(bind(&HintsDialog::finished, this));
-       _hints->start ();
+       _hints->start();
 }
 
 void
-HintsDialog::film_content_change (ChangeType type)
+HintsDialog::film_content_change(ChangeType type)
 {
-       film_change (type);
+       film_change(type);
 }
 
 void
-HintsDialog::update ()
+HintsDialog::update()
 {
-       _text->Clear ();
-       if (_current.empty ()) {
+       _text->Clear();
+       if (_current.empty()) {
                if (_finished) {
-                       _text->WriteText (_("There are no hints: everything looks good!"));
+                       _text->WriteText(_("There are no hints: everything looks good!"));
                } else {
-                       _text->WriteText (_("There are no hints yet: project check in progress."));
+                       _text->WriteText(_("There are no hints yet: project check in progress."));
                }
        } else {
                _text->BeginStandardBullet(char_to_wx("standard/circle"), 1, 50);
                for (auto i: _current) {
-                       _text->WriteText (std_to_wx (i));
-                       _text->Newline ();
+                       _text->WriteText(std_to_wx(i));
+                       _text->Newline();
                }
-               _text->EndSymbolBullet ();
+               _text->EndSymbolBullet();
        }
 }
 
 void
-HintsDialog::hint (string text)
+HintsDialog::hint(string text)
 {
-       _current.push_back (text);
-       update ();
+       _current.push_back(text);
+       update();
 }
 
 void
-HintsDialog::shut_up (wxCommandEvent& ev)
+HintsDialog::shut_up(wxCommandEvent& ev)
 {
-       Config::instance()->set_show_hints_before_make_dcp (!ev.IsChecked());
+       Config::instance()->set_show_hints_before_make_dcp(!ev.IsChecked());
 }
 
 void
-HintsDialog::pulse ()
+HintsDialog::pulse()
 {
-       _gauge->Pulse ();
+       _gauge->Pulse();
 }
 
 void
-HintsDialog::finished ()
+HintsDialog::finished()
 {
        try {
-               _hints->rethrow ();
+               _hints->rethrow();
        } catch (std::exception& e) {
-               error_dialog (this, wxString::Format(_("A problem occurred when looking for hints (%s)"), std_to_wx(e.what())));
+               error_dialog(this, wxString::Format(_("A problem occurred when looking for hints (%s)"), std_to_wx(e.what())));
        }
 
        _finished = true;
-       update ();
-       _gauge->Hide ();
-       _gauge_message->Hide ();
-       Layout ();
+       update();
+       _gauge->Hide();
+       _gauge_message->Hide();
+       Layout();
 }
 
 void
-HintsDialog::progress (string m)
+HintsDialog::progress(string m)
 {
-       _gauge_message->SetLabel (std_to_wx(m));
+       _gauge_message->SetLabel(std_to_wx(m));
 }
index 1c77faf3eb9c814cf9b7eb7e5d187a2162ff227a..44420405a935bc0a8078645683a8ab488919bde8 100644 (file)
@@ -34,17 +34,17 @@ class Hints;
 class HintsDialog : public wxDialog
 {
 public:
-       HintsDialog (wxWindow* parent, std::weak_ptr<Film>, bool ok);
+       HintsDialog(wxWindow* parent, std::weak_ptr<Film>, bool ok);
 
 private:
-       void film_change (ChangeType);
-       void film_content_change (ChangeType type);
-       void shut_up (wxCommandEvent& ev);
-       void update ();
-       void hint (std::string text);
-       void pulse ();
-       void finished ();
-       void progress (std::string m);
+       void film_change(ChangeType);
+       void film_content_change(ChangeType type);
+       void shut_up(wxCommandEvent& ev);
+       void update();
+       void hint(std::string text);
+       void pulse();
+       void finished();
+       void progress(std::string m);
 
        std::weak_ptr<Film> _film;
        wxGauge* _gauge;