X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplaylist.h;h=2d243fe8f0e84060b0ffa20b93a96d08fbf7af31;hb=09a9ac376db005a40a351736bcff4077f098825d;hp=cea41ab3281729c84c185ed0e188d492f546218a;hpb=9bb87e91c0930f16cf615cfc374089912440e5e0;p=dcpomatic.git diff --git a/src/lib/playlist.h b/src/lib/playlist.h index cea41ab32..2d243fe8f 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -17,13 +17,12 @@ */ +#ifndef DCPOMATIC_PLAYLIST_H +#define DCPOMATIC_PLAYLIST_H + #include #include #include -#include "video_source.h" -#include "audio_source.h" -#include "video_sink.h" -#include "audio_sink.h" #include "ffmpeg_content.h" #include "audio_mapping.h" @@ -36,6 +35,7 @@ class SndfileContent; class SndfileDecoder; class Job; class Film; +class Region; /** @class Playlist * @brief A set of content files (video and audio), with knowledge of how they should be arranged into @@ -46,61 +46,33 @@ class Film; * from the video unless any sound-only files are present. If sound-only files exist, they * are played simultaneously (i.e. they can be split up into multiple files for different channels) */ - + +struct ContentSorter +{ + bool operator() (boost::shared_ptr a, boost::shared_ptr b); +}; + class Playlist { public: Playlist (); Playlist (boost::shared_ptr); + ~Playlist (); void as_xml (xmlpp::Node *); - void set_from_xml (boost::shared_ptr); + void set_from_xml (boost::shared_ptr, boost::shared_ptr); void add (boost::shared_ptr); void remove (boost::shared_ptr); - void move_earlier (boost::shared_ptr); - void move_later (boost::shared_ptr); - - ContentAudioFrame audio_length () const; - int audio_channels () const; - int audio_frame_rate () const; - bool has_audio () const; - - float video_frame_rate () const; - libdcp::Size video_size () const; - ContentVideoFrame video_length () const; - - AudioMapping default_audio_mapping () const; - ContentVideoFrame content_length () const; - - enum AudioFrom { - AUDIO_FFMPEG, - AUDIO_SNDFILE - }; - - AudioFrom audio_from () const { - return _audio_from; - } bool has_subtitles () const; + + typedef std::vector > ContentList; ContentList content () const { return _content; } - std::string description () const; - - boost::shared_ptr ffmpeg () const; - - std::list > video () const { - return _video; - } - - std::list > audio () const { - return _audio; - } - - std::string audio_digest () const; std::string video_digest () const; int loop () const { @@ -109,26 +81,24 @@ public: void set_loop (int l); + Time length () const; + int best_dcp_frame_rate () const; + Time video_end () const; + + void set_sequence_video (bool); + mutable boost::signals2::signal Changed; mutable boost::signals2::signal, int)> ContentChanged; private: - void setup (); void content_changed (boost::weak_ptr, int); + void reconnect (); - /** where we should get our audio from */ - AudioFrom _audio_from; - - /** all our content */ ContentList _content; - /** all our content which contains video */ - std::list > _video; - /** all our content which contains audio. This may contain the same objects - * as _video for FFmpegContent. - */ - std::list > _audio; - int _loop; - + bool _sequence_video; + bool _sequencing_video; std::list _content_connections; }; + +#endif