diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-01 22:49:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-01 22:49:31 +0100 |
| commit | db468a15e50c8491d4b8462ad0676be905f49065 (patch) | |
| tree | 4b6d93f0916264f9cf67d11440e5fe491ab58a3a /src/lib/playlist.h | |
| parent | 623845efac0831aa1e2df6b79c4e879a7b901c69 (diff) | |
Various bits.
Diffstat (limited to 'src/lib/playlist.h')
| -rw-r--r-- | src/lib/playlist.h | 77 |
1 files changed, 58 insertions, 19 deletions
diff --git a/src/lib/playlist.h b/src/lib/playlist.h index d374dc98c..827849049 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -35,10 +35,12 @@ class SndfileDecoder; class Job; class Film; -class Playlist : public VideoSource, public AudioSource, public VideoSink, public AudioSink, public boost::enable_shared_from_this<Playlist> +class Playlist { public: - Playlist (boost::shared_ptr<const Film>, std::list<boost::shared_ptr<Content> >); + Playlist (); + + void setup (std::list<boost::shared_ptr<Content> >); ContentAudioFrame audio_length () const; int audio_channels () const; @@ -50,6 +52,52 @@ public: libdcp::Size video_size () const; ContentVideoFrame video_length () const; + enum VideoFrom { + VIDEO_NONE, + VIDEO_FFMPEG, + VIDEO_IMAGEMAGICK + }; + + enum AudioFrom { + AUDIO_NONE, + AUDIO_FFMPEG, + AUDIO_SNDFILE + }; + + VideoFrom video_from () const { + return _video_from; + } + + AudioFrom audio_from () const { + return _audio_from; + } + + boost::shared_ptr<const FFmpegContent> ffmpeg () const { + return _ffmpeg; + } + + std::list<boost::shared_ptr<const ImageMagickContent> > imagemagick () const { + return _imagemagick; + } + + std::list<boost::shared_ptr<const SndfileContent> > sndfile () const { + return _sndfile; + } + +private: + VideoFrom _video_from; + AudioFrom _audio_from; + + boost::shared_ptr<const FFmpegContent> _ffmpeg; + std::list<boost::shared_ptr<const ImageMagickContent> > _imagemagick; + std::list<boost::shared_ptr<const SndfileContent> > _sndfile; +}; + +class Player : public VideoSource, public AudioSource, public VideoSink, public AudioSink, public boost::enable_shared_from_this<Player> +{ +public: + Player (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist>); + void disable_video (); void disable_audio (); void disable_subtitles (); @@ -60,29 +108,20 @@ public: bool seek (double); bool seek_to_last (); + double last_video_time () const; + private: void process_video (boost::shared_ptr<Image> i, bool same, boost::shared_ptr<Subtitle> s); void process_audio (boost::shared_ptr<AudioBuffers>); void setup_decoders (); - - boost::shared_ptr<const Film> _film; - enum { - VIDEO_NONE, - VIDEO_FFMPEG, - VIDEO_IMAGEMAGICK - } _video_from; + boost::shared_ptr<const Film> _film; + boost::shared_ptr<const Playlist> _playlist; + + bool _video; + bool _audio; + bool _subtitles; - enum { - AUDIO_NONE, - AUDIO_FFMPEG, - AUDIO_SNDFILE - } _audio_from; - - boost::shared_ptr<FFmpegContent> _ffmpeg; - std::list<boost::shared_ptr<ImageMagickContent> > _imagemagick; - std::list<boost::shared_ptr<SndfileContent> > _sndfile; - bool _have_setup_decoders; boost::shared_ptr<FFmpegDecoder> _ffmpeg_decoder; bool _ffmpeg_decoder_done; |
