2 Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef LIBDCP_REEL_ASSET_H
21 #define LIBDCP_REEL_ASSET_H
26 #include <boost/shared_ptr.hpp>
41 * @brief An entry in a <Reel> which refers to a use of a piece of content.
43 * This class encapsulates the XML that exists in a <Reel> to say
44 * that a piece of content is used in this reel. It does not
45 * describe the content itself (but links to a Content object which does).
47 class ReelAsset : public Object
51 ReelAsset (boost::shared_ptr<Content> content, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
52 ReelAsset (boost::shared_ptr<const cxml::Node>);
54 virtual void write_to_cpl (xmlpp::Node* node, Standard standard) const;
55 virtual bool equals (boost::shared_ptr<const ReelAsset>, EqualityOptions, boost::function<void (NoteType, std::string)>) const;
57 /** @return a Ref to our actual content */
58 Ref<Content>& content () {
62 int64_t entry_point () const {
66 int64_t duration () const {
71 /** @return the node name that this asset uses in the CPL's <Reel> node
72 * e.g. MainPicture, MainSound etc.
74 virtual std::string cpl_node_name () const = 0;
76 /** @return Any attribute that should be used on the asset's node in the
79 virtual std::pair<std::string, std::string> cpl_node_attribute (Standard) const;
81 /** Reference to the content (MXF or XML file) that this reel entry
84 Ref<Content> _content;
88 std::string _annotation_text; ///< The <AnnotationText> from the reel's entry for this asset
89 Fraction _edit_rate; ///< The <EditRate> from the reel's entry for this asset
90 int64_t _intrinsic_duration; ///< The <IntrinsicDuration> from the reel's entry for this asset
91 int64_t _entry_point; ///< The <EntryPoint> from the reel's entry for this asset
92 int64_t _duration; ///< The <Duration> from the reel's entry for this asset
93 std::string _hash; ///< The <Hash> from the reel's entry for this asset