diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-26 10:41:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-26 10:41:51 +0100 |
| commit | 917eaf28db474a4c605eaaa8347a3e9a86b70aa0 (patch) | |
| tree | 1f1512740bfe90ffd3c5dee0e4c3c065a5803d31 /src/lib | |
| parent | d0a8ad99117ef265561e1b6d4cfee2704cbbbb03 (diff) | |
Tidy up image/text subtitle distinction with FFmpeg sources.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ffmpeg_subtitle_stream.cc | 12 | ||||
| -rw-r--r-- | src/lib/ffmpeg_subtitle_stream.h | 3 | ||||
| -rw-r--r-- | src/lib/subtitle_content.h | 11 |
3 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc index f00254ae2..6028d10a9 100644 --- a/src/lib/ffmpeg_subtitle_stream.cc +++ b/src/lib/ffmpeg_subtitle_stream.cc @@ -197,3 +197,15 @@ FFmpegSubtitleStream::set_colour (RGBA from, RGBA to) { _colours[from] = to; } + +bool +FFmpegSubtitleStream::has_text () const +{ + return !_text_subtitles.empty (); +} + +bool +FFmpegSubtitleStream::has_image () const +{ + return !_image_subtitles.empty (); +} diff --git a/src/lib/ffmpeg_subtitle_stream.h b/src/lib/ffmpeg_subtitle_stream.h index c03004b32..f79e7aca7 100644 --- a/src/lib/ffmpeg_subtitle_stream.h +++ b/src/lib/ffmpeg_subtitle_stream.h @@ -42,6 +42,9 @@ public: void set_colour (RGBA from, RGBA to); std::map<RGBA, RGBA> colours () const; + bool has_text () const; + bool has_image () const; + private: typedef std::map<std::string, ContentTimePeriod> PeriodMap; diff --git a/src/lib/subtitle_content.h b/src/lib/subtitle_content.h index 502fad427..2aa33f172 100644 --- a/src/lib/subtitle_content.h +++ b/src/lib/subtitle_content.h @@ -44,6 +44,12 @@ public: static int const OUTLINE_COLOUR; }; +/** @class SubtitleContent + * @brief Description of how some subtitle content should be presented. + * + * There are `image' subtitles (bitmaps) and `text' subtitles (plain text), + * and not all of the settings in this class correspond to both types. + */ class SubtitleContent : public ContentPart { public: @@ -53,11 +59,6 @@ public: void as_xml (xmlpp::Node *) const; std::string identifier () const; - bool has_image_subtitles () const { - /* XXX */ - return true; - } - void add_font (boost::shared_ptr<Font> font); void set_use (bool); |
