From df17bbd25da69fc38eb2dcd8b4a2531cf0bab0bc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 23 Jul 2018 11:20:12 +0100 Subject: [PATCH] More automated renaming. ActiveCaptions -> ActiveText BitmapCaption -> BitmapText ContentCaption -> ContentText ContentTextCaption -> ContentStringText TextCaptionFileContent -> StringTextFileContent TextCaptionFileDecoder -> StringTextFileDecoder TextCaptionFile -> StringTextFile TextCaption -> StringText PlayerCaption -> PlayerText CaptionContent -> TextContent CaptionDecoder -> TextDecoder CaptionPanel -> TextPanel CaptionView -> TextView CaptionAppearanceDialog -> SubtitleAppearanceDialog CaptionType -> TextType --- hacks/rename | 44 +++++ .../{active_captions.cc => active_text.cc} | 36 ++-- src/lib/{active_captions.h => active_text.h} | 28 +-- src/lib/{bitmap_caption.h => bitmap_text.h} | 4 +- src/lib/content.cc | 18 +- src/lib/content.h | 6 +- src/lib/content_factory.cc | 6 +- src/lib/{content_caption.h => content_text.h} | 24 +-- src/lib/dcp_content.cc | 16 +- src/lib/dcp_content.h | 6 +- src/lib/dcp_decoder.cc | 10 +- src/lib/dcp_decoder.h | 2 +- src/lib/dcp_encoder.cc | 6 +- src/lib/dcp_encoder.h | 4 +- src/lib/dcp_examiner.h | 2 +- src/lib/dcp_subtitle_content.cc | 6 +- src/lib/dcp_subtitle_decoder.cc | 4 +- src/lib/dcp_subtitle_decoder.h | 2 +- src/lib/decoder.cc | 10 +- src/lib/decoder.h | 6 +- src/lib/decoder_factory.cc | 8 +- src/lib/encoder.h | 2 +- src/lib/ffmpeg_content.cc | 8 +- src/lib/ffmpeg_decoder.cc | 6 +- src/lib/ffmpeg_encoder.cc | 2 +- src/lib/ffmpeg_encoder.h | 2 +- src/lib/film.cc | 10 +- src/lib/hints.cc | 4 +- src/lib/player.cc | 72 ++++---- src/lib/player.h | 20 +-- src/lib/{player_caption.cc => player_text.cc} | 4 +- src/lib/{player_caption.h => player_text.h} | 12 +- src/lib/playlist.cc | 4 +- src/lib/reel_writer.cc | 6 +- src/lib/reel_writer.h | 4 +- src/lib/render_text.cc | 12 +- src/lib/render_text.h | 6 +- src/lib/{text_caption.h => string_text.h} | 6 +- ...xt_caption_file.cc => string_text_file.cc} | 10 +- ...text_caption_file.h => string_text_file.h} | 12 +- ...content.cc => string_text_file_content.cc} | 26 +-- ...e_content.h => string_text_file_content.h} | 12 +- ...decoder.cc => string_text_file_decoder.cc} | 20 +-- ...e_decoder.h => string_text_file_decoder.h} | 8 +- .../{caption_content.cc => text_content.cc} | 164 +++++++++--------- src/lib/{caption_content.h => text_content.h} | 26 +-- .../{caption_decoder.cc => text_decoder.cc} | 26 +-- src/lib/{caption_decoder.h => text_decoder.h} | 18 +- src/lib/types.cc | 6 +- src/lib/types.h | 10 +- src/lib/writer.cc | 2 +- src/lib/writer.h | 4 +- src/lib/wscript | 14 +- src/tools/dcpomatic.cc | 6 +- src/tools/dcpomatic_player.cc | 4 +- src/wx/closed_captions_dialog.cc | 14 +- src/wx/content_panel.cc | 16 +- src/wx/content_panel.h | 4 +- src/wx/dcp_panel.cc | 6 +- src/wx/film_viewer.h | 2 +- src/wx/fonts_dialog.cc | 8 +- src/wx/fonts_dialog.h | 6 +- ...ialog.cc => subtitle_appearance_dialog.cc} | 38 ++-- ..._dialog.h => subtitle_appearance_dialog.h} | 6 +- src/wx/{caption_panel.cc => text_panel.cc} | 124 ++++++------- src/wx/{caption_panel.h => text_panel.h} | 10 +- src/wx/{caption_view.cc => text_view.cc} | 28 +-- src/wx/{caption_view.h => text_view.h} | 10 +- src/wx/timeline.cc | 4 +- src/wx/timeline_text_content_view.cc | 4 +- src/wx/timeline_text_content_view.h | 6 +- src/wx/timing_panel.cc | 4 +- src/wx/wscript | 6 +- test/burnt_subtitle_test.cc | 4 +- test/closed_caption_test.cc | 6 +- test/dcp_subtitle_test.cc | 16 +- test/ffmpeg_encoder_test.cc | 12 +- test/player_test.cc | 6 +- test/reels_test.cc | 6 +- test/remake_id_test.cc | 2 +- test/remake_with_subtitle_test.cc | 2 +- test/render_subtitles_test.cc | 16 +- test/srt_subtitle_test.cc | 20 +-- test/ssa_subtitle_test.cc | 6 +- test/subtitle_charset_test.cc | 6 +- test/subtitle_reel_number_test.cc | 6 +- 86 files changed, 622 insertions(+), 578 deletions(-) create mode 100644 hacks/rename rename src/lib/{active_captions.cc => active_text.cc} (78%) rename src/lib/{active_captions.h => active_text.h} (59%) rename src/lib/{bitmap_caption.h => bitmap_text.h} (93%) rename src/lib/{content_caption.h => content_text.h} (74%) rename src/lib/{player_caption.cc => player_text.cc} (92%) rename src/lib/{player_caption.h => player_text.h} (82%) rename src/lib/{text_caption.h => string_text.h} (88%) rename src/lib/{text_caption_file.cc => string_text_file.cc} (93%) rename src/lib/{text_caption_file.h => string_text_file.h} (83%) rename src/lib/{text_caption_file_content.cc => string_text_file_content.cc} (70%) rename src/lib/{text_caption_file_content.h => string_text_file_content.h} (72%) rename src/lib/{text_caption_file_decoder.cc => string_text_file_decoder.cc} (77%) rename src/lib/{text_caption_file_decoder.h => string_text_file_decoder.h} (81%) rename src/lib/{caption_content.cc => text_content.cc} (74%) rename src/lib/{caption_content.h => text_content.h} (89%) rename src/lib/{caption_decoder.cc => text_decoder.cc} (89%) rename src/lib/{caption_decoder.h => text_decoder.h} (79%) rename src/wx/{caption_appearance_dialog.cc => subtitle_appearance_dialog.cc} (86%) rename src/wx/{caption_appearance_dialog.h => subtitle_appearance_dialog.h} (89%) rename src/wx/{caption_panel.cc => text_panel.cc} (81%) rename src/wx/{caption_panel.h => text_panel.h} (91%) rename src/wx/{caption_view.cc => text_view.cc} (77%) rename src/wx/{caption_view.h => text_view.h} (84%) diff --git a/hacks/rename b/hacks/rename new file mode 100644 index 000000000..c68ae1b5d --- /dev/null +++ b/hacks/rename @@ -0,0 +1,44 @@ +#!/usr/bin/python + +import re +import os + +files = "src/lib/*.cc src/lib/*.h src/wx/*.cc src/wx/*.h src/tools/*.cc test/*.cc" + +def convert(name): + s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) + return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() + +def try_to_rename(f, t): + try: + print '%s -> %s' % (f, t), + os.rename(f, t) + print 'OK' + except: + print 'Failed' + +def rename_class(f, t): + os.system('sed -i "s/%s/%s/g" %s' % (f, t, files)) + os.system('sed -i "s/%s/%s/g" src/lib/wscript src/wx/wscript' % (convert(f), convert(t))) + try_to_rename('src/lib/%s.cc' % convert(f), 'src/lib/%s.cc' % convert(t)) + try_to_rename('src/lib/%s.h' % convert(f), 'src/lib/%s.h' % convert(t)) + try_to_rename('src/wx/%s.cc' % convert(f), 'src/wx/%s.cc' % convert(t)) + try_to_rename('src/wx/%s.h' % convert(f), 'src/wx/%s.h' % convert(t)) + os.system('sed -i "s/include \\"%s.h\\"/include \\"%s.h\\"/g" %s' % (convert(f), convert(t), files)) + os.system('sed -i "s/include \\"lib\/%s.h\\"/include \\"lib\/%s.h\\"/g" %s' % (convert(f), convert(t), files)) + +rename_class("ActiveCaptions", "ActiveText") +rename_class("BitmapCaption", "BitmapText") +rename_class("ContentCaption", "ContentText") +rename_class("ContentTextCaption", "ContentStringText") +rename_class("TextCaptionFileContent", "StringTextFileContent") +rename_class("TextCaptionFileDecoder", "StringTextFileDecoder") +rename_class("TextCaptionFile", "StringTextFile") +rename_class("TextCaption", "StringText") +rename_class("PlayerCaption", "PlayerText") +rename_class("CaptionContent", "TextContent") +rename_class("CaptionDecoder", "TextDecoder") +rename_class("CaptionPanel", "TextPanel") +rename_class("CaptionView", "TextView") +rename_class("CaptionAppearanceDialog", "SubtitleAppearanceDialog") +rename_class("CaptionType", "TextType") diff --git a/src/lib/active_captions.cc b/src/lib/active_text.cc similarity index 78% rename from src/lib/active_captions.cc rename to src/lib/active_text.cc index 1d3a53609..de3dc8165 100644 --- a/src/lib/active_captions.cc +++ b/src/lib/active_text.cc @@ -18,8 +18,8 @@ */ -#include "active_captions.h" -#include "caption_content.h" +#include "active_text.h" +#include "text_content.h" #include #include @@ -31,7 +31,7 @@ using boost::shared_ptr; using boost::optional; void -ActiveCaptions::add (DCPTimePeriod period, list& pc, list p) const +ActiveText::add (DCPTimePeriod period, list& pc, list p) const { BOOST_FOREACH (Period i, p) { DCPTimePeriod test (i.from, i.to.get_value_or(DCPTime::max())); @@ -42,14 +42,14 @@ ActiveCaptions::add (DCPTimePeriod period, list& pc, list } } -list -ActiveCaptions::get (DCPTimePeriod period) const +list +ActiveText::get (DCPTimePeriod period) const { - list ps; + list ps; for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) { - shared_ptr caption = i->first.lock (); + shared_ptr caption = i->first.lock (); if (!caption || !caption->use()) { continue; } @@ -64,14 +64,14 @@ ActiveCaptions::get (DCPTimePeriod period) const * @param period Period of interest. * @param always_burn_captions Always burn captions even if their content is not set to burn. */ -list -ActiveCaptions::get_burnt (DCPTimePeriod period, bool always_burn_captions) const +list +ActiveText::get_burnt (DCPTimePeriod period, bool always_burn_captions) const { - list ps; + list ps; for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) { - shared_ptr caption = i->first.lock (); + shared_ptr caption = i->first.lock (); if (!caption) { continue; } @@ -91,7 +91,7 @@ ActiveCaptions::get_burnt (DCPTimePeriod period, bool always_burn_captions) cons * @param time Time to remove before. */ void -ActiveCaptions::clear_before (DCPTime time) +ActiveText::clear_before (DCPTime time) { Map updated; for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) { @@ -114,7 +114,7 @@ ActiveCaptions::clear_before (DCPTime time) * @param from From time for these subtitles. */ void -ActiveCaptions::add_from (weak_ptr content, PlayerCaption ps, DCPTime from) +ActiveText::add_from (weak_ptr content, PlayerText ps, DCPTime from) { if (_data.find(content) == _data.end()) { _data[content] = list(); @@ -127,14 +127,14 @@ ActiveCaptions::add_from (weak_ptr content, PlayerCaption * @param to To time for the last subtitle submitted to add_from for this content. * @return Return the corresponding subtitles and their from time. */ -pair -ActiveCaptions::add_to (weak_ptr content, DCPTime to) +pair +ActiveText::add_to (weak_ptr content, DCPTime to) { DCPOMATIC_ASSERT (_data.find(content) != _data.end()); _data[content].back().to = to; - BOOST_FOREACH (TextCaption& i, _data[content].back().subs.text) { + BOOST_FOREACH (StringText& i, _data[content].back().subs.text) { i.set_out (dcp::Time(to.seconds(), 1000)); } @@ -145,7 +145,7 @@ ActiveCaptions::add_to (weak_ptr content, DCPTime to) * @return true if we have any active subtitles from this content. */ bool -ActiveCaptions::have (weak_ptr content) const +ActiveText::have (weak_ptr content) const { Map::const_iterator i = _data.find(content); if (i == _data.end()) { @@ -156,7 +156,7 @@ ActiveCaptions::have (weak_ptr content) const } void -ActiveCaptions::clear () +ActiveText::clear () { _data.clear (); } diff --git a/src/lib/active_captions.h b/src/lib/active_text.h similarity index 59% rename from src/lib/active_captions.h rename to src/lib/active_text.h index 8e38564f5..10ce30f08 100644 --- a/src/lib/active_captions.h +++ b/src/lib/active_text.h @@ -19,30 +19,30 @@ */ /** @file src/lib/active_captions.h - * @brief ActiveCaptions class. + * @brief ActiveText class. */ #include "dcpomatic_time.h" -#include "player_caption.h" +#include "player_text.h" #include #include #include -class CaptionContent; +class TextContent; -/** @class ActiveCaptions +/** @class ActiveText * @brief A class to maintain information on active subtitles for Player. */ -class ActiveCaptions : public boost::noncopyable +class ActiveText : public boost::noncopyable { public: - std::list get (DCPTimePeriod period) const; - std::list get_burnt (DCPTimePeriod period, bool always_burn_captions) const; + std::list get (DCPTimePeriod period) const; + std::list get_burnt (DCPTimePeriod period, bool always_burn_captions) const; void clear_before (DCPTime time); void clear (); - void add_from (boost::weak_ptr content, PlayerCaption ps, DCPTime from); - std::pair add_to (boost::weak_ptr content, DCPTime to); - bool have (boost::weak_ptr content) const; + void add_from (boost::weak_ptr content, PlayerText ps, DCPTime from); + std::pair add_to (boost::weak_ptr content, DCPTime to); + bool have (boost::weak_ptr content) const; private: class Period @@ -50,19 +50,19 @@ private: public: Period () {} - Period (PlayerCaption s, DCPTime f) + Period (PlayerText s, DCPTime f) : subs (s) , from (f) {} - PlayerCaption subs; + PlayerText subs; DCPTime from; boost::optional to; }; - typedef std::map, std::list > Map; + typedef std::map, std::list > Map; - void add (DCPTimePeriod period, std::list& pc, std::list p) const; + void add (DCPTimePeriod period, std::list& pc, std::list p) const; Map _data; }; diff --git a/src/lib/bitmap_caption.h b/src/lib/bitmap_text.h similarity index 93% rename from src/lib/bitmap_caption.h rename to src/lib/bitmap_text.h index 8883272ad..2314c2db0 100644 --- a/src/lib/bitmap_caption.h +++ b/src/lib/bitmap_text.h @@ -26,10 +26,10 @@ class Image; -class BitmapCaption +class BitmapText { public: - BitmapCaption (boost::shared_ptr i, dcpomatic::Rect r) + BitmapText (boost::shared_ptr i, dcpomatic::Rect r) : image (i) , rectangle (r) {} diff --git a/src/lib/content.cc b/src/lib/content.cc index 629672b73..7a8088289 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -27,7 +27,7 @@ #include "content_factory.h" #include "video_content.h" #include "audio_content.h" -#include "caption_content.h" +#include "text_content.h" #include "exceptions.h" #include "film.h" #include "job.h" @@ -437,8 +437,8 @@ Content::take_settings_from (shared_ptr c) audio->take_settings_from (c->audio); } - list >::iterator i = caption.begin (); - list >::const_iterator j = c->caption.begin (); + list >::iterator i = caption.begin (); + list >::const_iterator j = c->caption.begin (); while (i != caption.end() && j != c->caption.end()) { (*i)->take_settings_from (*j); ++i; @@ -446,24 +446,24 @@ Content::take_settings_from (shared_ptr c) } } -shared_ptr +shared_ptr Content::only_caption () const { DCPOMATIC_ASSERT (caption.size() < 2); if (caption.empty ()) { - return shared_ptr (); + return shared_ptr (); } return caption.front (); } -shared_ptr -Content::caption_of_original_type (CaptionType type) const +shared_ptr +Content::caption_of_original_type (TextType type) const { - BOOST_FOREACH (shared_ptr i, caption) { + BOOST_FOREACH (shared_ptr i, caption) { if (i->original_type() == type) { return i; } } - return shared_ptr (); + return shared_ptr (); } diff --git a/src/lib/content.h b/src/lib/content.h index d84f636fb..850cb0891 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -182,10 +182,10 @@ public: boost::shared_ptr video; boost::shared_ptr audio; - std::list > caption; + std::list > caption; - boost::shared_ptr only_caption () const; - boost::shared_ptr caption_of_original_type (CaptionType type) const; + boost::shared_ptr only_caption () const; + boost::shared_ptr caption_of_original_type (TextType type) const; void signal_changed (int); diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 8c473b7bc..077ef529e 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -26,7 +26,7 @@ #include "audio_content.h" #include "image_content.h" #include "atmos_mxf_content.h" -#include "text_caption_file_content.h" +#include "string_text_file_content.h" #include "dcp_content.h" #include "dcp_subtitle_content.h" #include "util.h" @@ -88,7 +88,7 @@ content_factory (shared_ptr film, cxml::NodePtr node, int version, l ); } else if (type == "SubRip" || type == "TextSubtitle") { - content.reset (new TextCaptionFileContent (film, node, version)); + content.reset (new StringTextFileContent (film, node, version)); } else if (type == "DCP") { content.reset (new DCPContent (film, node, version)); } else if (type == "DCPSubtitle") { @@ -210,7 +210,7 @@ content_factory (shared_ptr film, boost::filesystem::path path) if (valid_image_file (path)) { single.reset (new ImageContent (film, path)); } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass") { - single.reset (new TextCaptionFileContent (film, path)); + single.reset (new StringTextFileContent (film, path)); } else if (ext == ".xml") { cxml::Document doc; doc.read_file (path); diff --git a/src/lib/content_caption.h b/src/lib/content_text.h similarity index 74% rename from src/lib/content_caption.h rename to src/lib/content_text.h index ad83fcb89..3ef011f61 100644 --- a/src/lib/content_caption.h +++ b/src/lib/content_text.h @@ -24,16 +24,16 @@ #include "dcpomatic_time.h" #include "rect.h" #include "types.h" -#include "bitmap_caption.h" +#include "bitmap_text.h" #include #include class Image; -class ContentCaption +class ContentText { public: - explicit ContentCaption (ContentTime f, CaptionType t) + explicit ContentText (ContentTime f, TextType t) : _from (f) , _type (t) {} @@ -42,36 +42,36 @@ public: return _from; } - CaptionType type () const { + TextType type () const { return _type; } private: ContentTime _from; - CaptionType _type; + TextType _type; }; -class ContentBitmapCaption : public ContentCaption +class ContentBitmapText : public ContentText { public: - ContentBitmapCaption (ContentTime f, CaptionType type, boost::shared_ptr im, dcpomatic::Rect r) - : ContentCaption (f, type) + ContentBitmapText (ContentTime f, TextType type, boost::shared_ptr im, dcpomatic::Rect r) + : ContentText (f, type) , sub (im, r) {} /* Our text, with its rectangle unmodified by any offsets or scales that the content specifies */ - BitmapCaption sub; + BitmapText sub; }; /** A text caption. We store the time period separately (as well as in the dcp::SubtitleStrings) * as the dcp::SubtitleString timings are sometimes quite heavily quantised and this causes problems * when we want to compare the quantised periods to the unquantised ones. */ -class ContentTextCaption : public ContentCaption +class ContentStringText : public ContentText { public: - ContentTextCaption (ContentTime f, CaptionType type, std::list s) - : ContentCaption (f, type) + ContentStringText (ContentTime f, TextType type, std::list s) + : ContentText (f, type) , subs (s) {} diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 414a22256..aaf8064f3 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -28,7 +28,7 @@ #include "overlaps.h" #include "compose.hpp" #include "dcp_decoder.h" -#include "caption_content.h" +#include "text_content.h" #include #include #include @@ -84,7 +84,7 @@ DCPContent::DCPContent (shared_ptr film, cxml::ConstNodePtr node, in { video = VideoContent::from_xml (this, node, version); audio = AudioContent::from_xml (this, node, version); - caption = CaptionContent::from_xml (this, node, version); + caption = TextContent::from_xml (this, node, version); for (int i = 0; i < CAPTION_COUNT; ++i) { _reference_caption[i] = false; @@ -192,8 +192,8 @@ DCPContent::examine (shared_ptr job) boost::mutex::scoped_lock lm (_mutex); _name = examiner->name (); for (int i = 0; i < CAPTION_COUNT; ++i) { - if (examiner->has_caption(static_cast(i))) { - caption.push_back (shared_ptr(new CaptionContent(this, static_cast(i)))); + if (examiner->has_caption(static_cast(i))) { + caption.push_back (shared_ptr(new TextContent(this, static_cast(i)))); } } captions = caption.size (); @@ -267,7 +267,7 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const audio->stream()->mapping().as_xml (node->add_child("AudioMapping")); } - BOOST_FOREACH (shared_ptr i, caption) { + BOOST_FOREACH (shared_ptr i, caption) { i->as_xml (node); } @@ -323,7 +323,7 @@ DCPContent::identifier () const s += video->identifier() + "_"; } - BOOST_FOREACH (shared_ptr i, caption) { + BOOST_FOREACH (shared_ptr i, caption) { s += i->identifier () + " "; } @@ -416,7 +416,7 @@ DCPContent::set_reference_audio (bool r) } void -DCPContent::set_reference_caption (CaptionType type, bool r) +DCPContent::set_reference_caption (TextType type, bool r) { { boost::mutex::scoped_lock lm (_mutex); @@ -596,7 +596,7 @@ bool check_caption (shared_ptr c) return !c->caption.empty(); } bool -DCPContent::can_reference_caption (CaptionType type, string& why_not) const +DCPContent::can_reference_caption (TextType type, string& why_not) const { shared_ptr decoder; try { diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index f01790b89..fedc43d64 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -108,17 +108,17 @@ public: bool can_reference_audio (std::string &) const; - void set_reference_caption (CaptionType type, bool r); + void set_reference_caption (TextType type, bool r); /** @param type Original type of captions in the DCP. * @return true if these captions are to be referenced. */ - bool reference_caption (CaptionType type) const { + bool reference_caption (TextType type) const { boost::mutex::scoped_lock lm (_mutex); return _reference_caption[type]; } - bool can_reference_caption (CaptionType type, std::string &) const; + bool can_reference_caption (TextType type, std::string &) const; void set_cpl (std::string id); diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index ab655ebf8..86152c817 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -24,7 +24,7 @@ #include "video_decoder.h" #include "audio_decoder.h" #include "j2k_image_proxy.h" -#include "caption_decoder.h" +#include "text_decoder.h" #include "image.h" #include "config.h" #include @@ -63,9 +63,9 @@ DCPDecoder::DCPDecoder (shared_ptr c, shared_ptr log, boo if (c->audio) { audio.reset (new AudioDecoder (this, c->audio, log, fast)); } - BOOST_FOREACH (shared_ptr i, c->caption) { + BOOST_FOREACH (shared_ptr i, c->caption) { /* XXX: this time here should be the time of the first subtitle, not 0 */ - caption.push_back (shared_ptr (new CaptionDecoder (this, i, log, ContentTime()))); + caption.push_back (shared_ptr (new TextDecoder (this, i, log, ContentTime()))); } list > cpl_list = cpls (); @@ -193,7 +193,7 @@ DCPDecoder::pass () void DCPDecoder::pass_captions (ContentTime next) { - list >::const_iterator decoder = caption.begin (); + list >::const_iterator decoder = caption.begin (); if ((*_reel)->main_subtitle()) { pass_captions ( next, (*_reel)->main_subtitle()->asset(), _dcp_content->reference_caption(CAPTION_OPEN), (*_reel)->main_subtitle()->entry_point(), *decoder @@ -209,7 +209,7 @@ DCPDecoder::pass_captions (ContentTime next) } void -DCPDecoder::pass_captions (ContentTime next, shared_ptr asset, bool reference, int64_t entry_point, shared_ptr decoder) +DCPDecoder::pass_captions (ContentTime next, shared_ptr asset, bool reference, int64_t entry_point, shared_ptr decoder) { double const vfr = _dcp_content->active_video_frame_rate (); /* Frame within the (played part of the) reel that is coming up next */ diff --git a/src/lib/dcp_decoder.h b/src/lib/dcp_decoder.h index 898b84e5d..2fbdb884a 100644 --- a/src/lib/dcp_decoder.h +++ b/src/lib/dcp_decoder.h @@ -58,7 +58,7 @@ private: void next_reel (); void get_readers (); void pass_captions (ContentTime next); - void pass_captions (ContentTime next, boost::shared_ptr asset, bool reference, int64_t entry_point, boost::shared_ptr decoder); + void pass_captions (ContentTime next, boost::shared_ptr asset, bool reference, int64_t entry_point, boost::shared_ptr decoder); /** Time of next thing to return from pass relative to the start of _reel */ ContentTime _next; diff --git a/src/lib/dcp_encoder.cc b/src/lib/dcp_encoder.cc index f518aefef..42984887d 100644 --- a/src/lib/dcp_encoder.cc +++ b/src/lib/dcp_encoder.cc @@ -35,7 +35,7 @@ #include "writer.h" #include "compose.hpp" #include "referenced_reel_asset.h" -#include "caption_content.h" +#include "text_content.h" #include "player_video.h" #include #include @@ -64,7 +64,7 @@ DCPEncoder::DCPEncoder (shared_ptr film, weak_ptr job) _player_caption_connection = _player->Caption.connect (bind (&DCPEncoder::caption, this, _1, _2, _3)); BOOST_FOREACH (shared_ptr c, film->content ()) { - BOOST_FOREACH (shared_ptr i, c->caption) { + BOOST_FOREACH (shared_ptr i, c->caption) { if (i->use() && !i->burn()) { _non_burnt_subtitles = true; } @@ -143,7 +143,7 @@ DCPEncoder::audio (shared_ptr data, DCPTime time) } void -DCPEncoder::caption (PlayerCaption data, CaptionType type, DCPTimePeriod period) +DCPEncoder::caption (PlayerText data, TextType type, DCPTimePeriod period) { if (type == CAPTION_CLOSED || _non_burnt_subtitles) { _writer->write (data, type, period); diff --git a/src/lib/dcp_encoder.h b/src/lib/dcp_encoder.h index 9808987c3..23b05d0dc 100644 --- a/src/lib/dcp_encoder.h +++ b/src/lib/dcp_encoder.h @@ -19,7 +19,7 @@ */ #include "types.h" -#include "player_caption.h" +#include "player_text.h" #include "encoder.h" #include @@ -52,7 +52,7 @@ private: void video (boost::shared_ptr, DCPTime); void audio (boost::shared_ptr, DCPTime); - void caption (PlayerCaption, CaptionType, DCPTimePeriod); + void caption (PlayerText, TextType, DCPTimePeriod); boost::shared_ptr _writer; boost::shared_ptr _j2k_encoder; diff --git a/src/lib/dcp_examiner.h b/src/lib/dcp_examiner.h index 16385e07a..29fcc48d2 100644 --- a/src/lib/dcp_examiner.h +++ b/src/lib/dcp_examiner.h @@ -83,7 +83,7 @@ public: return _audio_frame_rate.get_value_or (48000); } - bool has_caption (CaptionType type) const { + bool has_caption (TextType type) const { return _has_caption[type]; } diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index 779361f63..6a7e38153 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -21,7 +21,7 @@ #include "font.h" #include "dcp_subtitle_content.h" #include "film.h" -#include "caption_content.h" +#include "text_content.h" #include #include #include @@ -40,14 +40,14 @@ using dcp::raw_convert; DCPSubtitleContent::DCPSubtitleContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) { - caption.push_back (shared_ptr (new CaptionContent (this, CAPTION_OPEN))); + caption.push_back (shared_ptr (new TextContent (this, CAPTION_OPEN))); } DCPSubtitleContent::DCPSubtitleContent (shared_ptr film, cxml::ConstNodePtr node, int version) : Content (film, node) , _length (node->number_child ("Length")) { - caption = CaptionContent::from_xml (this, node, version); + caption = TextContent::from_xml (this, node, version); } void diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 3ed4a6827..05d815265 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -39,7 +39,7 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr con if (_next != _subtitles.end()) { first = content_time_period(*_next).from; } - caption.push_back (shared_ptr (new CaptionDecoder (this, content->only_caption(), log, first))); + caption.push_back (shared_ptr (new TextDecoder (this, content->only_caption(), log, first))); } void @@ -64,7 +64,7 @@ DCPSubtitleDecoder::pass () /* Gather all subtitles with the same time period that are next on the list. We must emit all subtitles for the same time period with the same plain_text() call otherwise the - CaptionDecoder will assume there is nothing else at the + TextDecoder will assume there is nothing else at the time of emit the first. */ diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h index ef4dad3f5..984d98826 100644 --- a/src/lib/dcp_subtitle_decoder.h +++ b/src/lib/dcp_subtitle_decoder.h @@ -18,7 +18,7 @@ */ -#include "caption_decoder.h" +#include "text_decoder.h" #include "dcp_subtitle.h" class DCPSubtitleContent; diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 2fddddc91..52949a098 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -21,7 +21,7 @@ #include "decoder.h" #include "video_decoder.h" #include "audio_decoder.h" -#include "caption_decoder.h" +#include "text_decoder.h" #include #include @@ -43,7 +43,7 @@ Decoder::position () const pos = audio->position(); } - BOOST_FOREACH (shared_ptr i, caption) { + BOOST_FOREACH (shared_ptr i, caption) { if (!i->ignore() && (!pos || i->position() < *pos)) { pos = i->position(); } @@ -61,17 +61,17 @@ Decoder::seek (ContentTime, bool) if (audio) { audio->seek (); } - BOOST_FOREACH (shared_ptr i, caption) { + BOOST_FOREACH (shared_ptr i, caption) { i->seek (); } } -shared_ptr +shared_ptr Decoder::only_caption () const { DCPOMATIC_ASSERT (caption.size() < 2); if (caption.empty ()) { - return shared_ptr (); + return shared_ptr (); } return caption.front (); } diff --git a/src/lib/decoder.h b/src/lib/decoder.h index d48df7517..1b330316e 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -32,7 +32,7 @@ class Decoded; class VideoDecoder; class AudioDecoder; -class CaptionDecoder; +class TextDecoder; class DecoderPart; /** @class Decoder. @@ -45,9 +45,9 @@ public: boost::shared_ptr video; boost::shared_ptr audio; - std::list > caption; + std::list > caption; - boost::shared_ptr only_caption () const; + boost::shared_ptr only_caption () const; /** Do some decoding and perhaps emit video, audio or subtitle data. * @return true if this decoder will emit no more data unless a seek() happens. diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index bb3bdb13e..02d7064f4 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -24,8 +24,8 @@ #include "dcp_decoder.h" #include "image_content.h" #include "image_decoder.h" -#include "text_caption_file_content.h" -#include "text_caption_file_decoder.h" +#include "string_text_file_content.h" +#include "string_text_file_decoder.h" #include "dcp_subtitle_content.h" #include "dcp_subtitle_decoder.h" #include "video_mxf_content.h" @@ -54,9 +54,9 @@ decoder_factory (shared_ptr content, shared_ptr log, bool fa return shared_ptr (new ImageDecoder (ic, log)); } - shared_ptr rc = dynamic_pointer_cast (content); + shared_ptr rc = dynamic_pointer_cast (content); if (rc) { - return shared_ptr (new TextCaptionFileDecoder (rc, log)); + return shared_ptr (new StringTextFileDecoder (rc, log)); } shared_ptr dsc = dynamic_pointer_cast (content); diff --git a/src/lib/encoder.h b/src/lib/encoder.h index 27fa0745f..f4116c50c 100644 --- a/src/lib/encoder.h +++ b/src/lib/encoder.h @@ -22,7 +22,7 @@ #define DCPOMATIC_ENCODER_H #include "types.h" -#include "player_caption.h" +#include "player_text.h" #include #include diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 3f0a692cd..86965ff49 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -32,7 +32,7 @@ #include "log.h" #include "exceptions.h" #include "frame_rate_change.h" -#include "caption_content.h" +#include "text_content.h" #include #include extern "C" { @@ -85,7 +85,7 @@ FFmpegContent::FFmpegContent (shared_ptr film, cxml::ConstNodePtr no { video = VideoContent::from_xml (this, node, version); audio = AudioContent::from_xml (this, node, version); - caption = CaptionContent::from_xml (this, node, version); + caption = TextContent::from_xml (this, node, version); list c = node->node_children ("SubtitleStream"); for (list::const_iterator i = c.begin(); i != c.end(); ++i) { @@ -163,7 +163,7 @@ FFmpegContent::FFmpegContent (shared_ptr film, vector (new CaptionContent (this, c))); + caption.push_back (shared_ptr (new TextContent (this, c))); } shared_ptr ref = dynamic_pointer_cast (c[0]); @@ -304,7 +304,7 @@ FFmpegContent::examine (shared_ptr job) _subtitle_streams = examiner->subtitle_streams (); if (!_subtitle_streams.empty ()) { caption.clear (); - caption.push_back (shared_ptr (new CaptionContent (this, CAPTION_OPEN))); + caption.push_back (shared_ptr (new TextContent (this, CAPTION_OPEN))); _subtitle_stream = _subtitle_streams.front (); } diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 1f2fcfef8..665ee3e13 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -28,7 +28,7 @@ #include "util.h" #include "log.h" #include "ffmpeg_decoder.h" -#include "caption_decoder.h" +#include "text_decoder.h" #include "ffmpeg_audio_stream.h" #include "ffmpeg_subtitle_stream.h" #include "video_filter_graph.h" @@ -39,7 +39,7 @@ #include "film.h" #include "audio_decoder.h" #include "compose.hpp" -#include "caption_content.h" +#include "text_content.h" #include "audio_content.h" #include #include @@ -99,7 +99,7 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr c, shared_ptr if (c->only_caption()) { /* XXX: this time here should be the time of the first subtitle, not 0 */ - caption.push_back (shared_ptr (new CaptionDecoder (this, c->only_caption(), log, ContentTime()))); + caption.push_back (shared_ptr (new TextDecoder (this, c->only_caption(), log, ContentTime()))); } _next_time.resize (_format_context->nb_streams); diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index 29334e8ed..f82290c6c 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -411,7 +411,7 @@ FFmpegEncoder::audio_frame (int size) } void -FFmpegEncoder::subtitle (PlayerCaption, DCPTimePeriod) +FFmpegEncoder::subtitle (PlayerText, DCPTimePeriod) { } diff --git a/src/lib/ffmpeg_encoder.h b/src/lib/ffmpeg_encoder.h index 35fd85064..b1d07eb7f 100644 --- a/src/lib/ffmpeg_encoder.h +++ b/src/lib/ffmpeg_encoder.h @@ -54,7 +54,7 @@ public: private: void video (boost::shared_ptr, DCPTime); void audio (boost::shared_ptr); - void subtitle (PlayerCaption, DCPTimePeriod); + void subtitle (PlayerText, DCPTimePeriod); void setup_video (); void setup_audio (); diff --git a/src/lib/film.cc b/src/lib/film.cc index b56f85dbe..475d28b4f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -46,7 +46,7 @@ #include "screen.h" #include "audio_content.h" #include "video_content.h" -#include "caption_content.h" +#include "text_content.h" #include "ffmpeg_content.h" #include "dcp_content.h" #include "screen_kdm.h" @@ -125,7 +125,7 @@ string const Film::metadata_file = "metadata.xml"; * 35 -> 36 * EffectColour rather than OutlineColour in Subtitle. * 36 -> 37 - * CaptionContent can be in a Caption tag, and some of the tag names + * TextContent can be in a Caption tag, and some of the tag names * have had Subtitle prefixes or suffixes removed. */ int const Film::current_state_version = 37; @@ -704,7 +704,7 @@ Film::isdcf_name (bool if_created_now) const bool burnt_in = true; bool ccap = false; BOOST_FOREACH (shared_ptr i, content()) { - BOOST_FOREACH (shared_ptr j, i->caption) { + BOOST_FOREACH (shared_ptr j, i->caption) { if (j->type() == CAPTION_OPEN && j->use() && !j->burn()) { burnt_in = false; } else if (j->type() == CAPTION_CLOSED) { @@ -784,7 +784,7 @@ Film::isdcf_name (bool if_created_now) const bool any_caption = false; for (int i = 0; i < CAPTION_COUNT; ++i) { - if (dc->reference_caption(static_cast(i))) { + if (dc->reference_caption(static_cast(i))) { any_caption = true; } } @@ -1391,7 +1391,7 @@ Film::subtitle_language () const set languages; BOOST_FOREACH (shared_ptr i, content()) { - BOOST_FOREACH (shared_ptr j, i->caption) { + BOOST_FOREACH (shared_ptr j, i->caption) { languages.insert (j->language ()); } } diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 33c2faba5..8cc0cfbfb 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -23,7 +23,7 @@ #include "film.h" #include "content.h" #include "video_content.h" -#include "caption_content.h" +#include "text_content.h" #include "audio_processor.h" #include "font.h" #include "ratio.h" @@ -56,7 +56,7 @@ get_hints (shared_ptr film) bool big_font_files = false; if (film->interop ()) { BOOST_FOREACH (shared_ptr i, content) { - BOOST_FOREACH (shared_ptr j, i->caption) { + BOOST_FOREACH (shared_ptr j, i->caption) { BOOST_FOREACH (shared_ptr k, j->fonts()) { for (int l = 0; l < FontFiles::VARIANTS; ++l) { optional const p = k->file (static_cast(l)); diff --git a/src/lib/player.cc b/src/lib/player.cc index 4635233ff..22526edef 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -40,8 +40,8 @@ #include "decoder.h" #include "video_decoder.h" #include "audio_decoder.h" -#include "caption_content.h" -#include "caption_decoder.h" +#include "text_content.h" +#include "text_decoder.h" #include "ffmpeg_content.h" #include "audio_content.h" #include "dcp_decoder.h" @@ -138,7 +138,7 @@ Player::setup_pieces () } if (_ignore_caption) { - BOOST_FOREACH (shared_ptr i, decoder->caption) { + BOOST_FOREACH (shared_ptr i, decoder->caption) { i->set_ignore (true); } } @@ -167,17 +167,17 @@ Player::setup_pieces () decoder->audio->Data.connect (bind (&Player::audio, this, weak_ptr (piece), _1, _2)); } - list >::const_iterator j = decoder->caption.begin(); + list >::const_iterator j = decoder->caption.begin(); while (j != decoder->caption.end()) { (*j)->BitmapStart.connect ( - bind(&Player::bitmap_text_start, this, weak_ptr(piece), weak_ptr((*j)->content()), _1) + bind(&Player::bitmap_text_start, this, weak_ptr(piece), weak_ptr((*j)->content()), _1) ); (*j)->PlainStart.connect ( - bind(&Player::plain_text_start, this, weak_ptr(piece), weak_ptr((*j)->content()), _1) + bind(&Player::plain_text_start, this, weak_ptr(piece), weak_ptr((*j)->content()), _1) ); (*j)->Stop.connect ( - bind(&Player::subtitle_stop, this, weak_ptr(piece), weak_ptr((*j)->content()), _1, _2) + bind(&Player::subtitle_stop, this, weak_ptr(piece), weak_ptr((*j)->content()), _1, _2) ); ++j; @@ -221,9 +221,9 @@ Player::playlist_content_changed (weak_ptr w, int property, bool freque property == AudioContentProperty::STREAMS || property == DCPContentProperty::NEEDS_ASSETS || property == DCPContentProperty::NEEDS_KDM || - property == CaptionContentProperty::COLOUR || - property == CaptionContentProperty::EFFECT || - property == CaptionContentProperty::EFFECT_COLOUR || + property == TextContentProperty::COLOUR || + property == TextContentProperty::EFFECT || + property == TextContentProperty::EFFECT_COLOUR || property == FFmpegContentProperty::SUBTITLE_STREAM || property == FFmpegContentProperty::FILTERS ) { @@ -232,18 +232,18 @@ Player::playlist_content_changed (weak_ptr w, int property, bool freque Changed (property, frequent); } else if ( - property == CaptionContentProperty::LINE_SPACING || - property == CaptionContentProperty::OUTLINE_WIDTH || - property == CaptionContentProperty::Y_SCALE || - property == CaptionContentProperty::FADE_IN || - property == CaptionContentProperty::FADE_OUT || + property == TextContentProperty::LINE_SPACING || + property == TextContentProperty::OUTLINE_WIDTH || + property == TextContentProperty::Y_SCALE || + property == TextContentProperty::FADE_IN || + property == TextContentProperty::FADE_OUT || property == ContentProperty::VIDEO_FRAME_RATE || - property == CaptionContentProperty::USE || - property == CaptionContentProperty::X_OFFSET || - property == CaptionContentProperty::Y_OFFSET || - property == CaptionContentProperty::X_SCALE || - property == CaptionContentProperty::FONTS || - property == CaptionContentProperty::TYPE || + property == TextContentProperty::USE || + property == TextContentProperty::X_OFFSET || + property == TextContentProperty::Y_OFFSET || + property == TextContentProperty::X_SCALE || + property == TextContentProperty::FONTS || + property == TextContentProperty::TYPE || property == VideoContentProperty::CROP || property == VideoContentProperty::SCALE || property == VideoContentProperty::FADE_IN || @@ -302,11 +302,11 @@ Player::film_changed (Film::Property p) } list -Player::transform_bitmap_captions (list subs) const +Player::transform_bitmap_captions (list subs) const { list all; - for (list::const_iterator i = subs.begin(); i != subs.end(); ++i) { + for (list::const_iterator i = subs.begin(); i != subs.end(); ++i) { if (!i->image) { continue; } @@ -419,7 +419,7 @@ Player::get_subtitle_fonts () list > fonts; BOOST_FOREACH (shared_ptr i, _pieces) { - BOOST_FOREACH (shared_ptr j, i->content->caption) { + BOOST_FOREACH (shared_ptr j, i->content->caption) { /* XXX: things may go wrong if there are duplicate font IDs with different font files. */ @@ -676,7 +676,7 @@ Player::pass () return done; } -list +list Player::closed_captions_for_frame (DCPTime time) const { return _active_captions[CAPTION_CLOSED].get ( @@ -692,7 +692,7 @@ Player::open_captions_for_frame (DCPTime time) const int const vfr = _film->video_frame_rate(); BOOST_FOREACH ( - PlayerCaption j, + PlayerText j, _active_captions[CAPTION_OPEN].get_burnt(DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_open_captions) ) { @@ -870,10 +870,10 @@ Player::audio (weak_ptr wp, AudioStreamPtr stream, ContentAudio content_a } void -Player::bitmap_text_start (weak_ptr wp, weak_ptr wc, ContentBitmapCaption subtitle) +Player::bitmap_text_start (weak_ptr wp, weak_ptr wc, ContentBitmapText subtitle) { shared_ptr piece = wp.lock (); - shared_ptr caption = wc.lock (); + shared_ptr caption = wc.lock (); if (!piece || !caption) { return; } @@ -890,7 +890,7 @@ Player::bitmap_text_start (weak_ptr wp, weak_ptr wc subtitle.sub.rectangle.width *= caption->x_scale (); subtitle.sub.rectangle.height *= caption->y_scale (); - PlayerCaption ps; + PlayerText ps; ps.image.push_back (subtitle.sub); DCPTime from (content_time_to_dcp (piece, subtitle.from())); @@ -898,15 +898,15 @@ Player::bitmap_text_start (weak_ptr wp, weak_ptr wc } void -Player::plain_text_start (weak_ptr wp, weak_ptr wc, ContentTextCaption subtitle) +Player::plain_text_start (weak_ptr wp, weak_ptr wc, ContentStringText subtitle) { shared_ptr piece = wp.lock (); - shared_ptr caption = wc.lock (); + shared_ptr caption = wc.lock (); if (!piece || !caption) { return; } - PlayerCaption ps; + PlayerText ps; DCPTime const from (content_time_to_dcp (piece, subtitle.from())); if (from > piece->content->end()) { @@ -934,7 +934,7 @@ Player::plain_text_start (weak_ptr wp, weak_ptr wc, } s.set_in (dcp::Time(from.seconds(), 1000)); - ps.text.push_back (TextCaption (s, caption->outline_width())); + ps.text.push_back (StringText (s, caption->outline_width())); ps.add_fonts (caption->fonts ()); } @@ -942,14 +942,14 @@ Player::plain_text_start (weak_ptr wp, weak_ptr wc, } void -Player::subtitle_stop (weak_ptr wp, weak_ptr wc, ContentTime to, CaptionType type) +Player::subtitle_stop (weak_ptr wp, weak_ptr wc, ContentTime to, TextType type) { if (!_active_captions[type].have (wc)) { return; } shared_ptr piece = wp.lock (); - shared_ptr caption = wc.lock (); + shared_ptr caption = wc.lock (); if (!piece || !caption) { return; } @@ -960,7 +960,7 @@ Player::subtitle_stop (weak_ptr wp, weak_ptr wc, Co return; } - pair from = _active_captions[type].add_to (wc, dcp_to); + pair from = _active_captions[type].add_to (wc, dcp_to); bool const always = type == CAPTION_OPEN && _always_burn_open_captions; if (caption->use() && !always && !caption->burn()) { diff --git a/src/lib/player.h b/src/lib/player.h index c086b9697..280373738 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -21,9 +21,9 @@ #ifndef DCPOMATIC_PLAYER_H #define DCPOMATIC_PLAYER_H -#include "player_caption.h" -#include "active_captions.h" -#include "content_caption.h" +#include "player_text.h" +#include "active_text.h" +#include "content_text.h" #include "film.h" #include "content.h" #include "position_image.h" @@ -86,7 +86,7 @@ public: DCPTime content_time_to_dcp (boost::shared_ptr content, ContentTime t); - std::list closed_captions_for_frame (DCPTime time) const; + std::list closed_captions_for_frame (DCPTime time) const; /** Emitted when something has changed such that if we went back and emitted * the last frame again it would look different. This is not emitted after @@ -103,7 +103,7 @@ public: /** Emitted when a caption is ready. This signal may be emitted considerably * after the corresponding Video. */ - boost::signals2::signal Caption; + boost::signals2::signal Caption; private: friend class PlayerWrapper; @@ -118,7 +118,7 @@ private: void film_changed (Film::Property); void playlist_changed (); void playlist_content_changed (boost::weak_ptr, int, bool); - std::list transform_bitmap_captions (std::list) const; + std::list transform_bitmap_captions (std::list) const; Frame dcp_to_content_video (boost::shared_ptr piece, DCPTime t) const; DCPTime content_video_to_dcp (boost::shared_ptr piece, Frame f) const; Frame dcp_to_resampled_audio (boost::shared_ptr piece, DCPTime t) const; @@ -128,9 +128,9 @@ private: boost::shared_ptr black_player_video_frame (Eyes eyes) const; void video (boost::weak_ptr, ContentVideo); void audio (boost::weak_ptr, AudioStreamPtr, ContentAudio); - void bitmap_text_start (boost::weak_ptr, boost::weak_ptr, ContentBitmapCaption); - void plain_text_start (boost::weak_ptr, boost::weak_ptr, ContentTextCaption); - void subtitle_stop (boost::weak_ptr, boost::weak_ptr, ContentTime, CaptionType); + void bitmap_text_start (boost::weak_ptr, boost::weak_ptr, ContentBitmapText); + void plain_text_start (boost::weak_ptr, boost::weak_ptr, ContentStringText); + void subtitle_stop (boost::weak_ptr, boost::weak_ptr, ContentTime, TextType); DCPTime one_video_frame () const; void fill_audio (DCPTimePeriod period); std::pair, DCPTime> discard_audio ( @@ -195,7 +195,7 @@ private: Empty _black; Empty _silent; - ActiveCaptions _active_captions[CAPTION_COUNT]; + ActiveText _active_captions[CAPTION_COUNT]; boost::shared_ptr _audio_processor; boost::signals2::scoped_connection _film_changed_connection; diff --git a/src/lib/player_caption.cc b/src/lib/player_text.cc similarity index 92% rename from src/lib/player_caption.cc rename to src/lib/player_text.cc index 74c847aae..16e89b0f1 100644 --- a/src/lib/player_caption.cc +++ b/src/lib/player_text.cc @@ -18,7 +18,7 @@ */ -#include "player_caption.h" +#include "player_text.h" #include "font.h" #include @@ -26,7 +26,7 @@ using std::list; using boost::shared_ptr; void -PlayerCaption::add_fonts (list > fonts_) +PlayerText::add_fonts (list > fonts_) { BOOST_FOREACH (shared_ptr i, fonts_) { bool got = false; diff --git a/src/lib/player_caption.h b/src/lib/player_text.h similarity index 82% rename from src/lib/player_caption.h rename to src/lib/player_text.h index 2f7e909aa..5a8799116 100644 --- a/src/lib/player_caption.h +++ b/src/lib/player_text.h @@ -21,22 +21,22 @@ #ifndef DCPOMATIC_PLAYER_CAPTION_H #define DCPOMATIC_PLAYER_CAPTION_H -#include "bitmap_caption.h" +#include "bitmap_text.h" #include "dcpomatic_time.h" -#include "text_caption.h" +#include "string_text.h" class Font; /** A set of text (subtitle/CCAP) which span the same time period */ -class PlayerCaption +class PlayerText { public: void add_fonts (std::list > fonts_); std::list > fonts; - /** BitmapCaptions, with their rectangles transformed as specified by their content */ - std::list image; - std::list text; + /** BitmapTexts, with their rectangles transformed as specified by their content */ + std::list image; + std::list text; }; #endif diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 6c7fd7f4e..a55893291 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -20,7 +20,7 @@ #include "playlist.h" #include "video_content.h" -#include "caption_content.h" +#include "text_content.h" #include "ffmpeg_decoder.h" #include "ffmpeg_content.h" #include "image_decoder.h" @@ -156,7 +156,7 @@ Playlist::video_identifier () const BOOST_FOREACH (shared_ptr i, _content) { bool burn = false; - BOOST_FOREACH (shared_ptr j, i->caption) { + BOOST_FOREACH (shared_ptr j, i->caption) { if (j->burn()) { burn = true; } diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 1836b6543..7f5572c36 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -545,7 +545,7 @@ ReelWriter::write (shared_ptr audio) } void -ReelWriter::write (PlayerCaption subs, CaptionType type, DCPTimePeriod period) +ReelWriter::write (PlayerText subs, TextType type, DCPTimePeriod period) { if (!_caption_asset[type]) { string lang = _film->subtitle_language (); @@ -573,14 +573,14 @@ ReelWriter::write (PlayerCaption subs, CaptionType type, DCPTimePeriod period) } } - BOOST_FOREACH (TextCaption i, subs.text) { + BOOST_FOREACH (StringText i, subs.text) { /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */ i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr)); i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr)); _caption_asset[type]->add (shared_ptr(new dcp::SubtitleString(i))); } - BOOST_FOREACH (BitmapCaption i, subs.image) { + BOOST_FOREACH (BitmapText i, subs.image) { _caption_asset[type]->add ( shared_ptr( new dcp::SubtitleImage( diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h index 24a5e9a8a..8007b7f29 100644 --- a/src/lib/reel_writer.h +++ b/src/lib/reel_writer.h @@ -21,7 +21,7 @@ #include "types.h" #include "dcpomatic_time.h" #include "referenced_reel_asset.h" -#include "player_caption.h" +#include "player_text.h" #include #include @@ -60,7 +60,7 @@ public: void fake_write (Frame frame, Eyes eyes, int size); void repeat_write (Frame frame, Eyes eyes); void write (boost::shared_ptr audio); - void write (PlayerCaption text, CaptionType type, DCPTimePeriod period); + void write (PlayerText text, TextType type, DCPTimePeriod period); void finish (); boost::shared_ptr create_reel (std::list const & refs, std::list > const & fonts); diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 63ff2b74c..cbc19efc9 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -51,11 +51,11 @@ static FcConfig* fc_config = 0; static list > fc_config_fonts; string -marked_up (list subtitles, int target_height, float fade_factor) +marked_up (list subtitles, int target_height, float fade_factor) { string out; - BOOST_FOREACH (TextCaption const & i, subtitles) { + BOOST_FOREACH (StringText const & i, subtitles) { out += " context, dcp::Colour colour, floa * at the same time and with the same fade in/out. */ static PositionImage -render_line (list subtitles, list > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_line (list subtitles, list > fonts, dcp::Size target, DCPTime time, int frame_rate) { /* XXX: this method can only handle italic / bold changes mid-line, nothing else yet. @@ -365,12 +365,12 @@ render_line (list subtitles, list > fonts, dcp::Si * @param frame_rate DCP frame rate. */ list -render_text (list subtitles, list > fonts, dcp::Size target, DCPTime time, int frame_rate) +render_text (list subtitles, list > fonts, dcp::Size target, DCPTime time, int frame_rate) { - list pending; + list pending; list images; - BOOST_FOREACH (TextCaption const & i, subtitles) { + BOOST_FOREACH (StringText const & i, subtitles) { if (!pending.empty() && fabs (i.v_position() - pending.back().v_position()) > 1e-4) { images.push_back (render_line (pending, fonts, target, time, frame_rate)); pending.clear (); diff --git a/src/lib/render_text.h b/src/lib/render_text.h index 0a8e97bc9..99b4391db 100644 --- a/src/lib/render_text.h +++ b/src/lib/render_text.h @@ -20,12 +20,12 @@ #include "position_image.h" #include "dcpomatic_time.h" -#include "text_caption.h" +#include "string_text.h" #include class Font; -std::string marked_up (std::list subtitles, int target_height, float fade_factor); +std::string marked_up (std::list subtitles, int target_height, float fade_factor); std::list render_text ( - std::list, std::list > fonts, dcp::Size, DCPTime, int + std::list, std::list > fonts, dcp::Size, DCPTime, int ); diff --git a/src/lib/text_caption.h b/src/lib/string_text.h similarity index 88% rename from src/lib/text_caption.h rename to src/lib/string_text.h index b4400f5bb..feef90d61 100644 --- a/src/lib/text_caption.h +++ b/src/lib/string_text.h @@ -27,15 +27,15 @@ * applicable to true DCP subtitles. For example, we can set outline width for burn-in * but this cannot be specified in DCP XML. */ -class TextCaption : public dcp::SubtitleString +class StringText : public dcp::SubtitleString { public: - explicit TextCaption (dcp::SubtitleString dcp_) + explicit StringText (dcp::SubtitleString dcp_) : dcp::SubtitleString (dcp_) , outline_width (2) {} - TextCaption (dcp::SubtitleString dcp_, int outline_width_) + StringText (dcp::SubtitleString dcp_, int outline_width_) : dcp::SubtitleString (dcp_) , outline_width (outline_width_) {} diff --git a/src/lib/text_caption_file.cc b/src/lib/string_text_file.cc similarity index 93% rename from src/lib/text_caption_file.cc rename to src/lib/string_text_file.cc index 11d4517db..c7eadbbb1 100644 --- a/src/lib/text_caption_file.cc +++ b/src/lib/string_text_file.cc @@ -18,10 +18,10 @@ */ -#include "text_caption_file.h" +#include "string_text_file.h" #include "cross.h" #include "exceptions.h" -#include "text_caption_file_content.h" +#include "string_text_file_content.h" #include #include #include @@ -39,7 +39,7 @@ using boost::scoped_array; using boost::optional; using dcp::Data; -TextCaptionFile::TextCaptionFile (shared_ptr content) +StringTextFile::StringTextFile (shared_ptr content) { Data in (content->path (0)); @@ -96,7 +96,7 @@ TextCaptionFile::TextCaptionFile (shared_ptr conte /** @return time of first subtitle, if there is one */ optional -TextCaptionFile::first () const +StringTextFile::first () const { if (_subtitles.empty()) { return optional(); @@ -106,7 +106,7 @@ TextCaptionFile::first () const } ContentTime -TextCaptionFile::length () const +StringTextFile::length () const { if (_subtitles.empty ()) { return ContentTime (); diff --git a/src/lib/text_caption_file.h b/src/lib/string_text_file.h similarity index 83% rename from src/lib/text_caption_file.h rename to src/lib/string_text_file.h index 4a5657a08..0091973a4 100644 --- a/src/lib/text_caption_file.h +++ b/src/lib/string_text_file.h @@ -26,22 +26,22 @@ #include #include -class TextCaptionFileContent; +class StringTextFileContent; class plain_text_time_test; class plain_text_coordinate_test; class plain_text_content_test; class plain_text_parse_test; -/** @class TextCaptionFile - * @brief Base for TextCaptionFile decoder and examiner. +/** @class StringTextFile + * @brief Base for StringTextFile decoder and examiner. * * In fact this is sufficient for the examiner, so it's used as-is rather than deriving - * a pointless TextCaptionFileExaminer. + * a pointless StringTextFileExaminer. */ -class TextCaptionFile +class StringTextFile { public: - explicit TextCaptionFile (boost::shared_ptr); + explicit StringTextFile (boost::shared_ptr); boost::optional first () const; ContentTime length () const; diff --git a/src/lib/text_caption_file_content.cc b/src/lib/string_text_file_content.cc similarity index 70% rename from src/lib/text_caption_file_content.cc rename to src/lib/string_text_file_content.cc index aa64ca572..6c181bb91 100644 --- a/src/lib/text_caption_file_content.cc +++ b/src/lib/string_text_file_content.cc @@ -18,12 +18,12 @@ */ -#include "text_caption_file_content.h" +#include "string_text_file_content.h" #include "util.h" -#include "text_caption_file.h" +#include "string_text_file.h" #include "film.h" #include "font.h" -#include "caption_content.h" +#include "text_content.h" #include #include #include @@ -35,24 +35,24 @@ using std::cout; using boost::shared_ptr; using dcp::raw_convert; -TextCaptionFileContent::TextCaptionFileContent (shared_ptr film, boost::filesystem::path path) +StringTextFileContent::StringTextFileContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) { - caption.push_back (shared_ptr (new CaptionContent (this, CAPTION_OPEN))); + caption.push_back (shared_ptr (new TextContent (this, CAPTION_OPEN))); } -TextCaptionFileContent::TextCaptionFileContent (shared_ptr film, cxml::ConstNodePtr node, int version) +StringTextFileContent::StringTextFileContent (shared_ptr film, cxml::ConstNodePtr node, int version) : Content (film, node) , _length (node->number_child ("Length")) { - caption = CaptionContent::from_xml (this, node, version); + caption = TextContent::from_xml (this, node, version); } void -TextCaptionFileContent::examine (boost::shared_ptr job) +StringTextFileContent::examine (boost::shared_ptr job) { Content::examine (job); - TextCaptionFile s (shared_from_this ()); + StringTextFile s (shared_from_this ()); /* Default to turning these subtitles on */ only_caption()->set_use (true); @@ -63,19 +63,19 @@ TextCaptionFileContent::examine (boost::shared_ptr job) } string -TextCaptionFileContent::summary () const +StringTextFileContent::summary () const { return path_summary() + " " + _("[subtitles]"); } string -TextCaptionFileContent::technical_summary () const +StringTextFileContent::technical_summary () const { return Content::technical_summary() + " - " + _("Text subtitles"); } void -TextCaptionFileContent::as_xml (xmlpp::Node* node, bool with_paths) const +StringTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const { node->add_child("Type")->add_child_text ("TextSubtitle"); Content::as_xml (node, with_paths); @@ -88,7 +88,7 @@ TextCaptionFileContent::as_xml (xmlpp::Node* node, bool with_paths) const } DCPTime -TextCaptionFileContent::full_length () const +StringTextFileContent::full_length () const { FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate ()); return DCPTime (_length, frc); diff --git a/src/lib/text_caption_file_content.h b/src/lib/string_text_file_content.h similarity index 72% rename from src/lib/text_caption_file_content.h rename to src/lib/string_text_file_content.h index f8f4a9851..c2de86ce5 100644 --- a/src/lib/text_caption_file_content.h +++ b/src/lib/string_text_file_content.h @@ -22,17 +22,17 @@ class Job; -/** @class TextCaptionFileContent +/** @class StringTextFileContent * @brief A SubRip, SSA or ASS file. */ -class TextCaptionFileContent : public Content +class StringTextFileContent : public Content { public: - TextCaptionFileContent (boost::shared_ptr, boost::filesystem::path); - TextCaptionFileContent (boost::shared_ptr, cxml::ConstNodePtr, int); + StringTextFileContent (boost::shared_ptr, boost::filesystem::path); + StringTextFileContent (boost::shared_ptr, cxml::ConstNodePtr, int); - boost::shared_ptr shared_from_this () { - return boost::dynamic_pointer_cast (Content::shared_from_this ()); + boost::shared_ptr shared_from_this () { + return boost::dynamic_pointer_cast (Content::shared_from_this ()); } void examine (boost::shared_ptr); diff --git a/src/lib/text_caption_file_decoder.cc b/src/lib/string_text_file_decoder.cc similarity index 77% rename from src/lib/text_caption_file_decoder.cc rename to src/lib/string_text_file_decoder.cc index 65de6a562..a81f2592d 100644 --- a/src/lib/text_caption_file_decoder.cc +++ b/src/lib/string_text_file_decoder.cc @@ -18,10 +18,10 @@ */ -#include "text_caption_file_decoder.h" -#include "text_caption_file_content.h" -#include "caption_content.h" -#include "caption_decoder.h" +#include "string_text_file_decoder.h" +#include "string_text_file_content.h" +#include "text_content.h" +#include "text_decoder.h" #include #include #include @@ -35,19 +35,19 @@ using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; -TextCaptionFileDecoder::TextCaptionFileDecoder (shared_ptr content, shared_ptr log) - : TextCaptionFile (content) +StringTextFileDecoder::StringTextFileDecoder (shared_ptr content, shared_ptr log) + : StringTextFile (content) , _next (0) { ContentTime first; if (!_subtitles.empty()) { first = content_time_period(_subtitles[0]).from; } - caption.push_back (shared_ptr (new CaptionDecoder (this, content->only_caption(), log, first))); + caption.push_back (shared_ptr (new TextDecoder (this, content->only_caption(), log, first))); } void -TextCaptionFileDecoder::seek (ContentTime time, bool accurate) +StringTextFileDecoder::seek (ContentTime time, bool accurate) { /* It's worth back-tracking a little here as decoding is cheap and it's nice if we don't miss too many subtitles when seeking. @@ -66,7 +66,7 @@ TextCaptionFileDecoder::seek (ContentTime time, bool accurate) } bool -TextCaptionFileDecoder::pass () +StringTextFileDecoder::pass () { if (_next >= _subtitles.size ()) { return true; @@ -80,7 +80,7 @@ TextCaptionFileDecoder::pass () } ContentTimePeriod -TextCaptionFileDecoder::content_time_period (sub::Subtitle s) const +StringTextFileDecoder::content_time_period (sub::Subtitle s) const { return ContentTimePeriod ( ContentTime::from_seconds (s.from.all_as_seconds()), diff --git a/src/lib/text_caption_file_decoder.h b/src/lib/string_text_file_decoder.h similarity index 81% rename from src/lib/text_caption_file_decoder.h rename to src/lib/string_text_file_decoder.h index 769777571..6a9552bbe 100644 --- a/src/lib/text_caption_file_decoder.h +++ b/src/lib/string_text_file_decoder.h @@ -21,16 +21,16 @@ #ifndef DCPOMATIC_TEXT_CAPTION_FILE_DECODER_H #define DCPOMATIC_TEXT_CAPTION_FILE_DECODER_H -#include "text_caption_file.h" +#include "string_text_file.h" #include "decoder.h" -class TextCaptionFileContent; +class StringTextFileContent; class Log; -class TextCaptionFileDecoder : public Decoder, public TextCaptionFile +class StringTextFileDecoder : public Decoder, public StringTextFile { public: - TextCaptionFileDecoder (boost::shared_ptr, boost::shared_ptr log); + StringTextFileDecoder (boost::shared_ptr, boost::shared_ptr log); void seek (ContentTime time, bool accurate); bool pass (); diff --git a/src/lib/caption_content.cc b/src/lib/text_content.cc similarity index 74% rename from src/lib/caption_content.cc rename to src/lib/text_content.cc index 4d0795190..fbc7d82af 100644 --- a/src/lib/caption_content.cc +++ b/src/lib/text_content.cc @@ -18,7 +18,7 @@ */ -#include "caption_content.h" +#include "text_content.h" #include "util.h" #include "exceptions.h" #include "font.h" @@ -40,24 +40,24 @@ using boost::dynamic_pointer_cast; using boost::optional; using dcp::raw_convert; -int const CaptionContentProperty::X_OFFSET = 500; -int const CaptionContentProperty::Y_OFFSET = 501; -int const CaptionContentProperty::X_SCALE = 502; -int const CaptionContentProperty::Y_SCALE = 503; -int const CaptionContentProperty::USE = 504; -int const CaptionContentProperty::BURN = 505; -int const CaptionContentProperty::LANGUAGE = 506; -int const CaptionContentProperty::FONTS = 507; -int const CaptionContentProperty::COLOUR = 508; -int const CaptionContentProperty::EFFECT = 509; -int const CaptionContentProperty::EFFECT_COLOUR = 510; -int const CaptionContentProperty::LINE_SPACING = 511; -int const CaptionContentProperty::FADE_IN = 512; -int const CaptionContentProperty::FADE_OUT = 513; -int const CaptionContentProperty::OUTLINE_WIDTH = 514; -int const CaptionContentProperty::TYPE = 515; - -CaptionContent::CaptionContent (Content* parent, CaptionType original_type) +int const TextContentProperty::X_OFFSET = 500; +int const TextContentProperty::Y_OFFSET = 501; +int const TextContentProperty::X_SCALE = 502; +int const TextContentProperty::Y_SCALE = 503; +int const TextContentProperty::USE = 504; +int const TextContentProperty::BURN = 505; +int const TextContentProperty::LANGUAGE = 506; +int const TextContentProperty::FONTS = 507; +int const TextContentProperty::COLOUR = 508; +int const TextContentProperty::EFFECT = 509; +int const TextContentProperty::EFFECT_COLOUR = 510; +int const TextContentProperty::LINE_SPACING = 511; +int const TextContentProperty::FADE_IN = 512; +int const TextContentProperty::FADE_OUT = 513; +int const TextContentProperty::OUTLINE_WIDTH = 514; +int const TextContentProperty::TYPE = 515; + +TextContent::TextContent (Content* parent, TextType original_type) : ContentPart (parent) , _use (false) , _burn (false) @@ -73,18 +73,18 @@ CaptionContent::CaptionContent (Content* parent, CaptionType original_type) } -/** @return CaptionContents from node or nodes under node (according to version). - * The list could be empty if no CaptionContents are found. +/** @return TextContents from node or nodes under node (according to version). + * The list could be empty if no TextContents are found. */ -list > -CaptionContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) +list > +TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) { if (version < 34) { /* With old metadata FFmpeg content has the subtitle-related tags even with no subtitle streams, so check for that. */ if (node->string_child("Type") == "FFmpeg" && node->node_children("SubtitleStream").empty()) { - return list >(); + return list >(); } /* Otherwise we can drop through to the newer logic */ @@ -92,25 +92,25 @@ CaptionContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) if (version < 37) { if (!node->optional_number_child("SubtitleXOffset") && !node->optional_number_child("SubtitleOffset")) { - return list >(); + return list >(); } - list > c; - c.push_back (shared_ptr (new CaptionContent (parent, node, version))); + list > c; + c.push_back (shared_ptr (new TextContent (parent, node, version))); return c; } if (!node->optional_node_child("Caption")) { - return list >(); + return list >(); } - list > c; + list > c; BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Caption")) { - c.push_back (shared_ptr (new CaptionContent (parent, i, version))); + c.push_back (shared_ptr (new TextContent (parent, i, version))); } return c; } -CaptionContent::CaptionContent (Content* parent, cxml::ConstNodePtr node, int version) +TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version) : ContentPart (parent) , _use (false) , _burn (false) @@ -229,13 +229,13 @@ CaptionContent::CaptionContent (Content* parent, cxml::ConstNodePtr node, int ve _original_type = string_to_caption_type (node->optional_string_child("OriginalType").get_value_or("open")); } -CaptionContent::CaptionContent (Content* parent, vector > c) +TextContent::TextContent (Content* parent, vector > c) : ContentPart (parent) { /* This constructor is for join which is only supported for content types that have a single caption, so we can use only_caption() here. */ - shared_ptr ref = c[0]->only_caption(); + shared_ptr ref = c[0]->only_caption(); DCPOMATIC_ASSERT (ref); list > ref_fonts = ref->fonts (); @@ -314,7 +314,7 @@ CaptionContent::CaptionContent (Content* parent, vector > c) /** _mutex must not be held on entry */ void -CaptionContent::as_xml (xmlpp::Node* root) const +TextContent::as_xml (xmlpp::Node* root) const { boost::mutex::scoped_lock lm (_mutex); @@ -368,7 +368,7 @@ CaptionContent::as_xml (xmlpp::Node* root) const } string -CaptionContent::identifier () const +TextContent::identifier () const { string s = raw_convert (x_scale()) + "_" + raw_convert (y_scale()) @@ -399,14 +399,14 @@ CaptionContent::identifier () const } void -CaptionContent::add_font (shared_ptr font) +TextContent::add_font (shared_ptr font) { _fonts.push_back (font); connect_to_fonts (); } void -CaptionContent::connect_to_fonts () +TextContent::connect_to_fonts () { BOOST_FOREACH (boost::signals2::connection& i, _font_connections) { i.disconnect (); @@ -415,138 +415,138 @@ CaptionContent::connect_to_fonts () _font_connections.clear (); BOOST_FOREACH (shared_ptr i, _fonts) { - _font_connections.push_back (i->Changed.connect (boost::bind (&CaptionContent::font_changed, this))); + _font_connections.push_back (i->Changed.connect (boost::bind (&TextContent::font_changed, this))); } } void -CaptionContent::font_changed () +TextContent::font_changed () { - _parent->signal_changed (CaptionContentProperty::FONTS); + _parent->signal_changed (TextContentProperty::FONTS); } void -CaptionContent::set_colour (dcp::Colour colour) +TextContent::set_colour (dcp::Colour colour) { - maybe_set (_colour, colour, CaptionContentProperty::COLOUR); + maybe_set (_colour, colour, TextContentProperty::COLOUR); } void -CaptionContent::unset_colour () +TextContent::unset_colour () { - maybe_set (_colour, optional(), CaptionContentProperty::COLOUR); + maybe_set (_colour, optional(), TextContentProperty::COLOUR); } void -CaptionContent::set_effect (dcp::Effect e) +TextContent::set_effect (dcp::Effect e) { - maybe_set (_effect, e, CaptionContentProperty::EFFECT); + maybe_set (_effect, e, TextContentProperty::EFFECT); } void -CaptionContent::unset_effect () +TextContent::unset_effect () { - maybe_set (_effect, optional(), CaptionContentProperty::EFFECT); + maybe_set (_effect, optional(), TextContentProperty::EFFECT); } void -CaptionContent::set_effect_colour (dcp::Colour colour) +TextContent::set_effect_colour (dcp::Colour colour) { - maybe_set (_effect_colour, colour, CaptionContentProperty::EFFECT_COLOUR); + maybe_set (_effect_colour, colour, TextContentProperty::EFFECT_COLOUR); } void -CaptionContent::unset_effect_colour () +TextContent::unset_effect_colour () { - maybe_set (_effect_colour, optional(), CaptionContentProperty::EFFECT_COLOUR); + maybe_set (_effect_colour, optional(), TextContentProperty::EFFECT_COLOUR); } void -CaptionContent::set_use (bool u) +TextContent::set_use (bool u) { - maybe_set (_use, u, CaptionContentProperty::USE); + maybe_set (_use, u, TextContentProperty::USE); } void -CaptionContent::set_burn (bool b) +TextContent::set_burn (bool b) { - maybe_set (_burn, b, CaptionContentProperty::BURN); + maybe_set (_burn, b, TextContentProperty::BURN); } void -CaptionContent::set_x_offset (double o) +TextContent::set_x_offset (double o) { - maybe_set (_x_offset, o, CaptionContentProperty::X_OFFSET); + maybe_set (_x_offset, o, TextContentProperty::X_OFFSET); } void -CaptionContent::set_y_offset (double o) +TextContent::set_y_offset (double o) { - maybe_set (_y_offset, o, CaptionContentProperty::Y_OFFSET); + maybe_set (_y_offset, o, TextContentProperty::Y_OFFSET); } void -CaptionContent::set_x_scale (double s) +TextContent::set_x_scale (double s) { - maybe_set (_x_scale, s, CaptionContentProperty::X_SCALE); + maybe_set (_x_scale, s, TextContentProperty::X_SCALE); } void -CaptionContent::set_y_scale (double s) +TextContent::set_y_scale (double s) { - maybe_set (_y_scale, s, CaptionContentProperty::Y_SCALE); + maybe_set (_y_scale, s, TextContentProperty::Y_SCALE); } void -CaptionContent::set_language (string language) +TextContent::set_language (string language) { - maybe_set (_language, language, CaptionContentProperty::LANGUAGE); + maybe_set (_language, language, TextContentProperty::LANGUAGE); } void -CaptionContent::set_line_spacing (double s) +TextContent::set_line_spacing (double s) { - maybe_set (_line_spacing, s, CaptionContentProperty::LINE_SPACING); + maybe_set (_line_spacing, s, TextContentProperty::LINE_SPACING); } void -CaptionContent::set_fade_in (ContentTime t) +TextContent::set_fade_in (ContentTime t) { - maybe_set (_fade_in, t, CaptionContentProperty::FADE_IN); + maybe_set (_fade_in, t, TextContentProperty::FADE_IN); } void -CaptionContent::unset_fade_in () +TextContent::unset_fade_in () { - maybe_set (_fade_in, optional(), CaptionContentProperty::FADE_IN); + maybe_set (_fade_in, optional(), TextContentProperty::FADE_IN); } void -CaptionContent::set_fade_out (ContentTime t) +TextContent::set_fade_out (ContentTime t) { - maybe_set (_fade_out, t, CaptionContentProperty::FADE_OUT); + maybe_set (_fade_out, t, TextContentProperty::FADE_OUT); } void -CaptionContent::unset_fade_out () +TextContent::unset_fade_out () { - maybe_set (_fade_out, optional(), CaptionContentProperty::FADE_OUT); + maybe_set (_fade_out, optional(), TextContentProperty::FADE_OUT); } void -CaptionContent::set_type (CaptionType type) +TextContent::set_type (TextType type) { - maybe_set (_type, type, CaptionContentProperty::TYPE); + maybe_set (_type, type, TextContentProperty::TYPE); } void -CaptionContent::set_outline_width (int w) +TextContent::set_outline_width (int w) { - maybe_set (_outline_width, w, CaptionContentProperty::OUTLINE_WIDTH); + maybe_set (_outline_width, w, TextContentProperty::OUTLINE_WIDTH); } void -CaptionContent::take_settings_from (shared_ptr c) +TextContent::take_settings_from (shared_ptr c) { set_use (c->_use); set_burn (c->_burn); @@ -554,7 +554,7 @@ CaptionContent::take_settings_from (shared_ptr c) set_y_offset (c->_y_offset); set_x_scale (c->_x_scale); set_y_scale (c->_y_scale); - maybe_set (_fonts, c->_fonts, CaptionContentProperty::FONTS); + maybe_set (_fonts, c->_fonts, TextContentProperty::FONTS); if (c->_colour) { set_colour (*c->_colour); } else { diff --git a/src/lib/caption_content.h b/src/lib/text_content.h similarity index 89% rename from src/lib/caption_content.h rename to src/lib/text_content.h index 4f5780d23..5aacc7ecf 100644 --- a/src/lib/caption_content.h +++ b/src/lib/text_content.h @@ -28,7 +28,7 @@ class Font; -class CaptionContentProperty +class TextContentProperty { public: static int const X_OFFSET; @@ -49,21 +49,21 @@ public: static int const TYPE; }; -/** @class CaptionContent +/** @class TextContent * @brief Description of how some text content should be presented. * * There are `bitmap' subtitles and `plain' subtitles (plain text), * and not all of the settings in this class correspond to both types. */ -class CaptionContent : public ContentPart +class TextContent : public ContentPart { public: - CaptionContent (Content* parent, CaptionType original_type); - CaptionContent (Content* parent, std::vector >); + TextContent (Content* parent, TextType original_type); + TextContent (Content* parent, std::vector >); void as_xml (xmlpp::Node *) const; std::string identifier () const; - void take_settings_from (boost::shared_ptr c); + void take_settings_from (boost::shared_ptr c); void add_font (boost::shared_ptr font); @@ -86,7 +86,7 @@ public: void set_fade_out (ContentTime); void set_outline_width (int); void unset_fade_out (); - void set_type (CaptionType type); + void set_type (TextType type); bool use () const { boost::mutex::scoped_lock lm (_mutex); @@ -163,17 +163,17 @@ public: return _outline_width; } - CaptionType type () const { + TextType type () const { boost::mutex::scoped_lock lm (_mutex); return _type; } - CaptionType original_type () const { + TextType original_type () const { boost::mutex::scoped_lock lm (_mutex); return _original_type; } - static std::list > from_xml (Content* parent, cxml::ConstNodePtr, int version); + static std::list > from_xml (Content* parent, cxml::ConstNodePtr, int version); protected: /** subtitle language (e.g. "German") or empty if it is not known */ @@ -182,7 +182,7 @@ protected: private: friend struct ffmpeg_pts_offset_test; - CaptionContent (Content* parent, cxml::ConstNodePtr, int version); + TextContent (Content* parent, cxml::ConstNodePtr, int version); void font_changed (); void connect_to_fonts (); @@ -214,9 +214,9 @@ private: /** what these captions will be used for in the output DCP (not necessarily what * they were originally). */ - CaptionType _type; + TextType _type; /** the original type of these captions in their content */ - CaptionType _original_type; + TextType _original_type; }; #endif diff --git a/src/lib/caption_decoder.cc b/src/lib/text_decoder.cc similarity index 89% rename from src/lib/caption_decoder.cc rename to src/lib/text_decoder.cc index 1a2221024..3b6a06ea1 100644 --- a/src/lib/caption_decoder.cc +++ b/src/lib/text_decoder.cc @@ -18,8 +18,8 @@ */ -#include "caption_decoder.h" -#include "caption_content.h" +#include "text_decoder.h" +#include "text_content.h" #include "util.h" #include "log.h" #include "compose.hpp" @@ -37,9 +37,9 @@ using boost::shared_ptr; using boost::optional; using boost::function; -CaptionDecoder::CaptionDecoder ( +TextDecoder::TextDecoder ( Decoder* parent, - shared_ptr c, + shared_ptr c, shared_ptr log, ContentTime first ) @@ -58,14 +58,14 @@ CaptionDecoder::CaptionDecoder ( * of the video frame) */ void -CaptionDecoder::emit_bitmap_start (ContentTime from, shared_ptr image, dcpomatic::Rect rect) +TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr image, dcpomatic::Rect rect) { - BitmapStart (ContentBitmapCaption (from, _content->type(), image, rect)); + BitmapStart (ContentBitmapText (from, _content->type(), image, rect)); _position = from; } void -CaptionDecoder::emit_plain_start (ContentTime from, list s) +TextDecoder::emit_plain_start (ContentTime from, list s) { BOOST_FOREACH (dcp::SubtitleString& i, s) { /* We must escape < and > in strings, otherwise they might confuse our subtitle @@ -94,12 +94,12 @@ CaptionDecoder::emit_plain_start (ContentTime from, list s) } } - PlainStart (ContentTextCaption (from, _content->type(), s)); + PlainStart (ContentStringText (from, _content->type(), s)); _position = from; } void -CaptionDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) +TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) { /* See if our next subtitle needs to be vertically placed on screen by us */ bool needs_placement = false; @@ -231,27 +231,27 @@ CaptionDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtit } void -CaptionDecoder::emit_stop (ContentTime to) +TextDecoder::emit_stop (ContentTime to) { Stop (to, _content->type()); } void -CaptionDecoder::emit_plain (ContentTimePeriod period, list s) +TextDecoder::emit_plain (ContentTimePeriod period, list s) { emit_plain_start (period.from, s); emit_stop (period.to); } void -CaptionDecoder::emit_plain (ContentTimePeriod period, sub::Subtitle const & s) +TextDecoder::emit_plain (ContentTimePeriod period, sub::Subtitle const & s) { emit_plain_start (period.from, s); emit_stop (period.to); } void -CaptionDecoder::seek () +TextDecoder::seek () { _position = ContentTime (); } diff --git a/src/lib/caption_decoder.h b/src/lib/text_decoder.h similarity index 79% rename from src/lib/caption_decoder.h rename to src/lib/text_decoder.h index d555446c7..25125e701 100644 --- a/src/lib/caption_decoder.h +++ b/src/lib/text_decoder.h @@ -24,7 +24,7 @@ #include "decoder.h" #include "rect.h" #include "types.h" -#include "content_caption.h" +#include "content_text.h" #include "decoder_part.h" #include #include @@ -35,12 +35,12 @@ namespace sub { class Image; -class CaptionDecoder : public DecoderPart +class TextDecoder : public DecoderPart { public: - CaptionDecoder ( + TextDecoder ( Decoder* parent, - boost::shared_ptr, + boost::shared_ptr, boost::shared_ptr log, ContentTime first ); @@ -58,16 +58,16 @@ public: void seek (); - boost::shared_ptr content () const { + boost::shared_ptr content () const { return _content; } - boost::signals2::signal BitmapStart; - boost::signals2::signal PlainStart; - boost::signals2::signal Stop; + boost::signals2::signal BitmapStart; + boost::signals2::signal PlainStart; + boost::signals2::signal Stop; private: - boost::shared_ptr _content; + boost::shared_ptr _content; ContentTime _position; }; diff --git a/src/lib/types.cc b/src/lib/types.cc index 5474b609a..7f0bf4305 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -93,7 +93,7 @@ Crop::as_xml (xmlpp::Node* node) const node->add_child("BottomCrop")->add_child_text (raw_convert (bottom)); } -CaptionType +TextType string_to_caption_type (string s) { if (s == "open") { @@ -106,7 +106,7 @@ string_to_caption_type (string s) } string -caption_type_to_string (CaptionType t) +caption_type_to_string (TextType t) { switch (t) { case CAPTION_OPEN: @@ -119,7 +119,7 @@ caption_type_to_string (CaptionType t) } string -caption_type_to_name (CaptionType t) +caption_type_to_name (TextType t) { switch (t) { case CAPTION_OPEN: diff --git a/src/lib/types.h b/src/lib/types.h index 6a05f66c9..6e3732d31 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -31,7 +31,7 @@ class Content; class VideoContent; class AudioContent; -class CaptionContent; +class TextContent; class FFmpegContent; namespace cxml { @@ -139,16 +139,16 @@ enum ReelType * There is also still use of the word `subtitle' in the code; these are the * same as open captions in DoM. */ -enum CaptionType +enum TextType { CAPTION_OPEN, CAPTION_CLOSED, CAPTION_COUNT }; -extern std::string caption_type_to_string (CaptionType t); -extern std::string caption_type_to_name (CaptionType t); -extern CaptionType string_to_caption_type (std::string s); +extern std::string caption_type_to_string (TextType t); +extern std::string caption_type_to_name (TextType t); +extern TextType string_to_caption_type (std::string s); /** @struct Crop * @brief A description of the crop of an image or video. diff --git a/src/lib/writer.cc b/src/lib/writer.cc index c0a774f03..3ab1cc5b9 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -665,7 +665,7 @@ Writer::can_fake_write (Frame frame) const } void -Writer::write (PlayerCaption text, CaptionType type, DCPTimePeriod period) +Writer::write (PlayerText text, TextType type, DCPTimePeriod period) { while (_caption_reel[type]->period().to <= period.from) { ++_caption_reel[type]; diff --git a/src/lib/writer.h b/src/lib/writer.h index f67419072..71d11b773 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -23,7 +23,7 @@ */ #include "types.h" -#include "player_caption.h" +#include "player_text.h" #include "exception_store.h" #include #include @@ -104,7 +104,7 @@ public: bool can_repeat (Frame) const; void repeat (Frame, Eyes); void write (boost::shared_ptr, DCPTime time); - void write (PlayerCaption text, CaptionType type, DCPTimePeriod period); + void write (PlayerText text, TextType type, DCPTimePeriod period); void write (std::list > fonts); void write (ReferencedReelAsset asset); void finish (); diff --git a/src/lib/wscript b/src/lib/wscript index a841e5b55..a9ed0c621 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -21,7 +21,7 @@ import os import i18n sources = """ - active_captions.cc + active_text.cc analyse_audio_job.cc atmos_mxf_content.cc audio_analysis.cc @@ -38,8 +38,8 @@ sources = """ audio_ring_buffers.cc audio_stream.cc butler.cc - caption_content.cc - caption_decoder.cc + text_content.cc + text_decoder.cc case_insensitive_sorter.cc cinema.cc cinema_kdms.cc @@ -114,7 +114,7 @@ sources = """ mid_side_decoder.cc overlaps.cc player.cc - player_caption.cc + player_text.cc player_video.cc playlist.cc position_image.cc @@ -134,9 +134,9 @@ sources = """ server.cc shuffler.cc string_log_entry.cc - text_caption_file.cc - text_caption_file_content.cc - text_caption_file_decoder.cc + string_text_file.cc + string_text_file_content.cc + string_text_file_decoder.cc timer.cc transcode_job.cc types.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index b6aa2188a..a2b55691e 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -71,7 +71,7 @@ #include "lib/transcode_job.h" #include "lib/dkdm_wrapper.h" #include "lib/audio_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include #include #include @@ -580,8 +580,8 @@ private: } if (d->caption()) { - list >::iterator j = i->caption.begin (); - list >::const_iterator k = _clipboard->caption.begin (); + list >::iterator j = i->caption.begin (); + list >::const_iterator k = _clipboard->caption.begin (); while (j != i->caption.end() && k != _clipboard->caption.end()) { (*j)->take_settings_from (*k); ++j; diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index e5745403d..44c6b8606 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -27,7 +27,7 @@ #include "lib/job_manager.h" #include "lib/job.h" #include "lib/video_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/ratio.h" #include "lib/verify_dcp_job.h" #include "lib/dcp_examiner.h" @@ -626,7 +626,7 @@ private: void setup_from_dcp (shared_ptr dcp) { - BOOST_FOREACH (shared_ptr i, dcp->caption) { + BOOST_FOREACH (shared_ptr i, dcp->caption) { i->set_use (true); } diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc index 0b2e63035..3e240c6e8 100644 --- a/src/wx/closed_captions_dialog.cc +++ b/src/wx/closed_captions_dialog.cc @@ -19,7 +19,7 @@ */ #include "closed_captions_dialog.h" -#include "lib/text_caption.h" +#include "lib/string_text.h" #include using std::list; @@ -70,13 +70,13 @@ ClosedCaptionsDialog::paint () class ClosedCaptionSorter { public: - bool operator() (TextCaption const & a, TextCaption const & b) + bool operator() (StringText const & a, StringText const & b) { return from_top(a) < from_top(b); } private: - float from_top (TextCaption const & c) const + float from_top (StringText const & c) const { switch (c.v_align()) { case dcp::VALIGN_TOP: @@ -96,9 +96,9 @@ ClosedCaptionsDialog::update (DCPTime time) { shared_ptr player = _player.lock (); DCPOMATIC_ASSERT (player); - list to_show; - BOOST_FOREACH (PlayerCaption i, player->closed_captions_for_frame(time)) { - BOOST_FOREACH (TextCaption j, i.text) { + list to_show; + BOOST_FOREACH (PlayerText i, player->closed_captions_for_frame(time)) { + BOOST_FOREACH (StringText j, i.text) { to_show.push_back (j); } } @@ -109,7 +109,7 @@ ClosedCaptionsDialog::update (DCPTime time) to_show.sort (ClosedCaptionSorter()); - list::const_iterator j = to_show.begin(); + list::const_iterator j = to_show.begin(); int k = 0; while (j != to_show.end() && k < _num_lines) { _lines[k] = j->text(); diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index ce9c66a3e..a6338ecfd 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -22,13 +22,13 @@ #include "wx_util.h" #include "video_panel.h" #include "audio_panel.h" -#include "caption_panel.h" +#include "text_panel.h" #include "timing_panel.h" #include "timeline_dialog.h" #include "image_sequence_dialog.h" #include "film_viewer.h" #include "lib/audio_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/video_content.h" #include "lib/ffmpeg_content.h" #include "lib/content_factory.h" @@ -39,8 +39,8 @@ #include "lib/config.h" #include "lib/log.h" #include "lib/compose.hpp" -#include "lib/text_caption_file_content.h" -#include "lib/text_caption_file.h" +#include "lib/string_text_file_content.h" +#include "lib/string_text_file.h" #include #include #include @@ -128,7 +128,7 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr film, FilmVie _audio_panel = new AudioPanel (this); _panels.push_back (_audio_panel); for (int i = 0; i < CAPTION_COUNT; ++i) { - _caption_panel[i] = new CaptionPanel (this, static_cast(i)); + _caption_panel[i] = new TextPanel (this, static_cast(i)); _panels.push_back (_caption_panel[i]); } _timing_panel = new TimingPanel (this, _film_viewer); @@ -262,11 +262,11 @@ ContentPanel::selection_changed () BOOST_FOREACH (shared_ptr i, selected()) { DCPTime p; p = i->position(); - if (dynamic_pointer_cast(i) && i->paths_valid()) { + if (dynamic_pointer_cast(i) && i->paths_valid()) { /* Rather special case; if we select a text subtitle file jump to its first subtitle. */ - TextCaptionFile ts (dynamic_pointer_cast(i)); + StringTextFile ts (dynamic_pointer_cast(i)); if (ts.first()) { p += DCPTime(ts.first().get(), _film->active_frame_rate_change(i->position())); } @@ -306,7 +306,7 @@ ContentPanel::selection_changed () if (i->audio) { have_audio = true; } - BOOST_FOREACH (shared_ptr j, i->caption) { + BOOST_FOREACH (shared_ptr j, i->caption) { have_caption[j->original_type()] = true; } } diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index 3f0fb17a5..d31375c8e 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -32,7 +32,7 @@ class wxListEvent; class TimelineDialog; class FilmEditor; class ContentSubPanel; -class CaptionPanel; +class TextPanel; class AudioPanel; class Film; class FilmViewer; @@ -105,7 +105,7 @@ private: wxButton* _timeline; ContentSubPanel* _video_panel; AudioPanel* _audio_panel; - CaptionPanel* _caption_panel[CAPTION_COUNT]; + TextPanel* _caption_panel[CAPTION_COUNT]; ContentSubPanel* _timing_panel; std::list _panels; ContentMenu* _menu; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 51881030f..f1f82287d 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -32,7 +32,7 @@ #include "lib/ffmpeg_content.h" #include "lib/audio_processor.h" #include "lib/video_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/dcp_content.h" #include "lib/audio_content.h" #include @@ -433,8 +433,8 @@ void DCPPanel::film_content_changed (int property) { if (property == AudioContentProperty::STREAMS || - property == CaptionContentProperty::USE || - property == CaptionContentProperty::BURN || + property == TextContentProperty::USE || + property == TextContentProperty::BURN || property == VideoContentProperty::SCALE || property == DCPContentProperty::REFERENCE_VIDEO || property == DCPContentProperty::REFERENCE_AUDIO || diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 266509a44..e4449fa2f 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -24,7 +24,7 @@ #include "lib/film.h" #include "lib/config.h" -#include "lib/player_caption.h" +#include "lib/player_text.h" #include #include diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index 269dad678..3619b7e0a 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -24,7 +24,7 @@ #include "font_files_dialog.h" #include "lib/font.h" #include "lib/content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include #include #include @@ -34,7 +34,7 @@ using std::string; using std::cout; using boost::shared_ptr; -FontsDialog::FontsDialog (wxWindow* parent, shared_ptr content, shared_ptr caption) +FontsDialog::FontsDialog (wxWindow* parent, shared_ptr content, shared_ptr caption) : wxDialog (parent, wxID_ANY, _("Fonts")) , _content (content) , _caption (caption) @@ -100,7 +100,7 @@ void FontsDialog::setup () { shared_ptr content = _content.lock (); - shared_ptr caption = _caption.lock (); + shared_ptr caption = _caption.lock (); if (!content || !caption) { return; } @@ -140,7 +140,7 @@ void FontsDialog::edit_clicked () { shared_ptr content = _content.lock (); - shared_ptr caption = _caption.lock (); + shared_ptr caption = _caption.lock (); if (!content || !caption) { return; } diff --git a/src/wx/fonts_dialog.h b/src/wx/fonts_dialog.h index 6c6873ea3..ba98e0963 100644 --- a/src/wx/fonts_dialog.h +++ b/src/wx/fonts_dialog.h @@ -25,12 +25,12 @@ #include class Content; -class CaptionContent; +class TextContent; class FontsDialog : public wxDialog { public: - FontsDialog (wxWindow* parent, boost::shared_ptr, boost::shared_ptr caption); + FontsDialog (wxWindow* parent, boost::shared_ptr, boost::shared_ptr caption); private: void setup (); @@ -39,7 +39,7 @@ private: void edit_clicked (); boost::weak_ptr _content; - boost::weak_ptr _caption; + boost::weak_ptr _caption; wxListCtrl* _fonts; wxButton* _edit; }; diff --git a/src/wx/caption_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc similarity index 86% rename from src/wx/caption_appearance_dialog.cc rename to src/wx/subtitle_appearance_dialog.cc index af01dcbe8..cab473c18 100644 --- a/src/wx/caption_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -18,10 +18,10 @@ */ -#include "caption_appearance_dialog.h" +#include "subtitle_appearance_dialog.h" #include "rgba_colour_picker.h" -#include "lib/text_caption_file_content.h" -#include "lib/caption_content.h" +#include "lib/string_text_file_content.h" +#include "lib/text_content.h" #include "lib/ffmpeg_subtitle_stream.h" #include "lib/ffmpeg_content.h" #include @@ -35,11 +35,11 @@ using boost::bind; using boost::dynamic_pointer_cast; using boost::optional; -int const CaptionAppearanceDialog::NONE = 0; -int const CaptionAppearanceDialog::OUTLINE = 1; -int const CaptionAppearanceDialog::SHADOW = 2; +int const SubtitleAppearanceDialog::NONE = 0; +int const SubtitleAppearanceDialog::OUTLINE = 1; +int const SubtitleAppearanceDialog::SHADOW = 2; -CaptionAppearanceDialog::CaptionAppearanceDialog (wxWindow* parent, shared_ptr content, shared_ptr caption) +SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr content, shared_ptr caption) : wxDialog (parent, wxID_ANY, _("Caption appearance")) , _content (content) , _caption (caption) @@ -110,7 +110,7 @@ CaptionAppearanceDialog::CaptionAppearanceDialog (wxWindow* parent, shared_ptrAdd (colours_panel, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); wxButton* restore = new wxButton (this, wxID_ANY, _("Restore to original colours")); - restore->Bind (wxEVT_BUTTON, bind (&CaptionAppearanceDialog::restore, this)); + restore->Bind (wxEVT_BUTTON, bind (&SubtitleAppearanceDialog::restore, this)); overall_sizer->Add (restore, 0, wxALL, DCPOMATIC_SIZER_X_GAP); } @@ -179,19 +179,19 @@ CaptionAppearanceDialog::CaptionAppearanceDialog (wxWindow* parent, shared_ptrSetValue (_caption->outline_width ()); - _force_colour->Bind (wxEVT_CHECKBOX, bind (&CaptionAppearanceDialog::setup_sensitivity, this)); - _force_effect_colour->Bind (wxEVT_CHECKBOX, bind (&CaptionAppearanceDialog::setup_sensitivity, this)); - _force_effect->Bind (wxEVT_CHECKBOX, bind (&CaptionAppearanceDialog::setup_sensitivity, this)); - _force_fade_in->Bind (wxEVT_CHECKBOX, bind (&CaptionAppearanceDialog::setup_sensitivity, this)); - _force_fade_out->Bind (wxEVT_CHECKBOX, bind (&CaptionAppearanceDialog::setup_sensitivity, this)); - _effect->Bind (wxEVT_CHOICE, bind (&CaptionAppearanceDialog::setup_sensitivity, this)); - _content_connection = _content->Changed.connect (bind (&CaptionAppearanceDialog::setup_sensitivity, this)); + _force_colour->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _force_effect_colour->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _force_effect->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _force_fade_in->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _force_fade_out->Bind (wxEVT_CHECKBOX, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _effect->Bind (wxEVT_CHOICE, bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); + _content_connection = _content->Changed.connect (bind (&SubtitleAppearanceDialog::setup_sensitivity, this)); setup_sensitivity (); } wxCheckBox* -CaptionAppearanceDialog::set_to (wxWindow* w, int& r) +SubtitleAppearanceDialog::set_to (wxWindow* w, int& r) { wxSizer* s = new wxBoxSizer (wxHORIZONTAL); wxCheckBox* set_to = new wxCheckBox (this, wxID_ANY, _("Set to")); @@ -203,7 +203,7 @@ CaptionAppearanceDialog::set_to (wxWindow* w, int& r) } void -CaptionAppearanceDialog::apply () +SubtitleAppearanceDialog::apply () { if (_force_colour->GetValue ()) { wxColour const c = _colour->GetColour (); @@ -257,7 +257,7 @@ CaptionAppearanceDialog::apply () } void -CaptionAppearanceDialog::restore () +SubtitleAppearanceDialog::restore () { for (map::const_iterator i = _pickers.begin(); i != _pickers.end(); ++i) { i->second->set (i->first); @@ -265,7 +265,7 @@ CaptionAppearanceDialog::restore () } void -CaptionAppearanceDialog::setup_sensitivity () +SubtitleAppearanceDialog::setup_sensitivity () { _colour->Enable (_force_colour->GetValue ()); _effect_colour->Enable (_force_effect_colour->GetValue ()); diff --git a/src/wx/caption_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h similarity index 89% rename from src/wx/caption_appearance_dialog.h rename to src/wx/subtitle_appearance_dialog.h index 3fb993099..6cced717b 100644 --- a/src/wx/caption_appearance_dialog.h +++ b/src/wx/subtitle_appearance_dialog.h @@ -33,10 +33,10 @@ class FFmpegSubtitleStream; class wxCheckBox; class wxWidget; -class CaptionAppearanceDialog : public wxDialog +class SubtitleAppearanceDialog : public wxDialog { public: - CaptionAppearanceDialog (wxWindow* parent, boost::shared_ptr content, boost::shared_ptr caption); + SubtitleAppearanceDialog (wxWindow* parent, boost::shared_ptr content, boost::shared_ptr caption); void apply (); @@ -60,7 +60,7 @@ private: std::map _pickers; boost::shared_ptr _content; - boost::shared_ptr _caption; + boost::shared_ptr _caption; boost::shared_ptr _stream; boost::signals2::scoped_connection _content_connection; diff --git a/src/wx/caption_panel.cc b/src/wx/text_panel.cc similarity index 81% rename from src/wx/caption_panel.cc rename to src/wx/text_panel.cc index 1d2f59258..bc1183443 100644 --- a/src/wx/caption_panel.cc +++ b/src/wx/text_panel.cc @@ -18,21 +18,21 @@ */ -#include "caption_panel.h" +#include "text_panel.h" #include "film_editor.h" #include "wx_util.h" -#include "caption_view.h" +#include "text_view.h" #include "content_panel.h" #include "fonts_dialog.h" -#include "caption_appearance_dialog.h" +#include "subtitle_appearance_dialog.h" #include "lib/ffmpeg_content.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/ffmpeg_subtitle_stream.h" #include "lib/dcp_subtitle_content.h" -#include "lib/text_caption_file_decoder.h" +#include "lib/string_text_file_decoder.h" #include "lib/dcp_subtitle_decoder.h" #include "lib/dcp_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/decoder_factory.h" #include #include @@ -44,7 +44,7 @@ using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; -CaptionPanel::CaptionPanel (ContentPanel* p, CaptionType t) +TextPanel::TextPanel (ContentPanel* p, TextType t) : ContentSubPanel (p, std_to_wx(caption_type_to_name(t))) , _caption_view (0) , _fonts_dialog (0) @@ -163,24 +163,24 @@ CaptionPanel::CaptionPanel (ContentPanel* p, CaptionType t) _y_scale->SetRange (10, 1000); _line_spacing->SetRange (10, 1000); - _reference->Bind (wxEVT_CHECKBOX, boost::bind (&CaptionPanel::reference_clicked, this)); - _use->Bind (wxEVT_CHECKBOX, boost::bind (&CaptionPanel::use_toggled, this)); - _type->Bind (wxEVT_CHOICE, boost::bind (&CaptionPanel::type_changed, this)); - _burn->Bind (wxEVT_CHECKBOX, boost::bind (&CaptionPanel::burn_toggled, this)); - _x_offset->Bind (wxEVT_SPINCTRL, boost::bind (&CaptionPanel::x_offset_changed, this)); - _y_offset->Bind (wxEVT_SPINCTRL, boost::bind (&CaptionPanel::y_offset_changed, this)); - _x_scale->Bind (wxEVT_SPINCTRL, boost::bind (&CaptionPanel::x_scale_changed, this)); - _y_scale->Bind (wxEVT_SPINCTRL, boost::bind (&CaptionPanel::y_scale_changed, this)); - _line_spacing->Bind (wxEVT_SPINCTRL, boost::bind (&CaptionPanel::line_spacing_changed, this)); - _language->Bind (wxEVT_TEXT, boost::bind (&CaptionPanel::language_changed, this)); - _stream->Bind (wxEVT_CHOICE, boost::bind (&CaptionPanel::stream_changed, this)); - _caption_view_button->Bind (wxEVT_BUTTON, boost::bind (&CaptionPanel::caption_view_clicked, this)); - _fonts_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&CaptionPanel::fonts_dialog_clicked, this)); - _appearance_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&CaptionPanel::appearance_dialog_clicked, this)); + _reference->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::reference_clicked, this)); + _use->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::use_toggled, this)); + _type->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::type_changed, this)); + _burn->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::burn_toggled, this)); + _x_offset->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::x_offset_changed, this)); + _y_offset->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::y_offset_changed, this)); + _x_scale->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::x_scale_changed, this)); + _y_scale->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::y_scale_changed, this)); + _line_spacing->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::line_spacing_changed, this)); + _language->Bind (wxEVT_TEXT, boost::bind (&TextPanel::language_changed, this)); + _stream->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::stream_changed, this)); + _caption_view_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::caption_view_clicked, this)); + _fonts_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::fonts_dialog_clicked, this)); + _appearance_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::appearance_dialog_clicked, this)); } void -CaptionPanel::film_changed (Film::Property property) +TextPanel::film_changed (Film::Property property) { if (property == Film::CONTENT || property == Film::REEL_TYPE) { setup_sensitivity (); @@ -188,7 +188,7 @@ CaptionPanel::film_changed (Film::Property property) } void -CaptionPanel::film_content_changed (int property) +TextPanel::film_content_changed (int property) { FFmpegContentList fc = _parent->selected_ffmpeg (); ContentList sc = _parent->selected_caption (); @@ -203,7 +203,7 @@ CaptionPanel::film_content_changed (int property) scs = sc.front (); } - shared_ptr caption; + shared_ptr caption; if (scs) { caption = scs->caption_of_original_type(_original_type); } @@ -223,10 +223,10 @@ CaptionPanel::film_content_changed (int property) } } setup_sensitivity (); - } else if (property == CaptionContentProperty::USE) { + } else if (property == TextContentProperty::USE) { checked_set (_use, caption ? caption->use() : false); setup_sensitivity (); - } else if (property == CaptionContentProperty::TYPE) { + } else if (property == TextContentProperty::TYPE) { if (caption) { switch (caption->type()) { case CAPTION_OPEN: @@ -242,19 +242,19 @@ CaptionPanel::film_content_changed (int property) _type->SetSelection (0); } setup_sensitivity (); - } else if (property == CaptionContentProperty::BURN) { + } else if (property == TextContentProperty::BURN) { checked_set (_burn, caption ? caption->burn() : false); - } else if (property == CaptionContentProperty::X_OFFSET) { + } else if (property == TextContentProperty::X_OFFSET) { checked_set (_x_offset, caption ? lrint (caption->x_offset() * 100) : 0); - } else if (property == CaptionContentProperty::Y_OFFSET) { + } else if (property == TextContentProperty::Y_OFFSET) { checked_set (_y_offset, caption ? lrint (caption->y_offset() * 100) : 0); - } else if (property == CaptionContentProperty::X_SCALE) { + } else if (property == TextContentProperty::X_SCALE) { checked_set (_x_scale, caption ? lrint (caption->x_scale() * 100) : 100); - } else if (property == CaptionContentProperty::Y_SCALE) { + } else if (property == TextContentProperty::Y_SCALE) { checked_set (_y_scale, caption ? lrint (caption->y_scale() * 100) : 100); - } else if (property == CaptionContentProperty::LINE_SPACING) { + } else if (property == TextContentProperty::LINE_SPACING) { checked_set (_line_spacing, caption ? lrint (caption->line_spacing() * 100) : 100); - } else if (property == CaptionContentProperty::LANGUAGE) { + } else if (property == TextContentProperty::LANGUAGE) { checked_set (_language, caption ? caption->language() : ""); } else if (property == DCPContentProperty::REFERENCE_CAPTION) { if (scs) { @@ -271,7 +271,7 @@ CaptionPanel::film_content_changed (int property) } void -CaptionPanel::use_toggled () +TextPanel::use_toggled () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption()) { i->caption_of_original_type(_original_type)->set_use (_use->GetValue()); @@ -279,7 +279,7 @@ CaptionPanel::use_toggled () } void -CaptionPanel::type_changed () +TextPanel::type_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption()) { switch (_type->GetSelection()) { @@ -294,7 +294,7 @@ CaptionPanel::type_changed () } void -CaptionPanel::burn_toggled () +TextPanel::burn_toggled () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption ()) { i->caption_of_original_type(_original_type)->set_burn (_burn->GetValue()); @@ -302,7 +302,7 @@ CaptionPanel::burn_toggled () } void -CaptionPanel::setup_sensitivity () +TextPanel::setup_sensitivity () { int any_subs = 0; int ffmpeg_subs = 0; @@ -310,7 +310,7 @@ CaptionPanel::setup_sensitivity () BOOST_FOREACH (shared_ptr i, sel) { /* These are the content types that could include subtitles */ shared_ptr fc = boost::dynamic_pointer_cast (i); - shared_ptr sc = boost::dynamic_pointer_cast (i); + shared_ptr sc = boost::dynamic_pointer_cast (i); shared_ptr dc = boost::dynamic_pointer_cast (i); shared_ptr dsc = boost::dynamic_pointer_cast (i); if (fc) { @@ -355,7 +355,7 @@ CaptionPanel::setup_sensitivity () } void -CaptionPanel::stream_changed () +TextPanel::stream_changed () { FFmpegContentList fc = _parent->selected_ffmpeg (); if (fc.size() != 1) { @@ -377,7 +377,7 @@ CaptionPanel::stream_changed () } void -CaptionPanel::x_offset_changed () +TextPanel::x_offset_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption ()) { i->caption_of_original_type(_original_type)->set_x_offset (_x_offset->GetValue() / 100.0); @@ -385,7 +385,7 @@ CaptionPanel::x_offset_changed () } void -CaptionPanel::y_offset_changed () +TextPanel::y_offset_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption ()) { i->caption_of_original_type(_original_type)->set_y_offset (_y_offset->GetValue() / 100.0); @@ -393,7 +393,7 @@ CaptionPanel::y_offset_changed () } void -CaptionPanel::x_scale_changed () +TextPanel::x_scale_changed () { ContentList c = _parent->selected_caption (); if (c.size() == 1) { @@ -402,7 +402,7 @@ CaptionPanel::x_scale_changed () } void -CaptionPanel::y_scale_changed () +TextPanel::y_scale_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption ()) { i->caption_of_original_type(_original_type)->set_y_scale (_y_scale->GetValue() / 100.0); @@ -410,7 +410,7 @@ CaptionPanel::y_scale_changed () } void -CaptionPanel::line_spacing_changed () +TextPanel::line_spacing_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption ()) { i->caption_of_original_type(_original_type)->set_line_spacing (_line_spacing->GetValue() / 100.0); @@ -418,7 +418,7 @@ CaptionPanel::line_spacing_changed () } void -CaptionPanel::language_changed () +TextPanel::language_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_caption ()) { i->caption_of_original_type(_original_type)->set_language (wx_to_std (_language->GetValue())); @@ -426,24 +426,24 @@ CaptionPanel::language_changed () } void -CaptionPanel::content_selection_changed () +TextPanel::content_selection_changed () { film_content_changed (FFmpegContentProperty::SUBTITLE_STREAMS); - film_content_changed (CaptionContentProperty::USE); - film_content_changed (CaptionContentProperty::BURN); - film_content_changed (CaptionContentProperty::X_OFFSET); - film_content_changed (CaptionContentProperty::Y_OFFSET); - film_content_changed (CaptionContentProperty::X_SCALE); - film_content_changed (CaptionContentProperty::Y_SCALE); - film_content_changed (CaptionContentProperty::LINE_SPACING); - film_content_changed (CaptionContentProperty::LANGUAGE); - film_content_changed (CaptionContentProperty::FONTS); - film_content_changed (CaptionContentProperty::TYPE); + film_content_changed (TextContentProperty::USE); + film_content_changed (TextContentProperty::BURN); + film_content_changed (TextContentProperty::X_OFFSET); + film_content_changed (TextContentProperty::Y_OFFSET); + film_content_changed (TextContentProperty::X_SCALE); + film_content_changed (TextContentProperty::Y_SCALE); + film_content_changed (TextContentProperty::LINE_SPACING); + film_content_changed (TextContentProperty::LANGUAGE); + film_content_changed (TextContentProperty::FONTS); + film_content_changed (TextContentProperty::TYPE); film_content_changed (DCPContentProperty::REFERENCE_CAPTION); } void -CaptionPanel::caption_view_clicked () +TextPanel::caption_view_clicked () { if (_caption_view) { _caption_view->Destroy (); @@ -456,13 +456,13 @@ CaptionPanel::caption_view_clicked () shared_ptr decoder = decoder_factory (c.front(), _parent->film()->log(), false); if (decoder) { - _caption_view = new CaptionView (this, _parent->film(), c.front(), c.front()->caption_of_original_type(_original_type), decoder, _parent->film_viewer()); + _caption_view = new TextView (this, _parent->film(), c.front(), c.front()->caption_of_original_type(_original_type), decoder, _parent->film_viewer()); _caption_view->Show (); } } void -CaptionPanel::fonts_dialog_clicked () +TextPanel::fonts_dialog_clicked () { if (_fonts_dialog) { _fonts_dialog->Destroy (); @@ -477,7 +477,7 @@ CaptionPanel::fonts_dialog_clicked () } void -CaptionPanel::reference_clicked () +TextPanel::reference_clicked () { ContentList c = _parent->selected (); if (c.size() != 1) { @@ -493,12 +493,12 @@ CaptionPanel::reference_clicked () } void -CaptionPanel::appearance_dialog_clicked () +TextPanel::appearance_dialog_clicked () { ContentList c = _parent->selected_caption (); DCPOMATIC_ASSERT (c.size() == 1); - CaptionAppearanceDialog* d = new CaptionAppearanceDialog (this, c.front(), c.front()->caption_of_original_type(_original_type)); + SubtitleAppearanceDialog* d = new SubtitleAppearanceDialog (this, c.front(), c.front()->caption_of_original_type(_original_type)); if (d->ShowModal () == wxID_OK) { d->apply (); } diff --git a/src/wx/caption_panel.h b/src/wx/text_panel.h similarity index 91% rename from src/wx/caption_panel.h rename to src/wx/text_panel.h index 20af29d7e..70d46dacd 100644 --- a/src/wx/caption_panel.h +++ b/src/wx/text_panel.h @@ -22,13 +22,13 @@ class wxCheckBox; class wxSpinCtrl; -class CaptionView; +class TextView; class FontsDialog; -class CaptionPanel : public ContentSubPanel +class TextPanel : public ContentSubPanel { public: - CaptionPanel (ContentPanel *, CaptionType t); + TextPanel (ContentPanel *, TextType t); void film_changed (Film::Property); void film_content_changed (int); @@ -65,9 +65,9 @@ private: wxTextCtrl* _language; wxChoice* _stream; wxButton* _caption_view_button; - CaptionView* _caption_view; + TextView* _caption_view; wxButton* _fonts_dialog_button; FontsDialog* _fonts_dialog; wxButton* _appearance_dialog_button; - CaptionType _original_type; + TextType _original_type; }; diff --git a/src/wx/caption_view.cc b/src/wx/text_view.cc similarity index 77% rename from src/wx/caption_view.cc rename to src/wx/text_view.cc index e6e63efff..583632dd0 100644 --- a/src/wx/caption_view.cc +++ b/src/wx/text_view.cc @@ -18,15 +18,15 @@ */ -#include "lib/text_caption_file_decoder.h" -#include "lib/content_caption.h" +#include "lib/string_text_file_decoder.h" +#include "lib/content_text.h" #include "lib/video_decoder.h" #include "lib/audio_decoder.h" #include "lib/film.h" #include "lib/config.h" -#include "lib/text_caption_file_content.h" -#include "lib/caption_decoder.h" -#include "caption_view.h" +#include "lib/string_text_file_content.h" +#include "lib/text_decoder.h" +#include "text_view.h" #include "film_viewer.h" #include "wx_util.h" @@ -35,7 +35,7 @@ using boost::shared_ptr; using boost::bind; using boost::dynamic_pointer_cast; -CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptr content, shared_ptr caption, shared_ptr decoder, FilmViewer* viewer) +TextView::TextView (wxWindow* parent, shared_ptr film, shared_ptr content, shared_ptr caption, shared_ptr decoder, FilmViewer* viewer) : wxDialog (parent, wxID_ANY, _("Captions"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , _content (content) , _film_viewer (viewer) @@ -69,7 +69,7 @@ CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptrAdd (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP); - _list->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&CaptionView::subtitle_selected, this, _1)); + _list->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&TextView::subtitle_selected, this, _1)); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); if (buttons) { @@ -86,11 +86,11 @@ CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptractive_frame_rate_change (content->position()); - /* Find the decoder that is being used for our CaptionContent and attach to it */ - BOOST_FOREACH (shared_ptr i, decoder->caption) { + /* Find the decoder that is being used for our TextContent and attach to it */ + BOOST_FOREACH (shared_ptr i, decoder->caption) { if (i->content() == caption) { - i->PlainStart.connect (bind (&CaptionView::data_start, this, _1)); - i->Stop.connect (bind (&CaptionView::data_stop, this, _1)); + i->PlainStart.connect (bind (&TextView::data_start, this, _1)); + i->Stop.connect (bind (&TextView::data_stop, this, _1)); } } while (!decoder->pass ()) {} @@ -98,7 +98,7 @@ CaptionView::CaptionView (wxWindow* parent, shared_ptr film, shared_ptrjump_to_selected ()) { return; diff --git a/src/wx/caption_view.h b/src/wx/text_view.h similarity index 84% rename from src/wx/caption_view.h rename to src/wx/text_view.h index 71c492ad6..8cec8d284 100644 --- a/src/wx/caption_view.h +++ b/src/wx/text_view.h @@ -18,7 +18,7 @@ */ -#include "lib/content_caption.h" +#include "lib/content_text.h" #include #include #include @@ -26,15 +26,15 @@ class Decoder; class FilmViewer; -class CaptionView : public wxDialog +class TextView : public wxDialog { public: - CaptionView ( - wxWindow *, boost::shared_ptr, boost::shared_ptr content, boost::shared_ptr caption, boost::shared_ptr, FilmViewer* viewer + TextView ( + wxWindow *, boost::shared_ptr, boost::shared_ptr content, boost::shared_ptr caption, boost::shared_ptr, FilmViewer* viewer ); private: - void data_start (ContentTextCaption cts); + void data_start (ContentStringText cts); void data_stop (ContentTime time); void subtitle_selected (wxListEvent &); diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index f7a31117b..b0a3a7247 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -34,7 +34,7 @@ #include "lib/image_content.h" #include "lib/timer.h" #include "lib/audio_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/video_content.h" #include "lib/atmos_mxf_content.h" #include @@ -228,7 +228,7 @@ Timeline::recreate_views () _views.push_back (shared_ptr (new TimelineAudioContentView (*this, i))); } - BOOST_FOREACH (shared_ptr j, i->caption) { + BOOST_FOREACH (shared_ptr j, i->caption) { _views.push_back (shared_ptr (new TimelineTextContentView (*this, i, j))); } diff --git a/src/wx/timeline_text_content_view.cc b/src/wx/timeline_text_content_view.cc index 30158941c..934bf1fc4 100644 --- a/src/wx/timeline_text_content_view.cc +++ b/src/wx/timeline_text_content_view.cc @@ -19,12 +19,12 @@ */ #include "timeline_text_content_view.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/content.h" using boost::shared_ptr; -TimelineTextContentView::TimelineTextContentView (Timeline& tl, shared_ptr c, shared_ptr caption) +TimelineTextContentView::TimelineTextContentView (Timeline& tl, shared_ptr c, shared_ptr caption) : TimelineContentView (tl, c) , _caption (caption) { diff --git a/src/wx/timeline_text_content_view.h b/src/wx/timeline_text_content_view.h index 4f69f2aef..055c84143 100644 --- a/src/wx/timeline_text_content_view.h +++ b/src/wx/timeline_text_content_view.h @@ -21,7 +21,7 @@ #include "timeline_content_view.h" class TextContent; -class CaptionContent; +class TextContent; /** @class TimelineTextContentView * @brief Timeline view for TextContent. @@ -29,12 +29,12 @@ class CaptionContent; class TimelineTextContentView : public TimelineContentView { public: - TimelineTextContentView (Timeline& tl, boost::shared_ptr, boost::shared_ptr); + TimelineTextContentView (Timeline& tl, boost::shared_ptr, boost::shared_ptr); private: bool active () const; wxColour background_colour () const; wxColour foreground_colour () const; - boost::shared_ptr _caption; + boost::shared_ptr _caption; }; diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 9bb608cb2..bf987e51e 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -26,10 +26,10 @@ #include "move_to_dialog.h" #include "lib/content.h" #include "lib/image_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/dcp_subtitle_content.h" #include "lib/audio_content.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/video_content.h" #include #include diff --git a/src/wx/wscript b/src/wx/wscript index 5668a7558..0a32d1dfe 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -32,9 +32,9 @@ sources = """ audio_panel.cc audio_plot.cc batch_job_view.cc - caption_appearance_dialog.cc - caption_panel.cc - caption_view.cc + subtitle_appearance_dialog.cc + text_panel.cc + text_view.cc cinema_dialog.cc colour_conversion_editor.cc config_dialog.cc diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index 8ca436207..40dac6756 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new TextCaption (film, "test/data/subrip2.srt")); + shared_ptr content (new StringText (film, "test/data/subrip2.srt")); content->subtitle->set_use (true); content->subtitle->set_burn (true); film->examine_and_add_content (content); @@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp) film2->set_name ("frobozz"); shared_ptr background_dcp (new DCPContent(film2, film->dir(film->dcp_name()))); film2->examine_and_add_content (background_dcp); - shared_ptr sub = dynamic_pointer_cast ( + shared_ptr sub = dynamic_pointer_cast ( content_factory(film2, "test/data/subrip2.srt").front() ); sub->subtitle->set_burn (true); diff --git a/test/closed_caption_test.cc b/test/closed_caption_test.cc index 75768eca8..8cceec483 100644 --- a/test/closed_caption_test.cc +++ b/test/closed_caption_test.cc @@ -19,8 +19,8 @@ */ #include "lib/film.h" -#include "lib/caption_content.h" -#include "lib/text_caption_file_content.h" +#include "lib/text_content.h" +#include "lib/string_text_file_content.h" #include "test.h" #include #include @@ -33,7 +33,7 @@ using boost::shared_ptr; BOOST_AUTO_TEST_CASE (closed_caption_test1) { shared_ptr film = new_test_film2 ("closed_caption_test1"); - shared_ptr content (new TextCaptionFileContent (film, "test/data/subrip.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 3d4b57e3c..2dbf43b2a 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -31,10 +31,10 @@ #include "lib/dcp_decoder.h" #include "lib/dcp_content_type.h" #include "lib/dcp_subtitle_decoder.h" -#include "lib/caption_content.h" -#include "lib/content_caption.h" +#include "lib/text_content.h" +#include "lib/content_text.h" #include "lib/font.h" -#include "lib/caption_decoder.h" +#include "lib/text_decoder.h" #include "test.h" #include @@ -43,10 +43,10 @@ using std::list; using boost::shared_ptr; using boost::optional; -optional stored; +optional stored; static void -store (ContentTextCaption sub) +store (ContentStringText sub) { if (!stored) { stored = sub; @@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test) shared_ptr decoder (new DCPDecoder (content, film->log(), false)); decoder->only_caption()->PlainStart.connect (bind (store, _1)); - stored = optional (); + stored = optional (); while (!decoder->pass() && !stored) {} BOOST_REQUIRE (stored); @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2) shared_ptr decoder (new DCPSubtitleDecoder (content, film->log())); decoder->only_caption()->PlainStart.connect (bind (store, _1)); - stored = optional (); + stored = optional (); while (!decoder->pass ()) { if (stored && stored->from() == ContentTime(0)) { BOOST_CHECK_EQUAL (stored->subs.front().text(), "<b>Hello world!</b>"); @@ -140,7 +140,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3) BOOST_REQUIRE (!wait_for_jobs ()); shared_ptr decoder (new DCPSubtitleDecoder (content, film->log())); - stored = optional (); + stored = optional (); while (!decoder->pass ()) { decoder->only_caption()->PlainStart.connect (bind (store, _1)); if (stored && stored->from() == ContentTime::from_seconds(0.08)) { diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index 837541f9d..d1d07e28c 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -24,11 +24,11 @@ #include "lib/image_content.h" #include "lib/video_content.h" #include "lib/audio_content.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/ratio.h" #include "lib/transcode_job.h" #include "lib/dcp_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/compose.hpp" #include "test.h" #include @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6) film->set_container (Ratio::from_id ("185")); film->set_audio_channels (6); - shared_ptr s (new TextCaptionFileContent (film, "test/data/subrip2.srt")); + shared_ptr s (new StringTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_caption()->set_colour (dcp::Colour (255, 255, 0)); @@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7) film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr s (new TextCaptionFileContent (film, "test/data/subrip.srt")); + shared_ptr s (new StringTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_caption()->set_colour (dcp::Colour (255, 255, 0)); @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2) film->set_container (Ratio::from_id ("185")); film->set_audio_channels (6); - shared_ptr s (new TextCaptionFileContent (film, "test/data/subrip2.srt")); + shared_ptr s (new StringTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_caption()->set_colour (dcp::Colour (255, 255, 0)); @@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3) film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr s (new TextCaptionFileContent (film, "test/data/subrip.srt")); + shared_ptr s (new StringTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); s->only_caption()->set_colour (dcp::Colour (255, 255, 0)); diff --git a/test/player_test.cc b/test/player_test.cc index 041bc3e81..b86a94403 100644 --- a/test/player_test.cc +++ b/test/player_test.cc @@ -31,10 +31,10 @@ #include "lib/player.h" #include "lib/video_content.h" #include "lib/image_content.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/content_factory.h" #include "lib/dcp_content.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/butler.h" #include "lib/compose.hpp" #include "test.h" @@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE (player_interleave_test) film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr s (new TextCaptionFileContent (film, "test/data/subrip.srt")); + shared_ptr s (new StringTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (s); BOOST_REQUIRE (!wait_for_jobs ()); diff --git a/test/reels_test.cc b/test/reels_test.cc index a408402c9..76dbb61ed 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -30,7 +30,7 @@ #include "lib/dcp_content_type.h" #include "lib/dcp_content.h" #include "lib/video_content.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/content_factory.h" #include "test.h" #include @@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE (reels_test3) shared_ptr dcp (new DCPContent (film, "test/data/reels_test2")); film->examine_and_add_content (dcp); - shared_ptr sub (new TextCaptionFileContent (film, "test/data/subrip.srt")); + shared_ptr sub (new StringTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (sub); wait_for_jobs (); @@ -206,7 +206,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) content[i]->video->set_length (24); } - shared_ptr subs (new TextCaptionFileContent (film, "test/data/subrip3.srt")); + shared_ptr subs (new StringTextFileContent (film, "test/data/subrip3.srt")); film->examine_and_add_content (subs); wait_for_jobs (); diff --git a/test/remake_id_test.cc b/test/remake_id_test.cc index 79e12f7a0..e7e9c67b2 100644 --- a/test/remake_id_test.cc +++ b/test/remake_id_test.cc @@ -20,7 +20,7 @@ #include "lib/ffmpeg_content.h" #include "lib/content_factory.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/job_manager.h" #include "lib/film.h" #include "lib/dcp_content.h" diff --git a/test/remake_with_subtitle_test.cc b/test/remake_with_subtitle_test.cc index bef1bc36a..61cf0187f 100644 --- a/test/remake_with_subtitle_test.cc +++ b/test/remake_with_subtitle_test.cc @@ -20,7 +20,7 @@ #include "lib/ffmpeg_content.h" #include "lib/content_factory.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/film.h" #include "test.h" #include diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 5b3136497..68b192007 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -28,10 +28,10 @@ #include static void -add (std::list& s, std::string text, bool italic, bool bold, bool underline) +add (std::list& s, std::string text, bool italic, bool bold, bool underline) { s.push_back ( - TextCaption ( + StringText ( dcp::SubtitleString ( boost::optional (), italic, @@ -60,7 +60,7 @@ add (std::list& s, std::string text, bool italic, bool bold, bool u /** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test1) { - std::list s; + std::list s; add (s, "Hello", false, false, false); BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } @@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test1) /** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test2) { - std::list s; + std::list s; add (s, "Hello", false, true, false); BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test2) /** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test3) { - std::list s; + std::list s; add (s, "Hello", true, true, false); BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } @@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test3) /** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test4) { - std::list s; + std::list s; add (s, "Hello", true, true, true); BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } @@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test4) /** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test5) { - std::list s; + std::list s; add (s, "Hello", false, true, false); add (s, " world.", false, false, false); BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello world."); @@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test5) /** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test6) { - std::list s; + std::list s; add (s, "Hello", true, false, false); add (s, " world ", false, false, false); add (s, "we are bold.", false, true, false); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 6975403ba..eb7918914 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -24,11 +24,11 @@ */ #include "lib/film.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/dcp_content_type.h" #include "lib/font.h" #include "lib/ratio.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "test.h" #include #include @@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test) film->set_name ("frobozz"); film->set_audio_channels (6); film->set_interop (false); - shared_ptr content (new TextCaptionFileContent (film, "test/data/subrip2.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2) film->set_name ("frobozz"); film->set_audio_channels (6); film->set_interop (false); - shared_ptr content (new TextCaptionFileContent (film, "test/data/subrip2.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3) film->set_name ("frobozz"); film->set_interop (true); film->set_audio_channels (6); - shared_ptr content (new TextCaptionFileContent (film, private_data / "Ankoemmling_short.srt")); + shared_ptr content (new StringTextFileContent (film, private_data / "Ankoemmling_short.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test4) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (false); - shared_ptr content (new TextCaptionFileContent (film, "test/data/subrip2.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/subrip2.srt")); content->only_caption()->set_use (true); content->only_caption()->set_burn (false); film->examine_and_add_content (content); @@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test5) film->set_name ("frobozz"); film->set_interop (true); film->set_sequence (false); - shared_ptr content (new TextCaptionFileContent (film, "test/data/subrip2.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/subrip2.srt")); content->only_caption()->set_use (true); content->only_caption()->set_burn (false); film->examine_and_add_content (content); @@ -164,7 +164,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6) { shared_ptr film = new_test_film2 ("srt_subtitle_test6"); film->set_interop (false); - shared_ptr content (new TextCaptionFileContent (film, "test/data/frames.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/frames.srt")); content->only_caption()->set_use (true); content->only_caption()->set_burn (false); film->examine_and_add_content (content); @@ -185,12 +185,12 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6) BOOST_AUTO_TEST_CASE (srt_subtitle_test4) { shared_ptr film = new_test_film ("subrip_render_test"); - shared_ptr content (new TextCaptionFile (film, "test/data/subrip.srt")); + shared_ptr content (new StringTextFile (film, "test/data/subrip.srt")); content->examine (shared_ptr (), true); BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471)); shared_ptr decoder (new SubRipDecoder (content)); - list cts = decoder->get_plain_texts ( + list cts = decoder->get_plain_texts ( ContentTimePeriod ( ContentTime::from_seconds (109), ContentTime::from_seconds (110) ), false diff --git a/test/ssa_subtitle_test.cc b/test/ssa_subtitle_test.cc index 57813b944..5a6eaaa68 100644 --- a/test/ssa_subtitle_test.cc +++ b/test/ssa_subtitle_test.cc @@ -24,11 +24,11 @@ */ #include "lib/film.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/dcp_content_type.h" #include "lib/font.h" #include "lib/ratio.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "test.h" #include #include @@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (true); - shared_ptr content (new TextCaptionFileContent (film, private_data / "DKH_UT_EN20160601def.ssa")); + shared_ptr content (new StringTextFileContent (film, private_data / "DKH_UT_EN20160601def.ssa")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/subtitle_charset_test.cc b/test/subtitle_charset_test.cc index 3c2407f7e..9c61b83f4 100644 --- a/test/subtitle_charset_test.cc +++ b/test/subtitle_charset_test.cc @@ -22,8 +22,8 @@ #include "lib/content.h" #include "lib/film.h" #include "lib/content_factory.h" -#include "lib/text_caption_file.h" -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file.h" +#include "lib/string_text_file_content.h" #include using boost::shared_ptr; @@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (subtitle_charset_test2) shared_ptr content = content_factory (film, "test/data/osx.srt").front (); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr ts = dynamic_pointer_cast (content); + shared_ptr ts = dynamic_pointer_cast (content); BOOST_REQUIRE (ts); /* Make sure we got the subtitle data from the file */ BOOST_REQUIRE_EQUAL (content->full_length().get(), 6052032); diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc index 7cb184477..d78cb63d7 100644 --- a/test/subtitle_reel_number_test.cc +++ b/test/subtitle_reel_number_test.cc @@ -18,10 +18,10 @@ */ -#include "lib/text_caption_file_content.h" +#include "lib/string_text_file_content.h" #include "lib/film.h" #include "lib/ratio.h" -#include "lib/caption_content.h" +#include "lib/text_content.h" #include "lib/dcp_content_type.h" #include "test.h" #include @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new TextCaptionFileContent (film, "test/data/subrip5.srt")); + shared_ptr content (new StringTextFileContent (film, "test/data/subrip5.srt")); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); content->only_caption()->set_use (true); -- 2.30.2