From: Carl Hetherington Date: Wed, 16 Jul 2014 13:30:02 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/master' into 2.0 X-Git-Tag: v2.0.48~718 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=94201bd2a5a4cb391b7f2bdeba56b928fed7cfe1;hp=-c Merge remote-tracking branch 'origin/master' into 2.0 --- 94201bd2a5a4cb391b7f2bdeba56b928fed7cfe1 diff --combined ChangeLog index 68383d39d,a81046111..561bbce1c --- a/ChangeLog +++ b/ChangeLog @@@ -1,19 -1,7 +1,21 @@@ +2014-07-15 Carl Hetherington + + * A variety of changes were made on the 2.0 branch + but not documented in the ChangeLog. Most sigificantly: + + - DCP import + - Creation of DCPs with proper XML subtitles + - Import of .srt and .xml subtitles + - Audio processing framework (with some basic processors). + +2014-03-07 Carl Hetherington + + * Add subtitle view. + 2014-07-16 Carl Hetherington + * Make KDM email subject configurable. + * Updates to de_DE from Carsten Kurz. * Limit allowed KDM types based on Interop/SMPTE setting @@@ -29,7 -17,6 +31,7 @@@ 2014-07-10 Carl Hetherington * Version 1.72.2 released. +>>>>>>> origin/master 2014-07-10 Carl Hetherington diff --combined src/lib/config.cc index d4976676d,24f9242ec..71431ec0d --- a/src/lib/config.cc +++ b/src/lib/config.cc @@@ -23,8 -23,8 +23,8 @@@ #include #include #include -#include -#include +#include +#include #include #include "config.h" #include "server.h" @@@ -32,7 -32,7 +32,7 @@@ #include "filter.h" #include "ratio.h" #include "dcp_content_type.h" -#include "sound_processor.h" +#include "cinema_sound_processor.h" #include "colour_conversion.h" #include "cinema.h" #include "util.h" @@@ -50,7 -50,7 +50,7 @@@ using boost::shared_ptr using boost::optional; using boost::algorithm::is_any_of; using boost::algorithm::split; -using libdcp::raw_convert; +using dcp::raw_convert; Config* Config::_instance = 0; @@@ -60,7 -60,7 +60,7 @@@ Config::Config ( , _server_port_base (6192) , _use_any_servers (true) , _tms_path (".") - , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750"))) + , _cinema_sound_processor (CinemaSoundProcessor::from_id (N_("dolby_cp750"))) , _allow_any_dcp_frame_rate (false) , _default_still_length (10) , _default_container (Ratio::from_id ("185")) @@@ -79,9 -79,9 +79,9 @@@ _allowed_dcp_frame_rates.push_back (50); _allowed_dcp_frame_rates.push_back (60); - _colour_conversions.push_back (PresetColourConversion (_("sRGB"), 2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6)); - _colour_conversions.push_back (PresetColourConversion (_("sRGB non-linearised"), 2.4, false, libdcp::colour_matrix::srgb_to_xyz, 2.6)); - _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, libdcp::colour_matrix::rec709_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("sRGB"), 2.4, true, dcp::colour_matrix::srgb_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("sRGB non-linearised"), 2.4, false, dcp::colour_matrix::srgb_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, dcp::colour_matrix::rec709_to_xyz, 2.6)); reset_kdm_email (); } @@@ -90,6 -90,7 +90,6 @@@ voi Config::read () { if (!boost::filesystem::exists (file (false))) { - read_old_metadata (); return; } @@@ -127,11 -128,7 +127,11 @@@ c = f.optional_string_child ("SoundProcessor"); if (c) { - _sound_processor = SoundProcessor::from_id (c.get ()); + _cinema_sound_processor = CinemaSoundProcessor::from_id (c.get ()); + } + c = f.optional_string_child ("CinemaSoundProcessor"); + if (c) { + _cinema_sound_processor = CinemaSoundProcessor::from_id (c.get ()); } _language = f.optional_string_child ("Language"); @@@ -173,7 -170,7 +173,7 @@@ /* Loading version 0 (before Rec. 709 was added as a preset). Add it in. */ - _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, libdcp::colour_matrix::rec709_to_xyz, 2.6)); + _colour_conversions.push_back (PresetColourConversion (_("Rec. 709"), 2.2, false, dcp::colour_matrix::rec709_to_xyz, 2.6)); } list cin = f.node_children ("Cinema"); @@@ -189,6 -186,7 +189,7 @@@ _mail_server = f.string_child ("MailServer"); _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_cc = f.optional_string_child ("KDMCC").get_value_or (""); _kdm_email = f.string_child ("KDMEmail"); @@@ -202,6 -200,70 +203,6 @@@ _log_types = f.optional_number_child ("LogTypes").get_value_or (Log::TYPE_GENERAL | Log::TYPE_WARNING | Log::TYPE_ERROR); } -void -Config::read_old_metadata () -{ - /* XXX: this won't work with non-Latin filenames */ - ifstream f (file(true).string().c_str ()); - string line; - - while (getline (f, line)) { - if (line.empty ()) { - continue; - } - - if (line[0] == '#') { - continue; - } - - size_t const s = line.find (' '); - if (s == string::npos) { - continue; - } - - string const k = line.substr (0, s); - string const v = line.substr (s + 1); - - if (k == N_("num_local_encoding_threads")) { - _num_local_encoding_threads = atoi (v.c_str ()); - } else if (k == N_("default_directory")) { - _default_directory = v; - } else if (k == N_("server_port")) { - _server_port_base = atoi (v.c_str ()); - } else if (k == N_("server")) { - vector b; - split (b, v, is_any_of (" ")); - if (b.size() == 2) { - _servers.push_back (b[0]); - } - } else if (k == N_("tms_ip")) { - _tms_ip = v; - } else if (k == N_("tms_path")) { - _tms_path = v; - } else if (k == N_("tms_user")) { - _tms_user = v; - } else if (k == N_("tms_password")) { - _tms_password = v; - } else if (k == N_("sound_processor")) { - _sound_processor = SoundProcessor::from_id (v); - } else if (k == "language") { - _language = v; - } else if (k == "default_container") { - _default_container = Ratio::from_id (v); - } else if (k == "default_dcp_content_type") { - _default_dcp_content_type = DCPContentType::from_isdcf_name (v); - } else if (k == "dcp_metadata_issuer") { - _dcp_metadata.issuer = v; - } else if (k == "dcp_metadata_creator") { - _dcp_metadata.creator = v; - } else if (k == "dcp_metadata_issue_date") { - _dcp_metadata.issue_date = v; - } - - _default_isdcf_metadata.read_old_metadata (k, v); - } -} - /** @return Filename to write configuration to */ boost::filesystem::path Config::file (bool old) const @@@ -273,8 -335,8 +274,8 @@@ Config::write () cons root->add_child("TMSPath")->add_child_text (_tms_path); root->add_child("TMSUser")->add_child_text (_tms_user); root->add_child("TMSPassword")->add_child_text (_tms_password); - if (_sound_processor) { - root->add_child("SoundProcessor")->add_child_text (_sound_processor->id ()); + if (_cinema_sound_processor) { + root->add_child("CinemaSoundProcessor")->add_child_text (_cinema_sound_processor->id ()); } if (_language) { root->add_child("Language")->add_child_text (_language.get()); @@@ -305,6 -367,7 +306,7 @@@ root->add_child("MailServer")->add_child_text (_mail_server); root->add_child("MailUser")->add_child_text (_mail_user); root->add_child("MailPassword")->add_child_text (_mail_password); + root->add_child("KDMSubject")->add_child_text (_kdm_subject); root->add_child("KDMFrom")->add_child_text (_kdm_from); root->add_child("KDMCC")->add_child_text (_kdm_cc); root->add_child("KDMEmail")->add_child_text (_kdm_email); diff --combined src/lib/config.h index f26e2532a,85e419a0a..66ff66214 --- a/src/lib/config.h +++ b/src/lib/config.h @@@ -28,14 -28,15 +28,14 @@@ #include #include #include -#include +#include #include "isdcf_metadata.h" #include "colour_conversion.h" -#include "server.h" class ServerDescription; class Scaler; class Filter; -class SoundProcessor; +class CinemaSoundProcessor; class DCPContentType; class Ratio; class Cinema; @@@ -103,9 -104,9 +103,9 @@@ public return _tms_password; } - /** @return The sound processor that we are using */ - SoundProcessor const * sound_processor () const { - return _sound_processor; + /** @return The cinema sound processor that we are using */ + CinemaSoundProcessor const * cinema_sound_processor () const { + return _cinema_sound_processor; } std::list > cinemas () const { @@@ -140,7 -141,7 +140,7 @@@ return _default_dcp_content_type; } - libdcp::XMLMetadata dcp_metadata () const { + dcp::XMLMetadata dcp_metadata () const { return _dcp_metadata; } @@@ -168,6 -169,10 +168,10 @@@ return _mail_password; } + std::string kdm_subject () const { + return _kdm_subject; + } + std::string kdm_from () const { return _kdm_from; } @@@ -287,7 -292,7 +291,7 @@@ changed (); } - void set_dcp_metadata (libdcp::XMLMetadata m) { + void set_dcp_metadata (dcp::XMLMetadata m) { _dcp_metadata = m; changed (); } @@@ -322,6 -327,11 +326,11 @@@ changed (); } + void set_kdm_subject (std::string s) { + _kdm_subject = s; + changed (); + } + void set_kdm_from (std::string f) { _kdm_from = f; changed (); @@@ -371,6 -381,7 +380,6 @@@ private Config (); boost::filesystem::path file (bool) const; void read (); - void read_old_metadata (); void write () const; /** number of threads to use for J2K encoding on the local machine */ @@@ -393,8 -404,8 +402,8 @@@ std::string _tms_user; /** Password to log into the TMS with */ std::string _tms_password; - /** Our sound processor */ - SoundProcessor const * _sound_processor; + /** Our cinema sound processor */ + CinemaSoundProcessor const * _cinema_sound_processor; std::list _allowed_dcp_frame_rates; /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */ bool _allow_any_dcp_frame_rate; @@@ -404,7 -415,7 +413,7 @@@ int _default_still_length; Ratio const * _default_container; DCPContentType const * _default_dcp_content_type; - libdcp::XMLMetadata _dcp_metadata; + dcp::XMLMetadata _dcp_metadata; int _default_j2k_bandwidth; int _default_audio_delay; std::vector _colour_conversions; @@@ -412,6 -423,7 +421,7 @@@ std::string _mail_server; std::string _mail_user; std::string _mail_password; + std::string _kdm_subject; std::string _kdm_from; std::string _kdm_cc; std::string _kdm_email; diff --combined src/lib/kdm.cc index dd2b756c1,49f04724a..0593881bc --- a/src/lib/kdm.cc +++ b/src/lib/kdm.cc @@@ -21,8 -21,7 +21,8 @@@ #include #include #include -#include +#include +#include #include "kdm.h" #include "cinema.h" #include "exceptions.h" @@@ -38,13 -37,13 +38,13 @@@ using boost::shared_ptr struct ScreenKDM { - ScreenKDM (shared_ptr s, libdcp::KDM k) + ScreenKDM (shared_ptr s, dcp::EncryptedKDM k) : screen (s) , kdm (k) {} shared_ptr screen; - libdcp::KDM kdm; + dcp::EncryptedKDM kdm; }; static string @@@ -105,17 -104,17 +105,17 @@@ make_screen_kdms shared_ptr film, list > screens, boost::filesystem::path cpl, - boost::posix_time::ptime from, - boost::posix_time::ptime to, - libdcp::KDM::Formulation formulation + dcp::LocalTime from, + dcp::LocalTime to, + dcp::Formulation formulation ) { - list kdms = film->make_kdms (screens, cpl, from, to, formulation); + list kdms = film->make_kdms (screens, cpl, from, to, formulation); list screen_kdms; list >::iterator i = screens.begin (); - list::iterator j = kdms.begin (); + list::iterator j = kdms.begin (); while (i != screens.end() && j != kdms.end ()) { screen_kdms.push_back (ScreenKDM (*i, *j)); ++i; @@@ -130,9 -129,9 +130,9 @@@ make_cinema_kdms shared_ptr film, list > screens, boost::filesystem::path cpl, - boost::posix_time::ptime from, - boost::posix_time::ptime to, - libdcp::KDM::Formulation formulation + dcp::LocalTime from, + dcp::LocalTime to, + dcp::Formulation formulation ) { list screen_kdms = make_screen_kdms (film, screens, cpl, from, to, formulation); @@@ -176,9 -175,9 +176,9 @@@ write_kdm_files shared_ptr film, list > screens, boost::filesystem::path cpl, - boost::posix_time::ptime from, - boost::posix_time::ptime to, - libdcp::KDM::Formulation formulation, + dcp::LocalTime from, + dcp::LocalTime to, + dcp::Formulation formulation, boost::filesystem::path directory ) { @@@ -197,9 -196,9 +197,9 @@@ write_kdm_zip_files shared_ptr film, list > screens, boost::filesystem::path cpl, - boost::posix_time::ptime from, - boost::posix_time::ptime to, - libdcp::KDM::Formulation formulation, + dcp::LocalTime from, + dcp::LocalTime to, + dcp::Formulation formulation, boost::filesystem::path directory ) { @@@ -217,9 -216,9 +217,9 @@@ email_kdms shared_ptr film, list > screens, boost::filesystem::path cpl, - boost::posix_time::ptime from, - boost::posix_time::ptime to, - libdcp::KDM::Formulation formulation + dcp::LocalTime from, + dcp::LocalTime to, + dcp::Formulation formulation ) { list cinema_kdms = make_cinema_kdms (film, screens, cpl, from, to, formulation); @@@ -233,20 -232,30 +233,30 @@@ /* Send email */ quickmail_initialize (); - quickmail mail = quickmail_create (Config::instance()->kdm_from().c_str(), "KDM delivery"); + + stringstream start; + start << from.date() << " " << from.time_of_day(); + stringstream end; + end << to.date() << " " << to.time_of_day(); + + string subject = Config::instance()->kdm_subject(); + boost::algorithm::replace_all (subject, "$CPL_NAME", film->dcp_name ()); + boost::algorithm::replace_all (subject, "$START_TIME", start.str ()); + boost::algorithm::replace_all (subject, "$END_TIME", end.str ()); + boost::algorithm::replace_all (subject, "$CINEMA_NAME", i->cinema->name); + quickmail mail = quickmail_create (Config::instance()->kdm_from().c_str(), subject.c_str ()); + quickmail_add_to (mail, i->cinema->email.c_str ()); if (!Config::instance()->kdm_cc().empty ()) { quickmail_add_cc (mail, Config::instance()->kdm_cc().c_str ()); } + string body = Config::instance()->kdm_email().c_str(); boost::algorithm::replace_all (body, "$CPL_NAME", film->dcp_name ()); - stringstream start; - start << from.date() << " " << from.time_of_day(); boost::algorithm::replace_all (body, "$START_TIME", start.str ()); - stringstream end; - end << to.date() << " " << to.time_of_day(); boost::algorithm::replace_all (body, "$END_TIME", end.str ()); boost::algorithm::replace_all (body, "$CINEMA_NAME", i->cinema->name); + stringstream screens; for (list::const_iterator j = i->screen_kdms.begin(); j != i->screen_kdms.end(); ++j) { screens << j->screen->name << ", "; diff --combined src/wx/config_dialog.cc index fc77b42a2,5d1b32038..360e80572 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@@ -28,14 -28,13 +28,14 @@@ #include #include #include -#include +#include #include "lib/config.h" #include "lib/ratio.h" #include "lib/scaler.h" #include "lib/filter.h" #include "lib/dcp_content_type.h" #include "lib/colour_conversion.h" +#include "lib/log.h" #include "config_dialog.h" #include "wx_util.h" #include "editable_list.h" @@@ -396,14 -395,14 +396,14 @@@ private void issuer_changed () { - libdcp::XMLMetadata m = Config::instance()->dcp_metadata (); + dcp::XMLMetadata m = Config::instance()->dcp_metadata (); m.issuer = wx_to_std (_issuer->GetValue ()); Config::instance()->set_dcp_metadata (m); } void creator_changed () { - libdcp::XMLMetadata m = Config::instance()->dcp_metadata (); + dcp::XMLMetadata m = Config::instance()->dcp_metadata (); m.creator = wx_to_std (_creator->GetValue ()); Config::instance()->set_dcp_metadata (m); } @@@ -670,6 -669,10 +670,10 @@@ public font.SetPointSize (font.GetPointSize() - 1); plain->SetFont (font); table->AddSpacer (0); + + add_label_to_sizer (table, panel, _("Subject"), true); + _kdm_subject = new wxTextCtrl (panel, wxID_ANY); + table->Add (_kdm_subject, 1, wxEXPAND | wxALL); add_label_to_sizer (table, panel, _("From address"), true); _kdm_from = new wxTextCtrl (panel, wxID_ANY); @@@ -692,6 -695,8 +696,8 @@@ _mail_user->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::mail_user_changed, this)); _mail_password->SetValue (std_to_wx (config->mail_password ())); _mail_password->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::mail_password_changed, this)); + _kdm_subject->SetValue (std_to_wx (config->kdm_subject ())); + _kdm_subject->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::kdm_subject_changed, this)); _kdm_from->SetValue (std_to_wx (config->kdm_from ())); _kdm_from->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&KDMEmailPage::kdm_from_changed, this)); _kdm_cc->SetValue (std_to_wx (config->kdm_cc ())); @@@ -718,6 -723,11 +724,11 @@@ private { Config::instance()->set_mail_password (wx_to_std (_mail_password->GetValue ())); } + + void kdm_subject_changed () + { + Config::instance()->set_kdm_subject (wx_to_std (_kdm_subject->GetValue ())); + } void kdm_from_changed () { @@@ -743,6 -753,7 +754,7 @@@ wxTextCtrl* _mail_server; wxTextCtrl* _mail_user; wxTextCtrl* _mail_password; + wxTextCtrl* _kdm_subject; wxTextCtrl* _kdm_from; wxTextCtrl* _kdm_cc; wxTextCtrl* _kdm_email;