/* Copyright (C) 2013 Carl Hetherington 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "types.h" #include "kdm.h" namespace cxml { class Node; } namespace libdcp { class AssetInstance { public: AssetInstance () : intrinsic_duration (0) , entry_point (0) , duration (0) {} AssetInstance (boost::shared_ptr); /** @param node a CPL AssetList node */ virtual void write_to_cpl (xmlpp::Node* node, bool interop) const; virtual std::string cpl_node_name () const = 0; virtual std::pair cpl_node_attribute (bool) const { return std::make_pair ("", ""); } virtual bool equals (boost::shared_ptr, EqualityOptions, boost::function) const; bool encrypted () const { return !key_id.empty (); } std::string id; std::string annotation_text; Fraction edit_rate; int64_t intrinsic_duration; int64_t entry_point; int64_t duration; std::string key_id; boost::optional kdm_cipher; }; class Picture : public AssetInstance { public: Picture () : AssetInstance () {} Picture (boost::shared_ptr node); void write_to_cpl (xmlpp::Node* node, bool interop) const; bool equals (boost::shared_ptr, EqualityOptions, boost::function) const; Fraction frame_rate; Fraction screen_aspect_ratio; }; class MainPicture : public Picture { public: MainPicture () : Picture () {} MainPicture (boost::shared_ptr node) : Picture (node) {} std::string cpl_node_name () const { return "MainPicture"; } }; class MainStereoscopicPicture : public Picture { public: MainStereoscopicPicture () : Picture () {} MainStereoscopicPicture (boost::shared_ptr node) : Picture (node) {} std::string cpl_node_name () const { return "MainStereoscopicPicture"; } std::pair cpl_node_attribute (bool interop) const; }; class MainSound : public AssetInstance { public: MainSound () : AssetInstance () {} MainSound (boost::shared_ptr node) : AssetInstance (node) {} std::string cpl_node_name () const { return "MainSound"; } }; class MainSubtitle : public AssetInstance { public: MainSubtitle () : AssetInstance () {} MainSubtitle (boost::shared_ptr node) : AssetInstance (node) {} std::string cpl_node_name () const { return "MainSubtitle"; } }; }