Add some explicit declarations to constructors.
[libdcp.git] / src / reel.h
1 /*
2     Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
3
4     This file is part of libdcp.
5
6     libdcp is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     libdcp is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with libdcp.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef LIBDCP_REEL_H
21 #define LIBDCP_REEL_H
22
23 #include "key.h"
24 #include "types.h"
25 #include "ref.h"
26 #include <boost/shared_ptr.hpp>
27 #include <boost/function.hpp>
28 #include <list>
29
30 namespace cxml {
31         class Node;
32 }
33
34 namespace xmlpp {
35         class Element;
36 }
37
38 namespace dcp {
39
40 class DecryptedKDM;
41 class ReelAsset;
42 class ReelPictureAsset;
43 class ReelSoundAsset;
44 class ReelSubtitleAsset;
45 class ReelAtmosAsset;
46 class Content;
47
48 /** @brief A reel within a DCP; the part which actually refers to picture, sound and subtitle data */
49 class Reel : public Object
50 {
51 public:
52         Reel () {}
53
54         Reel (
55                 boost::shared_ptr<ReelPictureAsset> picture,
56                 boost::shared_ptr<ReelSoundAsset> sound = boost::shared_ptr<ReelSoundAsset> (),
57                 boost::shared_ptr<ReelSubtitleAsset> subtitle = boost::shared_ptr<ReelSubtitleAsset> (),
58                 boost::shared_ptr<ReelAtmosAsset> atmos = boost::shared_ptr<ReelAtmosAsset> ()
59                 )
60                 : _main_picture (picture)
61                 , _main_sound (sound)
62                 , _main_subtitle (subtitle)
63                 , _atmos (atmos)
64         {}
65
66         explicit Reel (boost::shared_ptr<const cxml::Node>);
67
68         boost::shared_ptr<ReelPictureAsset> main_picture () const {
69                 return _main_picture;
70         }
71
72         boost::shared_ptr<ReelSoundAsset> main_sound () const {
73                 return _main_sound;
74         }
75
76         boost::shared_ptr<ReelSubtitleAsset> main_subtitle () const {
77                 return _main_subtitle;
78         }
79
80         boost::shared_ptr<ReelAtmosAsset> atmos () const {
81                 return _atmos;
82         }
83
84         int64_t duration () const;
85
86         void add (boost::shared_ptr<ReelAsset> asset);
87
88         void write_to_cpl (xmlpp::Element* node, Standard standard) const;
89
90         bool encrypted () const;
91
92         bool equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandler notes) const;
93
94         void add (DecryptedKDM const &);
95
96         void resolve_refs (std::list<boost::shared_ptr<Asset> >);
97
98 private:
99         boost::shared_ptr<ReelPictureAsset> _main_picture;
100         boost::shared_ptr<ReelSoundAsset> _main_sound;
101         boost::shared_ptr<ReelSubtitleAsset> _main_subtitle;
102         boost::shared_ptr<ReelAtmosAsset> _atmos;
103 };
104
105 }
106
107 #endif