name_values['c'] = cinema->name;
- BOOST_FOREACH (shared_ptr<ScreenKDM> i, screen_kdms) {
+ BOOST_FOREACH (shared_ptr<KDMWithMetadata> i, screen_kdms) {
name_values['s'] = i->screen->name;
name_values['i'] = i->kdm_id ();
string const name = careful_string_filter(name_format.get(name_values, ".xml"));
zipper.close ();
}
-/** Collect a list of ScreenKDMs into a list of CinemaKDMs so that each
+/** Collect a list of KDMWithMetadatas into a list of CinemaKDMs so that each
* CinemaKDM contains the KDMs for its cinema.
*/
list<CinemaKDMs>
-CinemaKDMs::collect (list<shared_ptr<ScreenKDM> > screen_kdms)
+CinemaKDMs::collect (list<shared_ptr<KDMWithMetadata> > screen_kdms)
{
list<CinemaKDMs> cinema_kdms;
CinemaKDMs ck;
- list<shared_ptr<ScreenKDM> >::iterator i = screen_kdms.begin ();
+ list<shared_ptr<KDMWithMetadata> >::iterator i = screen_kdms.begin ();
ck.cinema = (*i)->screen->cinema;
ck.screen_kdms.push_back (*i);
- list<shared_ptr<ScreenKDM> >::iterator j = i;
+ list<shared_ptr<KDMWithMetadata> >::iterator j = i;
++i;
screen_kdms.remove (*j);
while (i != screen_kdms.end ()) {
if ((*i)->screen->cinema == ck.cinema) {
ck.screen_kdms.push_back (*i);
- list<shared_ptr<ScreenKDM> >::iterator j = i;
+ list<shared_ptr<KDMWithMetadata> >::iterator j = i;
++i;
screen_kdms.remove (*j);
} else {
path /= container_name_format.get(name_values, "");
if (!boost::filesystem::exists (path) || confirm_overwrite (path)) {
boost::filesystem::create_directories (path);
- ScreenKDM::write_files (i.screen_kdms, path, filename_format, name_values, confirm_overwrite);
+ KDMWithMetadata::write_files (i.screen_kdms, path, filename_format, name_values, confirm_overwrite);
}
written += i.screen_kdms.size();
}
boost::algorithm::replace_all (body, "$CINEMA_NAME", i.cinema->name);
string screens;
- BOOST_FOREACH (shared_ptr<ScreenKDM> j, i.screen_kdms) {
+ BOOST_FOREACH (shared_ptr<KDMWithMetadata> j, i.screen_kdms) {
screens += j->screen->name + ", ";
}
boost::algorithm::replace_all (body, "$SCREENS", screens.substr (0, screens.length() - 2));
*/
-#include "screen_kdm.h"
+#include "kdm_with_metadata.h"
class Cinema;
class Job;
public:
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<boost::shared_ptr<ScreenKDM> > kdms);
+ static std::list<CinemaKDMs> collect (std::list<boost::shared_ptr<KDMWithMetadata> > kdms);
static int write_directories (
std::list<CinemaKDMs> cinema_kdms,
);
boost::shared_ptr<Cinema> cinema;
- std::list<boost::shared_ptr<ScreenKDM> > screen_kdms;
+ std::list<boost::shared_ptr<KDMWithMetadata> > screen_kdms;
};
#include "text_content.h"
#include "ffmpeg_content.h"
#include "dcp_content.h"
-#include "screen_kdm.h"
+#include "kdm_with_metadata.h"
#include "cinema.h"
#include "change_signaller.h"
#include "check_content_change_job.h"
--- /dev/null
+/*
+ Copyright (C) 2013-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_with_metadata.h"
+#include "cinema.h"
+#include "screen.h"
+#include "util.h"
+#include <boost/foreach.hpp>
+
+using std::string;
+using std::cout;
+using std::list;
+using boost::shared_ptr;
+
+int
+KDMWithMetadata::write_files (
+ list<shared_ptr<KDMWithMetadata> > screen_kdms,
+ boost::filesystem::path directory,
+ dcp::NameFormat name_format,
+ dcp::NameFormat::Map name_values,
+ boost::function<bool (boost::filesystem::path)> confirm_overwrite
+ )
+{
+ int written = 0;
+
+ if (directory == "-") {
+ /* Write KDMs to the stdout */
+ BOOST_FOREACH (shared_ptr<KDMWithMetadata> i, screen_kdms) {
+ cout << i->kdm_as_xml ();
+ ++written;
+ }
+
+ return written;
+ }
+
+ if (!boost::filesystem::exists (directory)) {
+ boost::filesystem::create_directories (directory);
+ }
+
+ /* Write KDMs to the specified directory */
+ BOOST_FOREACH (shared_ptr<KDMWithMetadata> i, screen_kdms) {
+ name_values['c'] = i->screen->cinema ? i->screen->cinema->name : "";
+ name_values['s'] = i->screen->name;
+ name_values['i'] = i->kdm_id ();
+ boost::filesystem::path out = directory / careful_string_filter(name_format.get(name_values, ".xml"));
+ if (!boost::filesystem::exists (out) || confirm_overwrite (out)) {
+ i->kdm_as_xml (out);
+ ++written;
+ }
+ }
+
+ return written;
+}
--- /dev/null
+/*
+ Copyright (C) 2013-2019 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_WITH_METADATA_H
+#define DCPOMATIC_KDM_WITH_METADATA_H
+
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+#include "encrypted_ecinema_kdm.h"
+#endif
+#include <dcp/encrypted_kdm.h>
+#include <dcp/name_format.h>
+#include <boost/shared_ptr.hpp>
+
+namespace dcpomatic {
+ class Screen;
+}
+
+/** Simple class to collect a screen and an encrypted KDM */
+class KDMWithMetadata
+{
+public:
+ KDMWithMetadata (boost::shared_ptr<dcpomatic::Screen> s)
+ : screen (s)
+ {}
+
+ virtual ~KDMWithMetadata () {}
+
+ virtual std::string kdm_as_xml () const = 0;
+ virtual void kdm_as_xml (boost::filesystem::path out) const = 0;
+ virtual std::string kdm_id () const = 0;
+
+ static int write_files (
+ std::list<boost::shared_ptr<KDMWithMetadata> > screen_kdms, boost::filesystem::path directory,
+ dcp::NameFormat name_format, dcp::NameFormat::Map name_values,
+ boost::function<bool (boost::filesystem::path)> confirm_overwrite
+ );
+
+ boost::shared_ptr<dcpomatic::Screen> screen;
+};
+
+class DCPKDMWithMetadata : public KDMWithMetadata
+{
+public:
+ DCPKDMWithMetadata (boost::shared_ptr<dcpomatic::Screen> s, dcp::EncryptedKDM k)
+ : KDMWithMetadata (s)
+ , kdm (k)
+ {}
+
+ std::string kdm_as_xml () const {
+ return kdm.as_xml ();
+ }
+
+ void kdm_as_xml (boost::filesystem::path out) const {
+ return kdm.as_xml (out);
+ }
+
+ std::string kdm_id () const {
+ return kdm.cpl_id ();
+ }
+
+ dcp::EncryptedKDM kdm;
+};
+
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+class ECinemaKDMWithMetadata : public KDMWithMetadata
+{
+public:
+ ECinemaKDMWithMetadata (boost::shared_ptr<dcpomatic::Screen> s, EncryptedECinemaKDM k)
+ : KDMWithMetadata (s)
+ , kdm (k)
+ {}
+
+ std::string kdm_as_xml () const {
+ return kdm.as_xml ();
+ }
+
+ void kdm_as_xml (boost::filesystem::path out) const {
+ return kdm.as_xml (out);
+ }
+
+ std::string kdm_id () const {
+ return kdm.id ();
+ }
+
+ EncryptedECinemaKDM kdm;
+};
+#endif
+
+#endif
+++ /dev/null
-/*
- Copyright (C) 2013-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 "screen_kdm.h"
-#include "cinema.h"
-#include "screen.h"
-#include "util.h"
-#include <boost/foreach.hpp>
-
-using std::string;
-using std::cout;
-using std::list;
-using boost::shared_ptr;
-
-int
-ScreenKDM::write_files (
- list<shared_ptr<ScreenKDM> > screen_kdms,
- boost::filesystem::path directory,
- dcp::NameFormat name_format,
- dcp::NameFormat::Map name_values,
- boost::function<bool (boost::filesystem::path)> confirm_overwrite
- )
-{
- int written = 0;
-
- if (directory == "-") {
- /* Write KDMs to the stdout */
- BOOST_FOREACH (shared_ptr<ScreenKDM> i, screen_kdms) {
- cout << i->kdm_as_xml ();
- ++written;
- }
-
- return written;
- }
-
- if (!boost::filesystem::exists (directory)) {
- boost::filesystem::create_directories (directory);
- }
-
- /* Write KDMs to the specified directory */
- BOOST_FOREACH (shared_ptr<ScreenKDM> i, screen_kdms) {
- name_values['c'] = i->screen->cinema ? i->screen->cinema->name : "";
- name_values['s'] = i->screen->name;
- name_values['i'] = i->kdm_id ();
- boost::filesystem::path out = directory / careful_string_filter(name_format.get(name_values, ".xml"));
- if (!boost::filesystem::exists (out) || confirm_overwrite (out)) {
- i->kdm_as_xml (out);
- ++written;
- }
- }
-
- return written;
-}
+++ /dev/null
-/*
- Copyright (C) 2013-2019 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_SCREEN_KDM_H
-#define DCPOMATIC_SCREEN_KDM_H
-
-#ifdef DCPOMATIC_VARIANT_SWAROOP
-#include "encrypted_ecinema_kdm.h"
-#endif
-#include <dcp/encrypted_kdm.h>
-#include <dcp/name_format.h>
-#include <boost/shared_ptr.hpp>
-
-namespace dcpomatic {
- class Screen;
-}
-
-/** Simple class to collect a screen and an encrypted KDM */
-class ScreenKDM
-{
-public:
- ScreenKDM (boost::shared_ptr<dcpomatic::Screen> s)
- : screen (s)
- {}
-
- virtual ~ScreenKDM () {}
-
- virtual std::string kdm_as_xml () const = 0;
- virtual void kdm_as_xml (boost::filesystem::path out) const = 0;
- virtual std::string kdm_id () const = 0;
-
- static int write_files (
- std::list<boost::shared_ptr<ScreenKDM> > screen_kdms, boost::filesystem::path directory,
- dcp::NameFormat name_format, dcp::NameFormat::Map name_values,
- boost::function<bool (boost::filesystem::path)> confirm_overwrite
- );
-
- boost::shared_ptr<dcpomatic::Screen> screen;
-};
-
-class DCPScreenKDM : public ScreenKDM
-{
-public:
- DCPScreenKDM (boost::shared_ptr<dcpomatic::Screen> s, dcp::EncryptedKDM k)
- : ScreenKDM (s)
- , kdm (k)
- {}
-
- std::string kdm_as_xml () const {
- return kdm.as_xml ();
- }
-
- void kdm_as_xml (boost::filesystem::path out) const {
- return kdm.as_xml (out);
- }
-
- std::string kdm_id () const {
- return kdm.cpl_id ();
- }
-
- dcp::EncryptedKDM kdm;
-};
-
-#ifdef DCPOMATIC_VARIANT_SWAROOP
-class ECinemaScreenKDM : public ScreenKDM
-{
-public:
- ECinemaScreenKDM (boost::shared_ptr<dcpomatic::Screen> s, EncryptedECinemaKDM k)
- : ScreenKDM (s)
- , kdm (k)
- {}
-
- std::string kdm_as_xml () const {
- return kdm.as_xml ();
- }
-
- void kdm_as_xml (boost::filesystem::path out) const {
- return kdm.as_xml (out);
- }
-
- std::string kdm_id () const {
- return kdm.id ();
- }
-
- EncryptedECinemaKDM kdm;
-};
-#endif
-
-#endif
job_manager.cc
j2k_encoder.cc
json_server.cc
+ kdm_with_metadata.cc
lock_file_checker.cc
log.cc
log_entry.cc
scoped_temporary.cc
scp_uploader.cc
screen.cc
- screen_kdm.cc
send_kdm_email_job.cc
send_notification_email_job.cc
send_problem_report_job.cc
#include "lib/job_manager.h"
#include "lib/exceptions.h"
#include "lib/cinema.h"
-#include "lib/screen_kdm.h"
+#include "lib/kdm_with_metadata.h"
#include "lib/send_kdm_email_job.h"
#include "lib/encode_server_finder.h"
#include "lib/update_checker.h"
#include "lib/util.h"
#include "lib/screen.h"
#include "lib/job_manager.h"
-#include "lib/screen_kdm.h"
+#include "lib/kdm_with_metadata.h"
#include "lib/exceptions.h"
#include "lib/cinema_kdms.h"
#include "lib/send_kdm_email_job.h"
return;
}
- list<shared_ptr<ScreenKDM> > screen_kdms;
+ list<shared_ptr<KDMWithMetadata> > screen_kdms;
string title;
#ifdef DCPOMATIC_VARIANT_SWAROOP
/* Encrypt */
screen_kdms.push_back (
- shared_ptr<ScreenKDM>(
- new ECinemaScreenKDM(i, kdm.encrypt(i->recipient.get()))
+ shared_ptr<KDMWithMetadata>(
+ new ECinemaKDMWithMetadata(i, kdm.encrypt(i->recipient.get()))
)
);
}
/* Encrypt */
screen_kdms.push_back (
- shared_ptr<ScreenKDM>(
- new DCPScreenKDM(
+ shared_ptr<KDMWithMetadata>(
+ new DCPKDMWithMetadata(
i,
kdm.encrypt(
signer, i->recipient.get(), i->trusted_device_thumbprints(), _output->formulation(),
#include "lib/film.h"
#include "lib/cinema.h"
-#include "lib/screen_kdm.h"
+#include "lib/kdm_with_metadata.h"
#include "lib/cinema_kdms.h"
#include "lib/config.h"
#include "lib/exceptions.h"
void
write_files (
- list<shared_ptr<ScreenKDM> > screen_kdms,
+ list<shared_ptr<KDMWithMetadata> > screen_kdms,
bool zip,
boost::filesystem::path output,
dcp::NameFormat container_name_format,
cout << "Wrote " << N << " ZIP files to " << output << "\n";
}
} else {
- int const N = ScreenKDM::write_files (
+ int const N = KDMWithMetadata::write_files (
screen_kdms, output, filename_format, values,
bind (&always_overwrite)
);
values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false);
try {
- list<shared_ptr<ScreenKDM> > kdms;
+ list<shared_ptr<KDMWithMetadata> > kdms;
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (i->recipient) {
disable_forensic_marking_audio
);
- kdms.push_back (shared_ptr<ScreenKDM>(new DCPScreenKDM(i, kdm)));
+ kdms.push_back (shared_ptr<KDMWithMetadata>(new DCPKDMWithMetadata(i, kdm)));
}
}
values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false);
try {
- list<shared_ptr<ScreenKDM> > screen_kdms;
+ list<shared_ptr<KDMWithMetadata> > screen_kdms;
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (!i->recipient) {
continue;
}
screen_kdms.push_back (
- shared_ptr<ScreenKDM>(
- new DCPScreenKDM(
+ shared_ptr<KDMWithMetadata>(
+ new DCPKDMWithMetadata(
i,
kdm_from_dkdm(
dkdm,
#include "dcpomatic_button.h"
#include "lib/film.h"
#include "lib/screen.h"
-#include "lib/screen_kdm.h"
+#include "lib/kdm_with_metadata.h"
#include "lib/job_manager.h"
#include "lib/cinema_kdms.h"
#include "lib/config.h"
shared_ptr<const Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
- list<shared_ptr<ScreenKDM> > screen_kdms;
+ list<shared_ptr<KDMWithMetadata> > screen_kdms;
try {
/* Start off by enabling forensic marking for all */
optional<int> for_audio;
for_audio
);
- screen_kdms.push_back (shared_ptr<ScreenKDM>(new DCPScreenKDM(i, kdm)));
+ screen_kdms.push_back (shared_ptr<KDMWithMetadata>(new DCPKDMWithMetadata(i, kdm)));
}
}
pair<shared_ptr<Job>, int>
KDMOutputPanel::make (
- list<shared_ptr<ScreenKDM> > screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite
+ list<shared_ptr<KDMWithMetadata> > screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite
)
{
list<CinemaKDMs> const cinema_kdms = CinemaKDMs::collect (screen_kdms);
if (_write_to->GetValue()) {
if (_write_flat->GetValue()) {
- written = ScreenKDM::write_files (
+ written = KDMWithMetadata::write_files (
screen_kdms,
directory(),
_filename_format->get(),
*/
-#include "lib/screen_kdm.h"
+#include "lib/kdm_with_metadata.h"
#include "wx_util.h"
#include "name_format_editor.h"
#include <dcp/types.h>
}
std::pair<boost::shared_ptr<Job>, int> make (
- std::list<boost::shared_ptr<ScreenKDM> > screen_kdms,
+ std::list<boost::shared_ptr<KDMWithMetadata> > screen_kdms,
std::string name,
KDMTimingPanel* timing,
boost::function<bool (boost::filesystem::path)> confirm_overwrite