X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplaylist.h;h=0ad70b52421ece5984664373b62e0ccc52428cbd;hb=11e5bedb083e94611f7b12f2d8a55e97739c5710;hp=cd902d223d0f0944f5fd550f60805d2f8546dc12;hpb=853b8641ee7fb8348302c0daae838c4891769b1d;p=dcpomatic.git diff --git a/src/lib/playlist.h b/src/lib/playlist.h index cd902d223..0ad70b524 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,35 +20,24 @@ #ifndef DCPOMATIC_PLAYLIST_H #define DCPOMATIC_PLAYLIST_H -#include +#include "util.h" +#include "frame_rate_change.h" +#include #include -#include -#include "ffmpeg_content.h" -#include "audio_mapping.h" - -class Content; -class FFmpegContent; -class FFmpegDecoder; -class StillImageMagickContent; -class StillImageMagickDecoder; -class SndfileContent; -class SndfileDecoder; -class Job; -class Film; -class Region; +#include +#include -/** @class Playlist - * @brief A set of content files (video and audio), with knowledge of how they should be arranged into - * a DCP. - * - * This class holds Content objects, and it knows how they should be arranged. - */ +class Film; struct ContentSorter { bool operator() (boost::shared_ptr a, boost::shared_ptr b); }; +/** @class Playlist + * @brief A set of Content objects with knowledge of how they should be arranged into + * a DCP. + */ class Playlist : public boost::noncopyable { public: @@ -56,41 +45,50 @@ public: ~Playlist (); void as_xml (xmlpp::Node *); - void set_from_xml (boost::shared_ptr, boost::shared_ptr); + void set_from_xml (boost::shared_ptr, cxml::ConstNodePtr, int, std::list &); void add (boost::shared_ptr); void remove (boost::shared_ptr); void remove (ContentList); - - bool has_subtitles () const; + void move_earlier (boost::shared_ptr); + void move_later (boost::shared_ptr); ContentList content () const; std::string video_identifier () const; - Time length () const; - + DCPTime length () const; + boost::optional start () const; + int64_t required_disk_space (int j2k_bandwidth, int audio_channels, int audio_frame_rate) const; + int best_dcp_frame_rate () const; - Time video_end () const; + DCPTime video_end () const; + DCPTime subtitle_end () const; + FrameRateChange active_frame_rate_change (DCPTime, int dcp_frame_rate) const; - void set_sequence_video (bool); - void maybe_sequence_video (); + void set_sequence (bool); + void maybe_sequence (); void repeat (ContentList, int); + /** Emitted when content has been added to or removed from the playlist; implies OrderChanged */ mutable boost::signals2::signal Changed; - /** Third parameter is true if signals are currently being emitted frequently */ + mutable boost::signals2::signal OrderChanged; + /** Emitted when something about a piece of our content has changed; + * these emissions include when the position of the content changes. + * Third parameter is true if signals are currently being emitted frequently. + */ mutable boost::signals2::signal, int, bool)> ContentChanged; - + private: void content_changed (boost::weak_ptr, int, bool); void reconnect (); + /** List of content. Kept sorted in position order. */ ContentList _content; - bool _sequence_video; - bool _sequencing_video; + bool _sequence; + bool _sequencing; std::list _content_connections; - mutable boost::mutex _mutex; }; #endif