diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-04 16:52:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-04 16:52:48 +0100 |
| commit | 8a1042b767e2604b0af4850dd69fd6a848fd6ffe (patch) | |
| tree | 39560c1b93baad261de4324dced88b8e999ae371 /src/lib | |
| parent | cd4a82d90677cec80e891ac190000cb70767446f (diff) | |
Add FFmpeg content dialog; moving ffmpeg-specific things out of the film editor.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 62 | ||||
| -rw-r--r-- | src/lib/film.h | 11 | ||||
| -rw-r--r-- | src/lib/playlist.cc | 11 | ||||
| -rw-r--r-- | src/lib/playlist.h | 2 |
4 files changed, 19 insertions, 67 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 8fed87122..7d1985d08 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1154,66 +1154,10 @@ Film::content_length () const return _playlist->content_length (); } -vector<FFmpegSubtitleStream> -Film::ffmpeg_subtitle_streams () const -{ - shared_ptr<FFmpegContent> f = _playlist->ffmpeg (); - if (f) { - return f->subtitle_streams (); - } - - return vector<FFmpegSubtitleStream> (); -} - -boost::optional<FFmpegSubtitleStream> -Film::ffmpeg_subtitle_stream () const -{ - shared_ptr<FFmpegContent> f = _playlist->ffmpeg (); - if (f) { - return f->subtitle_stream (); - } - - return boost::none; -} - -vector<FFmpegAudioStream> -Film::ffmpeg_audio_streams () const -{ - shared_ptr<FFmpegContent> f = _playlist->ffmpeg (); - if (f) { - return f->audio_streams (); - } - - return vector<FFmpegAudioStream> (); -} - -boost::optional<FFmpegAudioStream> -Film::ffmpeg_audio_stream () const -{ - shared_ptr<FFmpegContent> f = _playlist->ffmpeg (); - if (f) { - return f->audio_stream (); - } - - return boost::none; -} - -void -Film::set_ffmpeg_subtitle_stream (FFmpegSubtitleStream s) -{ - shared_ptr<FFmpegContent> f = _playlist->ffmpeg (); - if (f) { - f->set_subtitle_stream (s); - } -} - -void -Film::set_ffmpeg_audio_stream (FFmpegAudioStream s) +bool +Film::has_subtitles () const { - shared_ptr<FFmpegContent> f = _playlist->ffmpeg (); - if (f) { - f->set_audio_stream (s); - } + return _playlist->has_subtitles (); } void diff --git a/src/lib/film.h b/src/lib/film.h index f4d7cde67..48b0d16c5 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -112,6 +112,8 @@ public: int audio_channels () const; int audio_frame_rate () const; bool has_audio () const; + + bool has_subtitles () const; float video_frame_rate () const; libdcp::Size video_size () const; @@ -119,17 +121,10 @@ public: ContentVideoFrame content_length () const; - std::vector<FFmpegSubtitleStream> ffmpeg_subtitle_streams () const; - boost::optional<FFmpegSubtitleStream> ffmpeg_subtitle_stream () const; - std::vector<FFmpegAudioStream> ffmpeg_audio_streams () const; - boost::optional<FFmpegAudioStream> ffmpeg_audio_stream () const; - - void set_ffmpeg_subtitle_stream (FFmpegSubtitleStream); - void set_ffmpeg_audio_stream (FFmpegAudioStream); - void set_loop (int); int loop () const; + enum TrimType { CPL, ENCODE diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 72745f220..63b44f9d6 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -416,3 +416,14 @@ Playlist::ffmpeg () const return shared_ptr<FFmpegContent> (); } + +bool +Playlist::has_subtitles () const +{ + shared_ptr<FFmpegContent> fc = ffmpeg (); + if (!fc) { + return false; + } + + return !fc->subtitle_streams().empty(); +} diff --git a/src/lib/playlist.h b/src/lib/playlist.h index 935bbb2bd..e6acff694 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -82,6 +82,8 @@ public: return _audio_from; } + bool has_subtitles () const; + ContentList content () const { return _content; } |
