Basic (untested) ebur128 (#368).
[dcpomatic.git] / src / lib / screen.h
index 663b3c3c47434a0ef1ace9d58b2391ae7334e84f..0ae4835446187616a8f927387de244a6eb41ca8b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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;
 };