X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplaylist.h;h=5b9299795ffdc9ced4131d7c509b25970e0ee118;hb=21ce34c2cd04a2e7e133ff693b84c054182f4f91;hp=e6acff6944472db7e45827237914f1279c1c1a93;hpb=0db016f90ae722fc8b72d465e21d9f153f72b340;p=dcpomatic.git diff --git a/src/lib/playlist.h b/src/lib/playlist.h index e6acff694..5b9299795 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -17,6 +17,9 @@ */ +#ifndef DCPOMATIC_PLAYLIST_H +#define DCPOMATIC_PLAYLIST_H + #include #include #include @@ -46,7 +49,7 @@ 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) */ - + class Playlist { public: @@ -58,44 +61,29 @@ public: 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; + bool has_subtitles () const; - enum AudioFrom { - AUDIO_FFMPEG, - AUDIO_SNDFILE + struct Region + { + Region () + : time (0) + {} + + Region (boost::shared_ptr c, Time t, Playlist* p); + Region (boost::shared_ptr, Playlist* p); + + void as_xml (xmlpp::Node *) const; + + boost::shared_ptr content; + Time time; + boost::signals2::connection connection; }; - AudioFrom audio_from () const { - return _audio_from; - } - - bool has_subtitles () const; + typedef std::vector RegionList; - ContentList content () const { - return _content; - } - - boost::shared_ptr ffmpeg () const; - - std::list > video () const { - return _video; - } - - std::list > audio () const { - return _audio; + RegionList regions () const { + return _regions; } std::string audio_digest () const; @@ -107,26 +95,17 @@ public: void set_loop (int l); + Time length (boost::shared_ptr) const; + int best_dcp_frame_rate () const; + mutable boost::signals2::signal Changed; mutable boost::signals2::signal, int)> ContentChanged; private: - void setup (); void content_changed (boost::weak_ptr, int); - /** 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; - + RegionList _regions; int _loop; - - std::list _content_connections; }; + +#endif