2 Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef DCPOMATIC_SCREEN_KDM_H
22 #define DCPOMATIC_SCREEN_KDM_H
24 #ifdef DCPOMATIC_VARIANT_SWAROOP
25 #include "encrypted_ecinema_kdm.h"
27 #include <dcp/encrypted_kdm.h>
28 #include <dcp/name_format.h>
29 #include <boost/shared_ptr.hpp>
35 /** Simple class to collect a screen and an encrypted KDM */
39 ScreenKDM (boost::shared_ptr<dcpomatic::Screen> s)
43 virtual ~ScreenKDM () {}
45 virtual std::string kdm_as_xml () const = 0;
46 virtual void kdm_as_xml (boost::filesystem::path out) const = 0;
47 virtual std::string kdm_id () const = 0;
49 static int write_files (
50 std::list<boost::shared_ptr<ScreenKDM> > screen_kdms, boost::filesystem::path directory,
51 dcp::NameFormat name_format, dcp::NameFormat::Map name_values,
52 boost::function<bool (boost::filesystem::path)> confirm_overwrite
55 boost::shared_ptr<dcpomatic::Screen> screen;
58 class DCPScreenKDM : public ScreenKDM
61 DCPScreenKDM (boost::shared_ptr<dcpomatic::Screen> s, dcp::EncryptedKDM k)
66 std::string kdm_as_xml () const {
70 void kdm_as_xml (boost::filesystem::path out) const {
71 return kdm.as_xml (out);
74 std::string kdm_id () const {
78 dcp::EncryptedKDM kdm;
81 #ifdef DCPOMATIC_VARIANT_SWAROOP
82 class ECinemaScreenKDM : public ScreenKDM
85 ECinemaScreenKDM (boost::shared_ptr<dcpomatic::Screen> s, EncryptedECinemaKDM k)
90 std::string kdm_as_xml () const {
94 void kdm_as_xml (boost::filesystem::path out) const {
95 return kdm.as_xml (out);
98 std::string kdm_id () const {
102 EncryptedECinemaKDM kdm;