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;
46 * @brief A set of content files (video and audio), with knowledge of how they should be arranged into
49 * This class holds Content objects, and it knows how they should be arranged. At the moment
50 * the ordering is implicit; video content is placed sequentially, and audio content is taken
51 * from the video unless any sound-only files are present. If sound-only files exist, they
52 * are played simultaneously (i.e. they can be split up into multiple files for different channels)
59 Playlist (boost::shared_ptr<const Playlist>);
61 void as_xml (xmlpp::Node *);
62 void set_from_xml (boost::shared_ptr<const cxml::Node>);
64 void add (boost::shared_ptr<Content>);
65 void remove (boost::shared_ptr<Content>);
67 bool has_subtitles () const;
75 Region (boost::shared_ptr<Content> c, Time t, Playlist* p);
76 Region (boost::shared_ptr<const cxml::Node>, Playlist* p);
78 void as_xml (xmlpp::Node *) const;
80 boost::shared_ptr<Content> content;
82 /* XXX: obviously not used for video-only; there should
83 really by AudioRegion / VideoRegion etc.
85 AudioMapping audio_mapping;
86 boost::signals2::connection connection;
89 typedef std::vector<boost::shared_ptr<Region> > RegionList;
91 RegionList regions () const {
95 std::string audio_digest () const;
96 std::string video_digest () const;
102 void set_loop (int l);
104 Time length (boost::shared_ptr<const Film>) const;
105 int best_dcp_frame_rate () const;
107 mutable boost::signals2::signal<void ()> Changed;
108 mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int)> ContentChanged;
111 void content_changed (boost::weak_ptr<Content>, int);