ffmpeg_options = {}
return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
- ('libdcp', 'e02bf26'),
+ ('libdcp', '7e9ad08'),
('libsub', '067c21c'))
def configure_options(target):
list<shared_ptr<string> > kdm_strings;
- name_values["cinema"] = cinema->name;
+ name_values['c'] = cinema->name;
BOOST_FOREACH (ScreenKDM const & i, screen_kdms) {
shared_ptr<string> kdm (new string (i.kdm.as_xml ()));
throw runtime_error ("could not create ZIP source");
}
- name_values["screen"] = i.screen->name;
+ name_values['s'] = i.screen->name;
string const name = name_format.get(name_values) + ".xml";
if (zip_add (zip, name.c_str(), source) == -1) {
throw runtime_error ("failed to add KDM to ZIP archive");
)
{
/* No specific screen */
- name_values["screen"] = "";
+ name_values['s'] = "";
BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) {
boost::filesystem::path path = directory;
- name_values["cinema"] = i.cinema->name;
+ name_values['c'] = i.cinema->name;
path /= name_format.get(name_values) + ".zip";
i.make_zip_file (path, name_format, name_values);
}
}
/* No specific screen */
- name_values["screen"] = "";
+ name_values['s'] = "";
BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) {
- name_values["cinema"] = i.cinema->name;
+ name_values['c'] = i.cinema->name;
boost::filesystem::path zip_file = boost::filesystem::temp_directory_path ();
zip_file /= boost::filesystem::unique_path().string() + ".zip";
string subject = config->kdm_subject();
boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
- boost::algorithm::replace_all (subject, "$START_TIME", name_values["from"]);
- boost::algorithm::replace_all (subject, "$END_TIME", name_values["to"]);
+ boost::algorithm::replace_all (subject, "$START_TIME", name_values['f']);
+ boost::algorithm::replace_all (subject, "$END_TIME", name_values['t']);
boost::algorithm::replace_all (subject, "$CINEMA_NAME", i.cinema->name);
string body = config->kdm_email().c_str();
boost::algorithm::replace_all (body, "$CPL_NAME", cpl_name);
- boost::algorithm::replace_all (body, "$START_TIME", name_values["from"]);
- boost::algorithm::replace_all (body, "$END_TIME", name_values["to"]);
+ boost::algorithm::replace_all (body, "$START_TIME", name_values['f']);
+ boost::algorithm::replace_all (body, "$END_TIME", name_values['t']);
boost::algorithm::replace_all (body, "$CINEMA_NAME", i.cinema->name);
locked_stringstream screens;
KDMNameFormat::KDMNameFormat (string specification)
: NameFormat (specification)
{
- add ("film_name", 'f', "film name");
- add ("cinema", 'c', "cinema");
- add ("screen", 's', "screen");
- add ("from", 'b', "from date/time");
- add ("to", 'e', "to date/time");
+ /* film name */
+ add ('f');
+ /* cinema */
+ add ('c');
+ /* screen */
+ add ('s');
+ /* from date/time */
+ add ('b');
+ /* to date/time */
+ add ('e');
}
{
/* Write KDMs to the specified directory */
BOOST_FOREACH (ScreenKDM const & i, screen_kdms) {
- name_values["cinema"] = i.screen->cinema->name;
- name_values["screen"] = i.screen->name;
+ name_values['c'] = i.screen->cinema->name;
+ name_values['s'] = i.screen->name;
boost::filesystem::path out = directory / (name_format.get(name_values) + ".xml");
i.kdm.as_xml (out);
}
string
SendKDMEmailJob::name () const
{
- dcp::NameFormat::Map::const_iterator i = _name_values.find ("film_name");
+ dcp::NameFormat::Map::const_iterator i = _name_values.find ('f');
if (i == _name_values.end() || i->second.empty ()) {
return _("Email KDMs");
}
video_asset_filename (shared_ptr<dcp::PictureAsset> asset)
{
dcp::NameFormat::Map values;
- values["type"] = "j2c";
- values["id"] = asset->id();
+ values['t'] = "j2c";
+ values['i'] = asset->id();
return Config::instance()->dcp_filename_format().get(values) + ".mxf";
}
audio_asset_filename (shared_ptr<dcp::SoundAsset> asset)
{
dcp::NameFormat::Map values;
- values["type"] = "pcm";
- values["id"] = asset->id();
+ values['t'] = "pcm";
+ values['i'] = asset->id();
return Config::instance()->dcp_filename_format().get(values) + ".mxf";
}
}
dcp::NameFormat::Map name_values;
- name_values["film_name"] = decrypted.content_title_text();
- name_values["from"] = dcp::LocalTime(_timing->from()).date() + " " + dcp::LocalTime(_timing->from()).time_of_day();
- name_values["to"] = dcp::LocalTime(_timing->until()).date() + " " + dcp::LocalTime(_timing->until()).time_of_day();
+ name_values['f'] = decrypted.content_title_text();
+ name_values['b'] = dcp::LocalTime(_timing->from()).date() + " " + dcp::LocalTime(_timing->from()).time_of_day();
+ name_values['e'] = dcp::LocalTime(_timing->until()).date() + " " + dcp::LocalTime(_timing->until()).time_of_day();
if (_output->write_to()) {
ScreenKDM::write_files (screen_kdms, _output->directory(), _output->name_format(), name_values);
}
dcp::NameFormat::Map values;
- values["film_name"] = film->name();
- values["from"] = dcp::LocalTime(valid_from.get()).date() + " " + dcp::LocalTime(valid_from.get()).time_of_day();
- values["to"] = dcp::LocalTime(valid_to.get()).date() + " " + dcp::LocalTime(valid_to.get()).time_of_day();
+ values['f'] = film->name();
+ values['b'] = dcp::LocalTime(valid_from.get()).date() + " " + dcp::LocalTime(valid_from.get()).time_of_day();
+ values['e'] = dcp::LocalTime(valid_to.get()).date() + " " + dcp::LocalTime(valid_to.get()).time_of_day();
try {
list<ScreenKDM> screen_kdms = film->make_kdms (
table->Add (m, 0, flags, DCPOMATIC_SIZER_Y_GAP);
}
- _dcp_filename_format = new NameFormatEditor<dcp::FilenameFormat> (_panel, Config::instance()->dcp_filename_format());
- dcp::NameFormat::Map example;
- example["type"] = "j2c";
- example["id"] = "eb1c112c-ca3c-4ae6-9263-c6714ff05d64";
- _dcp_filename_format->set_example (example);
+ dcp::NameFormat::Map titles;
+ titles['t'] = "type (j2c/pcm/sub/cpl/pkl)";
+ titles['i'] = "unique ID";
+ dcp::NameFormat::Map examples;
+ examples['t'] = "j2c";
+ examples['i'] = "eb1c112c-ca3c-4ae6-9263-c6714ff05d64";
+ _dcp_filename_format = new NameFormatEditor<dcp::FilenameFormat> (_panel, Config::instance()->dcp_filename_format(), titles, examples);
table->Add (_dcp_filename_format->panel(), 1, wxEXPAND | wxALL);
#ifdef __WXOSX__
);
dcp::NameFormat::Map name_values;
- name_values["film_name"] = film->name();
- name_values["from"] = dcp::LocalTime(_timing->from()).date() + " " + dcp::LocalTime(_timing->from()).time_of_day();
- name_values["to"] = dcp::LocalTime(_timing->until()).date() + " " + dcp::LocalTime(_timing->until()).time_of_day();
+ name_values['f'] = film->name();
+ name_values['b'] = dcp::LocalTime(_timing->from()).date() + " " + dcp::LocalTime(_timing->from()).time_of_day();
+ name_values['e'] = dcp::LocalTime(_timing->until()).date() + " " + dcp::LocalTime(_timing->until()).time_of_day();
if (_output->write_to ()) {
ScreenKDM::write_files (
_type->SetSelection (0);
{
- int flags = wxALIGN_TOP | wxTOP | wxLEFT;
+ int flags = wxALIGN_TOP | wxTOP | wxLEFT | wxRIGHT;
wxString t = _("Filename format");
#ifdef __WXOSX__
flags |= wxALIGN_RIGHT;
table->Add (m, 0, flags, DCPOMATIC_SIZER_Y_GAP);
}
- _filename_format = new NameFormatEditor<KDMNameFormat> (this, Config::instance()->kdm_filename_format());
+ dcp::NameFormat::Map titles;
+ titles['f'] = "film name";
+ titles['c'] = "cinema";
+ titles['s'] = "screen";
+ titles['b'] = "from date/time";
+ titles['e'] = "to date/time";
dcp::NameFormat::Map ex;
- ex["film_name"] = "Bambi";
- ex["cinema"] = "Lumière";
- ex["screen"] = "Screen 1";
- ex["from"] = "2012/03/15 12:30";
- ex["to"] = "2012/03/22 02:30";
- _filename_format->set_example (ex);
+ ex['f'] = "Bambi";
+ ex['c'] = "Lumière";
+ ex['s'] = "Screen 1";
+ ex['b'] = "2012/03/15 12:30";
+ ex['e'] = "2012/03/22 02:30";
+ _filename_format = new NameFormatEditor<KDMNameFormat> (this, Config::instance()->kdm_filename_format(), titles, ex);
table->Add (_filename_format->panel(), 1, wxEXPAND);
_write_to = new wxRadioButton (this, wxID_ANY, _("Write to"));
class NameFormatEditor
{
public:
- NameFormatEditor (wxWindow* parent, T name)
+ NameFormatEditor (wxWindow* parent, T name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples)
: _panel (new wxPanel (parent))
, _example (new wxStaticText (_panel, wxID_ANY, ""))
, _sizer (new wxBoxSizer (wxVERTICAL))
, _specification (new wxTextCtrl (_panel, wxID_ANY, ""))
, _name (name)
+ , _examples (examples)
{
_sizer->Add (_specification, 0, wxEXPAND, DCPOMATIC_SIZER_Y_GAP);
_sizer->Add (_example, 0, wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
_panel->SetSizer (_sizer);
- BOOST_FOREACH (dcp::NameFormat::Component c, name.components ()) {
- wxStaticText* t = new wxStaticText (_panel, wxID_ANY, std_to_wx (String::compose ("%%%1 %2", c.placeholder, c.title)));
+ BOOST_FOREACH (char c, name.components ()) {
+ wxStaticText* t = new wxStaticText (_panel, wxID_ANY, std_to_wx (String::compose ("%%%1 %2", c, titles[c])));
_sizer->Add (t);
wxFont font = t->GetFont();
font.SetStyle (wxFONTSTYLE_ITALIC);
update_example ();
}
- wxPanel* panel () const
- {
+ wxPanel* panel () const {
return _panel;
}
- void set_example (dcp::NameFormat::Map v) {
- _example_values = v;
- update_example ();
- }
-
T get () const {
return _name;
}
{
_name.set_specification (wx_to_std (_specification->GetValue ()));
- wxString example = wxString::Format (_("e.g. %s"), _name.get (_example_values));
+ wxString example = wxString::Format (_("e.g. %s"), _name.get (_examples));
wxString wrapped;
for (size_t i = 0; i < example.Length(); ++i) {
if (i > 0 && (i % 30) == 0) {
wxTextCtrl* _specification;
T _name;
- dcp::NameFormat::Map _example_values;
+ dcp::NameFormat::Map _examples;
};
#endif