2 Copyright (C) 2012 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_CONTENT_H
21 #define LIBDCP_CONTENT_H
25 #include <boost/filesystem.hpp>
26 #include <boost/function.hpp>
27 #include <libxml++/libxml++.h>
43 * @brief An asset that represents a piece of content, i.e. picture, sound or subtitle.
45 * Such a piece of content will be contained in a file (either MXF or XML) within a DCP.
47 class Content : public Asset
50 Content (boost::filesystem::path file);
51 Content (int edit_rate);
53 virtual ~Content () {}
55 /** Write details of the asset to a PKL AssetList node.
56 * @param p Parent node.
58 void write_to_pkl (xmlpp::Node *) const;
60 /** Write details of the asset to a ASSETMAP stream.
63 void write_to_assetmap (xmlpp::Node *) const;
65 boost::filesystem::path file () const {
69 void set_file (boost::filesystem::path file) {
73 int edit_rate () const {
77 void set_edit_rate (int r) {
81 void set_entry_point (int64_t p) {
85 int64_t intrinsic_duration () const {
86 return _intrinsic_duration;
89 void set_intrinsic_duration (int64_t d) {
90 _intrinsic_duration = d;
93 int64_t duration () const {
97 void set_duration (int64_t d) {
101 virtual bool equals (boost::shared_ptr<const Content> other, EqualityOptions opt, boost::function<void (NoteType, std::string)>) const;
104 boost::filesystem::path _file;
105 /** The edit rate; this is normally equal to the number of video frames per second */
107 int64_t _entry_point;
108 int64_t _intrinsic_duration;