From: Carl Hetherington Date: Fri, 29 Jul 2016 15:29:34 +0000 (+0100) Subject: Rename KDMNameFormat. X-Git-Tag: v2.9.9~10 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=f4964573a60155545e02cbbebc47199f7480cf14 Rename KDMNameFormat. --- diff --git a/src/lib/cinema_kdms.cc b/src/lib/cinema_kdms.cc index c50578734..78e7c5ace 100644 --- a/src/lib/cinema_kdms.cc +++ b/src/lib/cinema_kdms.cc @@ -27,7 +27,7 @@ #include "emailer.h" #include "compose.hpp" #include "log.h" -#include "kdm_name_format.h" +#include "kdm_filename_format.h" #include #include @@ -40,7 +40,7 @@ using std::runtime_error; using boost::shared_ptr; void -CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, KDMNameFormat name_format, dcp::NameFormat::Map name_values) const +CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, KDMFilenameFormat name_format, dcp::NameFormat::Map name_values) const { int error; struct zip* zip = zip_open (zip_file.string().c_str(), ZIP_CREATE | ZIP_EXCL, &error); @@ -119,7 +119,7 @@ void CinemaKDMs::write_zip_files ( list cinema_kdms, boost::filesystem::path directory, - KDMNameFormat name_format, + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values ) { @@ -140,7 +140,7 @@ CinemaKDMs::write_zip_files ( void CinemaKDMs::email ( list cinema_kdms, - KDMNameFormat name_format, + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values, string cpl_name, shared_ptr log diff --git a/src/lib/cinema_kdms.h b/src/lib/cinema_kdms.h index 53cf84d66..826b93806 100644 --- a/src/lib/cinema_kdms.h +++ b/src/lib/cinema_kdms.h @@ -27,20 +27,20 @@ class Log; class CinemaKDMs { public: - void make_zip_file (boost::filesystem::path zip_file, KDMNameFormat name_format, dcp::NameFormat::Map name_values) const; + void make_zip_file (boost::filesystem::path zip_file, KDMFilenameFormat name_format, dcp::NameFormat::Map name_values) const; static std::list collect (std::list kdms); static void write_zip_files ( std::list cinema_kdms, boost::filesystem::path directory, - KDMNameFormat name_format, + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values ); static void email ( std::list cinema_kdms, - KDMNameFormat name_format, + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values, std::string cpl_name, boost::shared_ptr log diff --git a/src/lib/config.cc b/src/lib/config.cc index b456c605c..d332c805a 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -30,7 +30,7 @@ #include "util.h" #include "cross.h" #include "raw_convert.h" -#include "kdm_name_format.h" +#include "kdm_filename_format.h" #include #include #include @@ -110,7 +110,7 @@ Config::set_defaults () #endif _cinemas_file = path ("cinemas.xml"); _show_hints_before_make_dcp = true; - _kdm_filename_format = KDMNameFormat ("KDM %f %c %s"); + _kdm_filename_format = KDMFilenameFormat ("KDM %f %c %s"); _dcp_filename_format = dcp::FilenameFormat ("%t_%i"); _allowed_dcp_frame_rates.clear (); @@ -294,7 +294,7 @@ try _cinemas_file = f.optional_string_child("CinemasFile").get_value_or (path ("cinemas.xml").string ()); _show_hints_before_make_dcp = f.optional_bool_child("ShowHintsBeforeMakeDCP").get_value_or (true); - _kdm_filename_format = KDMNameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s")); + _kdm_filename_format = KDMFilenameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s")); _dcp_filename_format = dcp::FilenameFormat (f.optional_string_child("DCPFilenameFormat").get_value_or ("%t_%i.mxf")); /* Replace any cinemas from config.xml with those from the configured file */ diff --git a/src/lib/config.h b/src/lib/config.h index 37a55a695..913372c31 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -26,7 +26,7 @@ #define DCPOMATIC_CONFIG_H #include "isdcf_metadata.h" -#include "kdm_name_format.h" +#include "kdm_filename_format.h" #include "types.h" #include #include @@ -268,7 +268,7 @@ public: return _show_hints_before_make_dcp; } - KDMNameFormat kdm_filename_format () const { + KDMFilenameFormat kdm_filename_format () const { return _kdm_filename_format; } @@ -484,7 +484,7 @@ public: maybe_set (_show_hints_before_make_dcp, s); } - void set_kdm_filename_format (KDMNameFormat n) { + void set_kdm_filename_format (KDMFilenameFormat n) { maybe_set (_kdm_filename_format, n); } @@ -603,7 +603,7 @@ private: std::vector _dkdms; boost::filesystem::path _cinemas_file; bool _show_hints_before_make_dcp; - KDMNameFormat _kdm_filename_format; + KDMFilenameFormat _kdm_filename_format; dcp::FilenameFormat _dcp_filename_format; /** Singleton instance, or 0 */ diff --git a/src/lib/kdm_filename_format.cc b/src/lib/kdm_filename_format.cc new file mode 100644 index 000000000..20e8298fe --- /dev/null +++ b/src/lib/kdm_filename_format.cc @@ -0,0 +1,38 @@ +/* + Copyright (C) 2016 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#include "kdm_filename_format.h" + +using std::string; + +KDMFilenameFormat::KDMFilenameFormat (string specification) + : NameFormat (specification) +{ + /* film name */ + add ('f'); + /* cinema */ + add ('c'); + /* screen */ + add ('s'); + /* from date/time */ + add ('b'); + /* to date/time */ + add ('e'); +} diff --git a/src/lib/kdm_filename_format.h b/src/lib/kdm_filename_format.h new file mode 100644 index 000000000..b96ac34ae --- /dev/null +++ b/src/lib/kdm_filename_format.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2016 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#ifndef DCPOMATIC_KDM_FILENAME_FORMAT +#define DCPOMATIC_KDM_FILENAME_FORMAT + +#include + +class KDMFilenameFormat : public dcp::NameFormat +{ +public: + KDMFilenameFormat () {} + KDMFilenameFormat (std::string specification); +}; + +#endif diff --git a/src/lib/kdm_name_format.cc b/src/lib/kdm_name_format.cc deleted file mode 100644 index bf17acbf1..000000000 --- a/src/lib/kdm_name_format.cc +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2016 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - -#include "kdm_name_format.h" - -using std::string; - -KDMNameFormat::KDMNameFormat (string specification) - : NameFormat (specification) -{ - /* film name */ - add ('f'); - /* cinema */ - add ('c'); - /* screen */ - add ('s'); - /* from date/time */ - add ('b'); - /* to date/time */ - add ('e'); -} diff --git a/src/lib/kdm_name_format.h b/src/lib/kdm_name_format.h deleted file mode 100644 index 1f5a9ab61..000000000 --- a/src/lib/kdm_name_format.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2016 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - -#ifndef DCPOMATIC_KDM_NAME_FORMAT -#define DCPOMATIC_KDM_NAME_FORMAT - -#include - -class KDMNameFormat : public dcp::NameFormat -{ -public: - KDMNameFormat () {} - KDMNameFormat (std::string specification); -}; - -#endif diff --git a/src/lib/screen_kdm.cc b/src/lib/screen_kdm.cc index 3290d2a68..9cb831622 100644 --- a/src/lib/screen_kdm.cc +++ b/src/lib/screen_kdm.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington + Copyright (C) 2013-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -35,7 +35,7 @@ operator== (ScreenKDM const & a, ScreenKDM const & b) } void -ScreenKDM::write_files (list screen_kdms, boost::filesystem::path directory, KDMNameFormat name_format, dcp::NameFormat::Map name_values) +ScreenKDM::write_files (list screen_kdms, boost::filesystem::path directory, KDMFilenameFormat name_format, dcp::NameFormat::Map name_values) { /* Write KDMs to the specified directory */ BOOST_FOREACH (ScreenKDM const & i, screen_kdms) { diff --git a/src/lib/screen_kdm.h b/src/lib/screen_kdm.h index d9031f188..227526449 100644 --- a/src/lib/screen_kdm.h +++ b/src/lib/screen_kdm.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington + Copyright (C) 2013-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -21,7 +21,7 @@ #ifndef DCPOMATIC_SCREEN_KDM_H #define DCPOMATIC_SCREEN_KDM_H -#include "kdm_name_format.h" +#include "kdm_filename_format.h" #include #include @@ -38,7 +38,7 @@ public: static void write_files ( std::list screen_kdms, boost::filesystem::path directory, - KDMNameFormat name_format, dcp::NameFormat::Map name_values + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values ); boost::shared_ptr screen; diff --git a/src/lib/send_kdm_email_job.cc b/src/lib/send_kdm_email_job.cc index e4b20167e..b06704545 100644 --- a/src/lib/send_kdm_email_job.cc +++ b/src/lib/send_kdm_email_job.cc @@ -33,7 +33,7 @@ using boost::shared_ptr; /** @param log Log to write to, or 0 */ SendKDMEmailJob::SendKDMEmailJob ( list cinema_kdms, - KDMNameFormat name_format, + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values, string cpl_name, shared_ptr log diff --git a/src/lib/send_kdm_email_job.h b/src/lib/send_kdm_email_job.h index bfb4d6c52..17b2db89c 100644 --- a/src/lib/send_kdm_email_job.h +++ b/src/lib/send_kdm_email_job.h @@ -19,7 +19,7 @@ */ #include "job.h" -#include "kdm_name_format.h" +#include "kdm_filename_format.h" #include #include @@ -32,7 +32,7 @@ class SendKDMEmailJob : public Job public: SendKDMEmailJob ( std::list cinema_kdms, - KDMNameFormat name_format, + KDMFilenameFormat name_format, dcp::NameFormat::Map name_values, std::string cpl_name, boost::shared_ptr log @@ -43,7 +43,7 @@ public: void run (); private: - KDMNameFormat _name_format; + KDMFilenameFormat _name_format; dcp::NameFormat::Map _name_values; std::string _cpl_name; std::list _cinema_kdms; diff --git a/src/lib/wscript b/src/lib/wscript index 6a8945d84..6e937c26f 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -94,7 +94,7 @@ sources = """ job.cc job_manager.cc json_server.cc - kdm_name_format.cc + kdm_filename_format.cc log.cc log_entry.cc magick_image_proxy.cc diff --git a/src/wx/kdm_dialog.h b/src/wx/kdm_dialog.h index bae2fc16b..07b998224 100644 --- a/src/wx/kdm_dialog.h +++ b/src/wx/kdm_dialog.h @@ -19,7 +19,7 @@ */ #include "wx_util.h" -#include "lib/kdm_name_format.h" +#include "lib/kdm_filename_format.h" #include #include #include diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index 4efb9fb27..2808357d4 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -68,7 +68,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop) ex['s'] = "Screen 1"; ex['b'] = "2012/03/15 12:30"; ex['e'] = "2012/03/22 02:30"; - _filename_format = new NameFormatEditor (this, Config::instance()->kdm_filename_format(), titles, ex); + _filename_format = new NameFormatEditor (this, Config::instance()->kdm_filename_format(), titles, ex); table->Add (_filename_format->panel(), 1, wxEXPAND); _write_to = new wxRadioButton (this, wxID_ANY, _("Write to")); @@ -126,7 +126,7 @@ KDMOutputPanel::save_kdm_name_format () const Config::instance()->set_kdm_filename_format (name_format ()); } -KDMNameFormat +KDMFilenameFormat KDMOutputPanel::name_format () const { return _filename_format->get (); diff --git a/src/wx/kdm_output_panel.h b/src/wx/kdm_output_panel.h index 002b189f5..ee6a94e68 100644 --- a/src/wx/kdm_output_panel.h +++ b/src/wx/kdm_output_panel.h @@ -20,7 +20,7 @@ #include "wx_util.h" #include "name_format_editor.h" -#include "lib/kdm_name_format.h" +#include "lib/kdm_filename_format.h" #include #include #include @@ -36,14 +36,14 @@ public: boost::filesystem::path directory () const; bool write_to () const; dcp::Formulation formulation () const; - KDMNameFormat name_format () const; + KDMFilenameFormat name_format () const; void setup_sensitivity (); void save_kdm_name_format () const; private: wxChoice* _type; - NameFormatEditor* _filename_format; + NameFormatEditor* _filename_format; wxRadioButton* _write_to; #ifdef DCPOMATIC_USE_OWN_PICKER DirPickerCtrl* _folder;