ffmpeg_options = {}
return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
- ('libdcp', 'f3fb557'),
+ ('libdcp', 'd46f968'),
('libsub', '067c21c'))
def configure_options(target):
#include "emailer.h"
#include "compose.hpp"
#include "log.h"
-#include "kdm_filename_format.h"
#include <zip.h>
#include <boost/foreach.hpp>
using boost::shared_ptr;
void
-CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, KDMFilenameFormat name_format, dcp::NameFormat::Map name_values) const
+CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat 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);
CinemaKDMs::write_zip_files (
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
- KDMFilenameFormat name_format,
+ dcp::NameFormat name_format,
dcp::NameFormat::Map name_values
)
{
void
CinemaKDMs::email (
list<CinemaKDMs> cinema_kdms,
- KDMFilenameFormat name_format,
+ dcp::NameFormat name_format,
dcp::NameFormat::Map name_values,
string cpl_name,
shared_ptr<Log> log
class CinemaKDMs
{
public:
- void make_zip_file (boost::filesystem::path zip_file, KDMFilenameFormat name_format, dcp::NameFormat::Map name_values) const;
+ void make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values) const;
static std::list<CinemaKDMs> collect (std::list<ScreenKDM> kdms);
static void write_zip_files (
std::list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
- KDMFilenameFormat name_format,
+ dcp::NameFormat name_format,
dcp::NameFormat::Map name_values
);
static void email (
std::list<CinemaKDMs> cinema_kdms,
- KDMFilenameFormat name_format,
+ dcp::NameFormat name_format,
dcp::NameFormat::Map name_values,
std::string cpl_name,
boost::shared_ptr<Log> log
#include "util.h"
#include "cross.h"
#include "raw_convert.h"
-#include "kdm_filename_format.h"
-#include <dcp/filename_format.h>
+#include <dcp/name_format.h>
#include <dcp/colour_matrix.h>
#include <dcp/certificate_chain.h>
#include <libcxml/cxml.h>
#endif
_cinemas_file = path ("cinemas.xml");
_show_hints_before_make_dcp = true;
- _kdm_filename_format = KDMFilenameFormat ("KDM %f %c %s");
- _dcp_filename_format = dcp::FilenameFormat ("%t_%i");
+ _kdm_filename_format = dcp::NameFormat ("KDM %f %c %s");
+ _dcp_filename_format = dcp::NameFormat ("%t_%i");
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
_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 = 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"));
+ _kdm_filename_format = dcp::NameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s"));
+ _dcp_filename_format = dcp::NameFormat (f.optional_string_child("DCPFilenameFormat").get_value_or ("%t_%i.mxf"));
/* Replace any cinemas from config.xml with those from the configured file */
if (boost::filesystem::exists (_cinemas_file)) {
#define DCPOMATIC_CONFIG_H
#include "isdcf_metadata.h"
-#include "kdm_filename_format.h"
#include "types.h"
-#include <dcp/filename_format.h>
+#include <dcp/name_format.h>
#include <dcp/certificate_chain.h>
#include <dcp/encrypted_kdm.h>
#include <boost/shared_ptr.hpp>
return _show_hints_before_make_dcp;
}
- KDMFilenameFormat kdm_filename_format () const {
+ dcp::NameFormat kdm_filename_format () const {
return _kdm_filename_format;
}
- dcp::FilenameFormat dcp_filename_format () const {
+ dcp::NameFormat dcp_filename_format () const {
return _dcp_filename_format;
}
maybe_set (_show_hints_before_make_dcp, s);
}
- void set_kdm_filename_format (KDMFilenameFormat n) {
+ void set_kdm_filename_format (dcp::NameFormat n) {
maybe_set (_kdm_filename_format, n);
}
- void set_dcp_filename_format (dcp::FilenameFormat n) {
+ void set_dcp_filename_format (dcp::NameFormat n) {
maybe_set (_dcp_filename_format, n);
}
std::vector<dcp::EncryptedKDM> _dkdms;
boost::filesystem::path _cinemas_file;
bool _show_hints_before_make_dcp;
- KDMFilenameFormat _kdm_filename_format;
- dcp::FilenameFormat _dcp_filename_format;
+ dcp::NameFormat _kdm_filename_format;
+ dcp::NameFormat _dcp_filename_format;
/** Singleton instance, or 0 */
static Config* _instance;
+++ /dev/null
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- 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 <http://www.gnu.org/licenses/>.
-
-*/
-
-#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');
-}
+++ /dev/null
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- 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 <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_KDM_FILENAME_FORMAT
-#define DCPOMATIC_KDM_FILENAME_FORMAT
-
-#include <dcp/name_format.h>
-
-class KDMFilenameFormat : public dcp::NameFormat
-{
-public:
- KDMFilenameFormat () {}
- KDMFilenameFormat (std::string specification);
-};
-
-#endif
}
void
-ScreenKDM::write_files (list<ScreenKDM> screen_kdms, boost::filesystem::path directory, KDMFilenameFormat name_format, dcp::NameFormat::Map name_values)
+ScreenKDM::write_files (list<ScreenKDM> screen_kdms, boost::filesystem::path directory, dcp::NameFormat name_format, dcp::NameFormat::Map name_values)
{
/* Write KDMs to the specified directory */
BOOST_FOREACH (ScreenKDM const & i, screen_kdms) {
#ifndef DCPOMATIC_SCREEN_KDM_H
#define DCPOMATIC_SCREEN_KDM_H
-#include "kdm_filename_format.h"
#include <dcp/encrypted_kdm.h>
+#include <dcp/name_format.h>
#include <boost/shared_ptr.hpp>
class Screen;
static void write_files (
std::list<ScreenKDM> screen_kdms, boost::filesystem::path directory,
- KDMFilenameFormat name_format, dcp::NameFormat::Map name_values
+ dcp::NameFormat name_format, dcp::NameFormat::Map name_values
);
boost::shared_ptr<Screen> screen;
/** @param log Log to write to, or 0 */
SendKDMEmailJob::SendKDMEmailJob (
list<CinemaKDMs> cinema_kdms,
- KDMFilenameFormat name_format,
+ dcp::NameFormat name_format,
dcp::NameFormat::Map name_values,
string cpl_name,
shared_ptr<Log> log
*/
#include "job.h"
-#include "kdm_filename_format.h"
#include <dcp/types.h>
+#include <dcp/name_format.h>
#include <boost/filesystem.hpp>
class Screen;
public:
SendKDMEmailJob (
std::list<CinemaKDMs> cinema_kdms,
- KDMFilenameFormat name_format,
+ dcp::NameFormat name_format,
dcp::NameFormat::Map name_values,
std::string cpl_name,
boost::shared_ptr<Log> log
void run ();
private:
- KDMFilenameFormat _name_format;
+ dcp::NameFormat _name_format;
dcp::NameFormat::Map _name_values;
std::string _cpl_name;
std::list<CinemaKDMs> _cinema_kdms;
job.cc
job_manager.cc
json_server.cc
- kdm_filename_format.cc
log.cc
log_entry.cc
magick_image_proxy.cc
examples['i'] = "eb1c112c-ca3c-4ae6-9263-c6714ff05d64";
examples['r'] = "1";
examples['n'] = "4";
- _dcp_filename_format = new NameFormatEditor<dcp::FilenameFormat> (_panel, Config::instance()->dcp_filename_format(), titles, examples);
+ _dcp_filename_format = new NameFormatEditor (_panel, Config::instance()->dcp_filename_format(), titles, examples);
table->Add (_dcp_filename_format->panel(), 1, wxEXPAND | wxALL);
#ifdef __WXOSX__
wxSpinCtrl* _maximum_j2k_bandwidth;
wxCheckBox* _allow_any_dcp_frame_rate;
wxCheckBox* _only_servers_encode;
- NameFormatEditor<dcp::FilenameFormat>* _dcp_filename_format;
+ NameFormatEditor* _dcp_filename_format;
wxCheckBox* _log_general;
wxCheckBox* _log_warning;
wxCheckBox* _log_error;
*/
#include "wx_util.h"
-#include "lib/kdm_filename_format.h"
#include <dcp/types.h>
#include <wx/wx.h>
#include <boost/shared_ptr.hpp>
ex['s'] = "Screen 1";
ex['b'] = "2012/03/15 12:30";
ex['e'] = "2012/03/22 02:30";
- _filename_format = new NameFormatEditor<KDMFilenameFormat> (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"));
Config::instance()->set_kdm_filename_format (name_format ());
}
-KDMFilenameFormat
+dcp::NameFormat
KDMOutputPanel::name_format () const
{
return _filename_format->get ();
#include "wx_util.h"
#include "name_format_editor.h"
-#include "lib/kdm_filename_format.h"
#include <dcp/types.h>
#include <wx/wx.h>
#include <boost/filesystem.hpp>
boost::filesystem::path directory () const;
bool write_to () const;
dcp::Formulation formulation () const;
- KDMFilenameFormat name_format () const;
+ dcp::NameFormat name_format () const;
void setup_sensitivity ();
void save_kdm_name_format () const;
private:
wxChoice* _type;
- NameFormatEditor<KDMFilenameFormat>* _filename_format;
+ NameFormatEditor* _filename_format;
wxRadioButton* _write_to;
#ifdef DCPOMATIC_USE_OWN_PICKER
DirPickerCtrl* _folder;
#include <dcp/name_format.h>
#include <wx/wx.h>
#include <boost/foreach.hpp>
+#include <boost/signals2.hpp>
-template <class T>
class NameFormatEditor
{
public:
- 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 (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);
- font.SetPointSize (font.GetPointSize() - 1);
- t->SetFont (font);
- t->SetForegroundColour (wxColour (0, 0, 204));
- }
-
- _specification->SetValue (std_to_wx (_name.specification ()));
- _specification->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&NameFormatEditor::changed, this));
-
- update_example ();
- }
+ NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples);
wxPanel* panel () const {
return _panel;
}
- T get () const {
+ dcp::NameFormat get () const {
return _name;
}
private:
- void changed ()
- {
- update_example ();
- Changed ();
- }
-
- virtual void update_example ()
- {
- _name.set_specification (wx_to_std (_specification->GetValue ()));
-
- 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 % 40) == 0) {
- wrapped += "\n";
- }
- wrapped += example[i];
- }
-
- _example->SetLabel (wrapped);
- }
+ void changed ();
+ void update_example ();
wxPanel* _panel;
wxStaticText* _example;
wxSizer* _sizer;
wxTextCtrl* _specification;
- T _name;
+ dcp::NameFormat _name;
dcp::NameFormat::Map _examples;
};
key_dialog.cc
make_chain_dialog.cc
move_to_dialog.cc
+ name_format_editor.cc
new_film_dialog.cc
playhead_to_timecode_dialog.cc
playhead_to_frame_dialog.cc
BOOST_AUTO_TEST_CASE (file_naming_test)
{
- dcp::FilenameFormat nf ("%c");
- Config::instance()->set_dcp_filename_format (dcp::FilenameFormat ("%c"));
+ dcp::NameFormat nf ("%c");
+ Config::instance()->set_dcp_filename_format (dcp::NameFormat ("%c"));
shared_ptr<Film> film = new_test_film ("file_naming_test");
film->set_name ("file_naming_test");
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));