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 "ffmpeg_content.h"
27 #include "audio_mapping.h"
32 class StillImageMagickContent;
33 class StillImageMagickDecoder;
41 * @brief A set of content files (video and audio), with knowledge of how they should be arranged into
44 * This class holds Content objects, and it knows how they should be arranged.
49 bool operator() (boost::shared_ptr<Content> a, boost::shared_ptr<Content> b);
52 class Playlist : public boost::noncopyable
58 void as_xml (xmlpp::Node *);
59 void set_from_xml (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>, int);
61 void add (boost::shared_ptr<Content>);
62 void remove (boost::shared_ptr<Content>);
63 void remove (ContentList);
64 void move_earlier (boost::shared_ptr<Content>);
65 void move_later (boost::shared_ptr<Content>);
67 bool has_subtitles () const;
69 ContentList content () const;
71 std::string video_identifier () const;
75 int best_dcp_frame_rate () const;
76 Time video_end () const;
78 void set_sequence_video (bool);
79 void maybe_sequence_video ();
81 void repeat (ContentList, int);
83 bool content_paths_valid () const;
85 mutable boost::signals2::signal<void ()> Changed;
86 /** Third parameter is true if signals are currently being emitted frequently */
87 mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> ContentChanged;
90 void content_changed (boost::weak_ptr<Content>, int, bool);
93 /** List of content. Kept sorted in position order. */
96 bool _sequencing_video;
97 std::list<boost::signals2::connection> _content_connections;