1 /* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
4 Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
6 This program 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.
11 This program 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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef DCPOMATIC_PLAYLIST_H
23 #define DCPOMATIC_PLAYLIST_H
26 #include <boost/shared_ptr.hpp>
27 #include <boost/enable_shared_from_this.hpp>
28 #include "video_source.h"
29 #include "audio_source.h"
30 #include "video_sink.h"
31 #include "audio_sink.h"
32 #include "ffmpeg_content.h"
33 #include "audio_mapping.h"
38 class ImageMagickContent;
39 class ImageMagickDecoder;
47 * @brief A set of content files (video and audio), with knowledge of how they should be arranged into
50 * This class holds Content objects, and it knows how they should be arranged. At the moment
51 * the ordering is implicit; video content is placed sequentially, and audio content is taken
52 * from the video unless any sound-only files are present. If sound-only files exist, they
53 * are played simultaneously (i.e. they can be split up into multiple files for different channels)
60 Playlist (boost::shared_ptr<const Playlist>);
63 void as_xml (xmlpp::Node *);
64 void set_from_xml (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
66 void add (boost::shared_ptr<Content>);
67 void remove (boost::shared_ptr<Content>);
69 bool has_subtitles () const;
71 typedef std::vector<boost::shared_ptr<Content> > ContentList;
73 ContentList content () const {
77 std::string audio_digest () const;
78 std::string video_digest () const;
84 void set_loop (int l);
87 int best_dcp_frame_rate () const;
89 mutable boost::signals2::signal<void ()> Changed;
90 mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int)> ContentChanged;
93 void content_changed (boost::weak_ptr<Content>, int);
98 std::list<boost::signals2::connection> _content_connections;