2 Copyright (C) 2013 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 DCPOMATIC_PLAYLIST_H
21 #define DCPOMATIC_PLAYLIST_H
24 #include <boost/shared_ptr.hpp>
25 #include <boost/enable_shared_from_this.hpp>
26 #include "video_source.h"
27 #include "audio_source.h"
28 #include "video_sink.h"
29 #include "audio_sink.h"
30 #include "ffmpeg_content.h"
31 #include "audio_mapping.h"
36 class ImageMagickContent;
37 class ImageMagickDecoder;
44 * @brief A set of content files (video and audio), with knowledge of how they should be arranged into
47 * This class holds Content objects, and it knows how they should be arranged. At the moment
48 * the ordering is implicit; video content is placed sequentially, and audio content is taken
49 * from the video unless any sound-only files are present. If sound-only files exist, they
50 * are played simultaneously (i.e. they can be split up into multiple files for different channels)
57 Playlist (boost::shared_ptr<const Playlist>);
59 void as_xml (xmlpp::Node *);
60 void set_from_xml (boost::shared_ptr<const cxml::Node>);
62 void add (boost::shared_ptr<Content>);
63 void remove (boost::shared_ptr<Content>);
65 bool has_subtitles () const;
73 Region (boost::shared_ptr<Content> c, Time t, Playlist* p);
74 Region (boost::shared_ptr<const cxml::Node>, Playlist* p);
76 void as_xml (xmlpp::Node *) const;
78 boost::shared_ptr<Content> content;
80 boost::signals2::connection connection;
83 typedef std::vector<Region> RegionList;
85 RegionList regions () const {
89 std::string audio_digest () const;
90 std::string video_digest () const;
96 void set_loop (int l);
98 Time length (boost::shared_ptr<const Film>) const;
99 int best_dcp_frame_rate () const;
101 mutable boost::signals2::signal<void ()> Changed;
102 mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int)> ContentChanged;
105 void content_changed (boost::weak_ptr<Content>, int);