/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
+#include <dcp/certificate.h>
+#include <libcxml/cxml.h>
+#include <boost/optional.hpp>
#include <string>
-#include <vector>
-#include <map>
-#include "util.h"
-class Format;
+class Cinema;
+/** @class Screen
+ * @brief A representation of a Screen for KDM generation.
+ *
+ * This is the name of the screen and the certificate of its
+ * `recipient' (i.e. the servers).
+ */
class Screen
{
public:
- Screen (std::string);
+ Screen (std::string const & n, boost::optional<dcp::Certificate> rec, std::vector<dcp::Certificate> td)
+ : name (n)
+ , recipient (rec)
+ , trusted_devices (td)
+ {}
- void set_geometry (Format const *, Position, Size);
+ Screen (cxml::ConstNodePtr);
- std::string name () const {
- return _name;
- }
+ void as_xml (xmlpp::Element *) const;
- void set_name (std::string n) {
- _name = n;
- }
-
- struct Geometry {
- Geometry () {}
-
- Geometry (Position p, Size s)
- : position (p)
- , size (s)
- {}
-
- Position position;
- Size size;
- };
-
- typedef std::map<Format const *, Geometry> GeometryMap;
- GeometryMap geometries () const {
- return _geometries;
- }
-
- Position position (Format const *) const;
- Size size (Format const *) const;
-
- std::string as_metadata () const;
- static boost::shared_ptr<Screen> create_from_metadata (std::string);
-
-private:
- std::string _name;
- GeometryMap _geometries;
+ boost::shared_ptr<Cinema> cinema;
+ std::string name;
+ boost::optional<dcp::Certificate> recipient;
+ std::vector<dcp::Certificate> trusted_devices;
};