summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-23 11:20:12 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-23 11:20:12 +0100
commitdf17bbd25da69fc38eb2dcd8b4a2531cf0bab0bc (patch)
tree04e6f5917ed3c2e8ea45904ff0235c08d29a6446
parent6f146336b73fe720c83cb75ebdf15e9cb9c02973 (diff)
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
-rw-r--r--hacks/rename44
-rw-r--r--src/lib/active_text.cc (renamed from src/lib/active_captions.cc)36
-rw-r--r--src/lib/active_text.h (renamed from src/lib/active_captions.h)28
-rw-r--r--src/lib/bitmap_text.h (renamed from src/lib/bitmap_caption.h)4
-rw-r--r--src/lib/content.cc18
-rw-r--r--src/lib/content.h6
-rw-r--r--src/lib/content_factory.cc6
-rw-r--r--src/lib/content_text.h (renamed from src/lib/content_caption.h)24
-rw-r--r--src/lib/dcp_content.cc16
-rw-r--r--src/lib/dcp_content.h6
-rw-r--r--src/lib/dcp_decoder.cc10
-rw-r--r--src/lib/dcp_decoder.h2
-rw-r--r--src/lib/dcp_encoder.cc6
-rw-r--r--src/lib/dcp_encoder.h4
-rw-r--r--src/lib/dcp_examiner.h2
-rw-r--r--src/lib/dcp_subtitle_content.cc6
-rw-r--r--src/lib/dcp_subtitle_decoder.cc4
-rw-r--r--src/lib/dcp_subtitle_decoder.h2
-rw-r--r--src/lib/decoder.cc10
-rw-r--r--src/lib/decoder.h6
-rw-r--r--src/lib/decoder_factory.cc8
-rw-r--r--src/lib/encoder.h2
-rw-r--r--src/lib/ffmpeg_content.cc8
-rw-r--r--src/lib/ffmpeg_decoder.cc6
-rw-r--r--src/lib/ffmpeg_encoder.cc2
-rw-r--r--src/lib/ffmpeg_encoder.h2
-rw-r--r--src/lib/film.cc10
-rw-r--r--src/lib/hints.cc4
-rw-r--r--src/lib/player.cc72
-rw-r--r--src/lib/player.h20
-rw-r--r--src/lib/player_text.cc (renamed from src/lib/player_caption.cc)4
-rw-r--r--src/lib/player_text.h (renamed from src/lib/player_caption.h)12
-rw-r--r--src/lib/playlist.cc4
-rw-r--r--src/lib/reel_writer.cc6
-rw-r--r--src/lib/reel_writer.h4
-rw-r--r--src/lib/render_text.cc12
-rw-r--r--src/lib/render_text.h6
-rw-r--r--src/lib/string_text.h (renamed from src/lib/text_caption.h)6
-rw-r--r--src/lib/string_text_file.cc (renamed from src/lib/text_caption_file.cc)10
-rw-r--r--src/lib/string_text_file.h (renamed from src/lib/text_caption_file.h)12
-rw-r--r--src/lib/string_text_file_content.cc (renamed from src/lib/text_caption_file_content.cc)26
-rw-r--r--src/lib/string_text_file_content.h (renamed from src/lib/text_caption_file_content.h)12
-rw-r--r--src/lib/string_text_file_decoder.cc (renamed from src/lib/text_caption_file_decoder.cc)20
-rw-r--r--src/lib/string_text_file_decoder.h (renamed from src/lib/text_caption_file_decoder.h)8
-rw-r--r--src/lib/text_content.cc (renamed from src/lib/caption_content.cc)164
-rw-r--r--src/lib/text_content.h (renamed from src/lib/caption_content.h)26
-rw-r--r--src/lib/text_decoder.cc (renamed from src/lib/caption_decoder.cc)26
-rw-r--r--src/lib/text_decoder.h (renamed from src/lib/caption_decoder.h)18
-rw-r--r--src/lib/types.cc6
-rw-r--r--src/lib/types.h10
-rw-r--r--src/lib/writer.cc2
-rw-r--r--src/lib/writer.h4
-rw-r--r--src/lib/wscript14
-rw-r--r--src/tools/dcpomatic.cc6
-rw-r--r--src/tools/dcpomatic_player.cc4
-rw-r--r--src/wx/closed_captions_dialog.cc14
-rw-r--r--src/wx/content_panel.cc16
-rw-r--r--src/wx/content_panel.h4
-rw-r--r--src/wx/dcp_panel.cc6
-rw-r--r--src/wx/film_viewer.h2
-rw-r--r--src/wx/fonts_dialog.cc8
-rw-r--r--src/wx/fonts_dialog.h6
-rw-r--r--src/wx/subtitle_appearance_dialog.cc (renamed from src/wx/caption_appearance_dialog.cc)38
-rw-r--r--src/wx/subtitle_appearance_dialog.h (renamed from src/wx/caption_appearance_dialog.h)6
-rw-r--r--src/wx/text_panel.cc (renamed from src/wx/caption_panel.cc)124
-rw-r--r--src/wx/text_panel.h (renamed from src/wx/caption_panel.h)10
-rw-r--r--src/wx/text_view.cc (renamed from src/wx/caption_view.cc)28
-rw-r--r--src/wx/text_view.h (renamed from src/wx/caption_view.h)10
-rw-r--r--src/wx/timeline.cc4
-rw-r--r--src/wx/timeline_text_content_view.cc4
-rw-r--r--src/wx/timeline_text_content_view.h6
-rw-r--r--src/wx/timing_panel.cc4
-rw-r--r--src/wx/wscript6
-rw-r--r--test/burnt_subtitle_test.cc4
-rw-r--r--test/closed_caption_test.cc6
-rw-r--r--test/dcp_subtitle_test.cc16
-rw-r--r--test/ffmpeg_encoder_test.cc12
-rw-r--r--test/player_test.cc6
-rw-r--r--test/reels_test.cc6
-rw-r--r--test/remake_id_test.cc2
-rw-r--r--test/remake_with_subtitle_test.cc2
-rw-r--r--test/render_subtitles_test.cc16
-rw-r--r--test/srt_subtitle_test.cc20
-rw-r--r--test/ssa_subtitle_test.cc6
-rw-r--r--test/subtitle_charset_test.cc6
-rw-r--r--test/subtitle_reel_number_test.cc6
86 files changed, 622 insertions, 578 deletions
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
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 <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
@@ -31,7 +31,7 @@ using boost::shared_ptr;
using boost::optional;
void
-ActiveCaptions::add (DCPTimePeriod period, list<PlayerCaption>& pc, list<Period> p) const
+ActiveText::add (DCPTimePeriod period, list<PlayerText>& pc, list<Period> 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<PlayerCaption>& pc, list<Period>
}
}
-list<PlayerCaption>
-ActiveCaptions::get (DCPTimePeriod period) const
+list<PlayerText>
+ActiveText::get (DCPTimePeriod period) const
{
- list<PlayerCaption> ps;
+ list<PlayerText> ps;
for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) {
- shared_ptr<const CaptionContent> caption = i->first.lock ();
+ shared_ptr<const TextContent> 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<PlayerCaption>
-ActiveCaptions::get_burnt (DCPTimePeriod period, bool always_burn_captions) const
+list<PlayerText>
+ActiveText::get_burnt (DCPTimePeriod period, bool always_burn_captions) const
{
- list<PlayerCaption> ps;
+ list<PlayerText> ps;
for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) {
- shared_ptr<const CaptionContent> caption = i->first.lock ();
+ shared_ptr<const TextContent> 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<const CaptionContent> content, PlayerCaption ps, DCPTime from)
+ActiveText::add_from (weak_ptr<const TextContent> content, PlayerText ps, DCPTime from)
{
if (_data.find(content) == _data.end()) {
_data[content] = list<Period>();
@@ -127,14 +127,14 @@ ActiveCaptions::add_from (weak_ptr<const CaptionContent> 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<PlayerCaption, DCPTime>
-ActiveCaptions::add_to (weak_ptr<const CaptionContent> content, DCPTime to)
+pair<PlayerText, DCPTime>
+ActiveText::add_to (weak_ptr<const TextContent> 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<const CaptionContent> content, DCPTime to)
* @return true if we have any active subtitles from this content.
*/
bool
-ActiveCaptions::have (weak_ptr<const CaptionContent> content) const
+ActiveText::have (weak_ptr<const TextContent> content) const
{
Map::const_iterator i = _data.find(content);
if (i == _data.end()) {
@@ -156,7 +156,7 @@ ActiveCaptions::have (weak_ptr<const CaptionContent> content) const
}
void
-ActiveCaptions::clear ()
+ActiveText::clear ()
{
_data.clear ();
}
diff --git a/src/lib/active_captions.h b/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 <boost/noncopyable.hpp>
#include <list>
#include <map>
-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<PlayerCaption> get (DCPTimePeriod period) const;
- std::list<PlayerCaption> get_burnt (DCPTimePeriod period, bool always_burn_captions) const;
+ std::list<PlayerText> get (DCPTimePeriod period) const;
+ std::list<PlayerText> get_burnt (DCPTimePeriod period, bool always_burn_captions) const;
void clear_before (DCPTime time);
void clear ();
- void add_from (boost::weak_ptr<const CaptionContent> content, PlayerCaption ps, DCPTime from);
- std::pair<PlayerCaption, DCPTime> add_to (boost::weak_ptr<const CaptionContent> content, DCPTime to);
- bool have (boost::weak_ptr<const CaptionContent> content) const;
+ void add_from (boost::weak_ptr<const TextContent> content, PlayerText ps, DCPTime from);
+ std::pair<PlayerText, DCPTime> add_to (boost::weak_ptr<const TextContent> content, DCPTime to);
+ bool have (boost::weak_ptr<const TextContent> 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<DCPTime> to;
};
- typedef std::map<boost::weak_ptr<const CaptionContent>, std::list<Period> > Map;
+ typedef std::map<boost::weak_ptr<const TextContent>, std::list<Period> > Map;
- void add (DCPTimePeriod period, std::list<PlayerCaption>& pc, std::list<Period> p) const;
+ void add (DCPTimePeriod period, std::list<PlayerText>& pc, std::list<Period> p) const;
Map _data;
};
diff --git a/src/lib/bitmap_caption.h b/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<Image> i, dcpomatic::Rect<double> r)
+ BitmapText (boost::shared_ptr<Image> i, dcpomatic::Rect<double> 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<const Content> c)
audio->take_settings_from (c->audio);
}
- list<shared_ptr<CaptionContent> >::iterator i = caption.begin ();
- list<shared_ptr<CaptionContent> >::const_iterator j = c->caption.begin ();
+ list<shared_ptr<TextContent> >::iterator i = caption.begin ();
+ list<shared_ptr<TextContent> >::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<const Content> c)
}
}
-shared_ptr<CaptionContent>
+shared_ptr<TextContent>
Content::only_caption () const
{
DCPOMATIC_ASSERT (caption.size() < 2);
if (caption.empty ()) {
- return shared_ptr<CaptionContent> ();
+ return shared_ptr<TextContent> ();
}
return caption.front ();
}
-shared_ptr<CaptionContent>
-Content::caption_of_original_type (CaptionType type) const
+shared_ptr<TextContent>
+Content::caption_of_original_type (TextType type) const
{
- BOOST_FOREACH (shared_ptr<CaptionContent> i, caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> i, caption) {
if (i->original_type() == type) {
return i;
}
}
- return shared_ptr<CaptionContent> ();
+ return shared_ptr<TextContent> ();
}
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<VideoContent> video;
boost::shared_ptr<AudioContent> audio;
- std::list<boost::shared_ptr<CaptionContent> > caption;
+ std::list<boost::shared_ptr<TextContent> > caption;
- boost::shared_ptr<CaptionContent> only_caption () const;
- boost::shared_ptr<CaptionContent> caption_of_original_type (CaptionType type) const;
+ boost::shared_ptr<TextContent> only_caption () const;
+ boost::shared_ptr<TextContent> 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<const Film> 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<const Film> 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
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 <dcp/subtitle_string.h>
#include <list>
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<Image> im, dcpomatic::Rect<double> r)
- : ContentCaption (f, type)
+ ContentBitmapText (ContentTime f, TextType type, boost::shared_ptr<Image> im, dcpomatic::Rect<double> 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<dcp::SubtitleString> s)
- : ContentCaption (f, type)
+ ContentStringText (ContentTime f, TextType type, std::list<dcp::SubtitleString> 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 <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
@@ -84,7 +84,7 @@ DCPContent::DCPContent (shared_ptr<const Film> 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> job)
boost::mutex::scoped_lock lm (_mutex);
_name = examiner->name ();
for (int i = 0; i < CAPTION_COUNT; ++i) {
- if (examiner->has_caption(static_cast<CaptionType>(i))) {
- caption.push_back (shared_ptr<CaptionContent>(new CaptionContent(this, static_cast<CaptionType>(i))));
+ if (examiner->has_caption(static_cast<TextType>(i))) {
+ caption.push_back (shared_ptr<TextContent>(new TextContent(this, static_cast<TextType>(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<CaptionContent> i, caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> i, caption) {
i->as_xml (node);
}
@@ -323,7 +323,7 @@ DCPContent::identifier () const
s += video->identifier() + "_";
}
- BOOST_FOREACH (shared_ptr<CaptionContent> i, caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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<const Content> 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<DCPDecoder> 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 <dcp/dcp.h>
@@ -63,9 +63,9 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log, boo
if (c->audio) {
audio.reset (new AudioDecoder (this, c->audio, log, fast));
}
- BOOST_FOREACH (shared_ptr<CaptionContent> i, c->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> i, c->caption) {
/* XXX: this time here should be the time of the first subtitle, not 0 */
- caption.push_back (shared_ptr<CaptionDecoder> (new CaptionDecoder (this, i, log, ContentTime())));
+ caption.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, i, log, ContentTime())));
}
list<shared_ptr<dcp::CPL> > cpl_list = cpls ();
@@ -193,7 +193,7 @@ DCPDecoder::pass ()
void
DCPDecoder::pass_captions (ContentTime next)
{
- list<shared_ptr<CaptionDecoder> >::const_iterator decoder = caption.begin ();
+ list<shared_ptr<TextDecoder> >::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<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, shared_ptr<CaptionDecoder> decoder)
+DCPDecoder::pass_captions (ContentTime next, shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> 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<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, boost::shared_ptr<CaptionDecoder> decoder);
+ void pass_captions (ContentTime next, boost::shared_ptr<dcp::SubtitleAsset> asset, bool reference, int64_t entry_point, boost::shared_ptr<TextDecoder> 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 <boost/signals2.hpp>
#include <boost/foreach.hpp>
@@ -64,7 +64,7 @@ DCPEncoder::DCPEncoder (shared_ptr<const Film> film, weak_ptr<Job> job)
_player_caption_connection = _player->Caption.connect (bind (&DCPEncoder::caption, this, _1, _2, _3));
BOOST_FOREACH (shared_ptr<const Content> c, film->content ()) {
- BOOST_FOREACH (shared_ptr<CaptionContent> i, c->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> i, c->caption) {
if (i->use() && !i->burn()) {
_non_burnt_subtitles = true;
}
@@ -143,7 +143,7 @@ DCPEncoder::audio (shared_ptr<AudioBuffers> 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 <boost/weak_ptr.hpp>
@@ -52,7 +52,7 @@ private:
void video (boost::shared_ptr<PlayerVideo>, DCPTime);
void audio (boost::shared_ptr<AudioBuffers>, DCPTime);
- void caption (PlayerCaption, CaptionType, DCPTimePeriod);
+ void caption (PlayerText, TextType, DCPTimePeriod);
boost::shared_ptr<Writer> _writer;
boost::shared_ptr<J2KEncoder> _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 <dcp/raw_convert.h>
#include <dcp/interop_subtitle_asset.h>
#include <dcp/smpte_subtitle_asset.h>
@@ -40,14 +40,14 @@ using dcp::raw_convert;
DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, boost::filesystem::path path)
: Content (film, path)
{
- caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, CAPTION_OPEN)));
+ caption.push_back (shared_ptr<TextContent> (new TextContent (this, CAPTION_OPEN)));
}
DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
: Content (film, node)
, _length (node->number_child<ContentTime::Type> ("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<const DCPSubtitleContent> con
if (_next != _subtitles.end()) {
first = content_time_period(*_next).from;
}
- caption.push_back (shared_ptr<CaptionDecoder> (new CaptionDecoder (this, content->only_caption(), log, first)));
+ caption.push_back (shared_ptr<TextDecoder> (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 <boost/optional.hpp>
#include <iostream>
@@ -43,7 +43,7 @@ Decoder::position () const
pos = audio->position();
}
- BOOST_FOREACH (shared_ptr<CaptionDecoder> i, caption) {
+ BOOST_FOREACH (shared_ptr<TextDecoder> 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<CaptionDecoder> i, caption) {
+ BOOST_FOREACH (shared_ptr<TextDecoder> i, caption) {
i->seek ();
}
}
-shared_ptr<CaptionDecoder>
+shared_ptr<TextDecoder>
Decoder::only_caption () const
{
DCPOMATIC_ASSERT (caption.size() < 2);
if (caption.empty ()) {
- return shared_ptr<CaptionDecoder> ();
+ return shared_ptr<TextDecoder> ();
}
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<VideoDecoder> video;
boost::shared_ptr<AudioDecoder> audio;
- std::list<boost::shared_ptr<CaptionDecoder> > caption;
+ std::list<boost::shared_ptr<TextDecoder> > caption;
- boost::shared_ptr<CaptionDecoder> only_caption () const;
+ boost::shared_ptr<TextDecoder> 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<const Content> content, shared_ptr<Log> log, bool fa
return shared_ptr<Decoder> (new ImageDecoder (ic, log));
}
- shared_ptr<const TextCaptionFileContent> rc = dynamic_pointer_cast<const TextCaptionFileContent> (content);
+ shared_ptr<const StringTextFileContent> rc = dynamic_pointer_cast<const StringTextFileContent> (content);
if (rc) {
- return shared_ptr<Decoder> (new TextCaptionFileDecoder (rc, log));
+ return shared_ptr<Decoder> (new StringTextFileDecoder (rc, log));
}
shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (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 <boost/weak_ptr.hpp>
#include <boost/signals2.hpp>
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 <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
@@ -85,7 +85,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> 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<cxml::NodePtr> c = node->node_children ("SubtitleStream");
for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
@@ -163,7 +163,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
audio.reset (new AudioContent (this, c));
}
if (need_caption) {
- caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, c)));
+ caption.push_back (shared_ptr<TextContent> (new TextContent (this, c)));
}
shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
@@ -304,7 +304,7 @@ FFmpegContent::examine (shared_ptr<Job> job)
_subtitle_streams = examiner->subtitle_streams ();
if (!_subtitle_streams.empty ()) {
caption.clear ();
- caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, CAPTION_OPEN)));
+ caption.push_back (shared_ptr<TextContent> (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 <dcp/subtitle_string.h>
#include <sub/ssa_reader.h>
@@ -99,7 +99,7 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log>
if (c->only_caption()) {
/* XXX: this time here should be the time of the first subtitle, not 0 */
- caption.push_back (shared_ptr<CaptionDecoder> (new CaptionDecoder (this, c->only_caption(), log, ContentTime())));
+ caption.push_back (shared_ptr<TextDecoder> (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<PlayerVideo>, DCPTime);
void audio (boost::shared_ptr<AudioBuffers>);
- 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<Content> i, content()) {
- BOOST_FOREACH (shared_ptr<CaptionContent> j, i->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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<CaptionType>(i))) {
+ if (dc->reference_caption(static_cast<TextType>(i))) {
any_caption = true;
}
}
@@ -1391,7 +1391,7 @@ Film::subtitle_language () const
set<string> languages;
BOOST_FOREACH (shared_ptr<Content> i, content()) {
- BOOST_FOREACH (shared_ptr<CaptionContent> j, i->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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<const Film> film)
bool big_font_files = false;
if (film->interop ()) {
BOOST_FOREACH (shared_ptr<Content> i, content) {
- BOOST_FOREACH (shared_ptr<CaptionContent> j, i->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->caption) {
BOOST_FOREACH (shared_ptr<Font> k, j->fonts()) {
for (int l = 0; l < FontFiles::VARIANTS; ++l) {
optional<boost::filesystem::path> const p = k->file (static_cast<FontFiles::Variant>(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<CaptionDecoder> i, decoder->caption) {
+ BOOST_FOREACH (shared_ptr<TextDecoder> 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> (piece), _1, _2));
}
- list<shared_ptr<CaptionDecoder> >::const_iterator j = decoder->caption.begin();
+ list<shared_ptr<TextDecoder> >::const_iterator j = decoder->caption.begin();
while (j != decoder->caption.end()) {
(*j)->BitmapStart.connect (
- bind(&Player::bitmap_text_start, this, weak_ptr<Piece>(piece), weak_ptr<const CaptionContent>((*j)->content()), _1)
+ bind(&Player::bitmap_text_start, this, weak_ptr<Piece>(piece), weak_ptr<const TextContent>((*j)->content()), _1)
);
(*j)->PlainStart.connect (
- bind(&Player::plain_text_start, this, weak_ptr<Piece>(piece), weak_ptr<const CaptionContent>((*j)->content()), _1)
+ bind(&Player::plain_text_start, this, weak_ptr<Piece>(piece), weak_ptr<const TextContent>((*j)->content()), _1)
);
(*j)->Stop.connect (
- bind(&Player::subtitle_stop, this, weak_ptr<Piece>(piece), weak_ptr<const CaptionContent>((*j)->content()), _1, _2)
+ bind(&Player::subtitle_stop, this, weak_ptr<Piece>(piece), weak_ptr<const TextContent>((*j)->content()), _1, _2)
);
++j;
@@ -221,9 +221,9 @@ Player::playlist_content_changed (weak_ptr<Content> 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<Content> 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<PositionImage>
-Player::transform_bitmap_captions (list<BitmapCaption> subs) const
+Player::transform_bitmap_captions (list<BitmapText> subs) const
{
list<PositionImage> all;
- for (list<BitmapCaption>::const_iterator i = subs.begin(); i != subs.end(); ++i) {
+ for (list<BitmapText>::const_iterator i = subs.begin(); i != subs.end(); ++i) {
if (!i->image) {
continue;
}
@@ -419,7 +419,7 @@ Player::get_subtitle_fonts ()
list<shared_ptr<Font> > fonts;
BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
- BOOST_FOREACH (shared_ptr<CaptionContent> j, i->content->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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<PlayerCaption>
+list<PlayerText>
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<Piece> wp, AudioStreamPtr stream, ContentAudio content_a
}
void
-Player::bitmap_text_start (weak_ptr<Piece> wp, weak_ptr<const CaptionContent> wc, ContentBitmapCaption subtitle)
+Player::bitmap_text_start (weak_ptr<Piece> wp, weak_ptr<const TextContent> wc, ContentBitmapText subtitle)
{
shared_ptr<Piece> piece = wp.lock ();
- shared_ptr<const CaptionContent> caption = wc.lock ();
+ shared_ptr<const TextContent> caption = wc.lock ();
if (!piece || !caption) {
return;
}
@@ -890,7 +890,7 @@ Player::bitmap_text_start (weak_ptr<Piece> wp, weak_ptr<const CaptionContent> 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<Piece> wp, weak_ptr<const CaptionContent> wc
}
void
-Player::plain_text_start (weak_ptr<Piece> wp, weak_ptr<const CaptionContent> wc, ContentTextCaption subtitle)
+Player::plain_text_start (weak_ptr<Piece> wp, weak_ptr<const TextContent> wc, ContentStringText subtitle)
{
shared_ptr<Piece> piece = wp.lock ();
- shared_ptr<const CaptionContent> caption = wc.lock ();
+ shared_ptr<const TextContent> 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<Piece> wp, weak_ptr<const CaptionContent> 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<Piece> wp, weak_ptr<const CaptionContent> wc,
}
void
-Player::subtitle_stop (weak_ptr<Piece> wp, weak_ptr<const CaptionContent> wc, ContentTime to, CaptionType type)
+Player::subtitle_stop (weak_ptr<Piece> wp, weak_ptr<const TextContent> wc, ContentTime to, TextType type)
{
if (!_active_captions[type].have (wc)) {
return;
}
shared_ptr<Piece> piece = wp.lock ();
- shared_ptr<const CaptionContent> caption = wc.lock ();
+ shared_ptr<const TextContent> caption = wc.lock ();
if (!piece || !caption) {
return;
}
@@ -960,7 +960,7 @@ Player::subtitle_stop (weak_ptr<Piece> wp, weak_ptr<const CaptionContent> wc, Co
return;
}
- pair<PlayerCaption, DCPTime> from = _active_captions[type].add_to (wc, dcp_to);
+ pair<PlayerText, DCPTime> 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> content, ContentTime t);
- std::list<PlayerCaption> closed_captions_for_frame (DCPTime time) const;
+ std::list<PlayerText> 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<void (PlayerCaption, CaptionType, DCPTimePeriod)> Caption;
+ boost::signals2::signal<void (PlayerText, TextType, DCPTimePeriod)> 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<Content>, int, bool);
- std::list<PositionImage> transform_bitmap_captions (std::list<BitmapCaption>) const;
+ std::list<PositionImage> transform_bitmap_captions (std::list<BitmapText>) const;
Frame dcp_to_content_video (boost::shared_ptr<const Piece> piece, DCPTime t) const;
DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const;
Frame dcp_to_resampled_audio (boost::shared_ptr<const Piece> piece, DCPTime t) const;
@@ -128,9 +128,9 @@ private:
boost::shared_ptr<PlayerVideo> black_player_video_frame (Eyes eyes) const;
void video (boost::weak_ptr<Piece>, ContentVideo);
void audio (boost::weak_ptr<Piece>, AudioStreamPtr, ContentAudio);
- void bitmap_text_start (boost::weak_ptr<Piece>, boost::weak_ptr<const CaptionContent>, ContentBitmapCaption);
- void plain_text_start (boost::weak_ptr<Piece>, boost::weak_ptr<const CaptionContent>, ContentTextCaption);
- void subtitle_stop (boost::weak_ptr<Piece>, boost::weak_ptr<const CaptionContent>, ContentTime, CaptionType);
+ void bitmap_text_start (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, ContentBitmapText);
+ void plain_text_start (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, ContentStringText);
+ void subtitle_stop (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, ContentTime, TextType);
DCPTime one_video_frame () const;
void fill_audio (DCPTimePeriod period);
std::pair<boost::shared_ptr<AudioBuffers>, 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<AudioProcessor> _audio_processor;
boost::signals2::scoped_connection _film_changed_connection;
diff --git a/src/lib/player_caption.cc b/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 <boost/foreach.hpp>
@@ -26,7 +26,7 @@ using std::list;
using boost::shared_ptr;
void
-PlayerCaption::add_fonts (list<shared_ptr<Font> > fonts_)
+PlayerText::add_fonts (list<shared_ptr<Font> > fonts_)
{
BOOST_FOREACH (shared_ptr<Font> i, fonts_) {
bool got = false;
diff --git a/src/lib/player_caption.h b/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<boost::shared_ptr<Font> > fonts_);
std::list<boost::shared_ptr<Font> > fonts;
- /** BitmapCaptions, with their rectangles transformed as specified by their content */
- std::list<BitmapCaption> image;
- std::list<TextCaption> text;
+ /** BitmapTexts, with their rectangles transformed as specified by their content */
+ std::list<BitmapText> image;
+ std::list<StringText> 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<const Content> i, _content) {
bool burn = false;
- BOOST_FOREACH (shared_ptr<CaptionContent> j, i->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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<const AudioBuffers> 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<dcp::Subtitle>(new dcp::SubtitleString(i)));
}
- BOOST_FOREACH (BitmapCaption i, subs.image) {
+ BOOST_FOREACH (BitmapText i, subs.image) {
_caption_asset[type]->add (
shared_ptr<dcp::Subtitle>(
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 <dcp/picture_asset_writer.h>
#include <boost/shared_ptr.hpp>
@@ -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<const AudioBuffers> audio);
- void write (PlayerCaption text, CaptionType type, DCPTimePeriod period);
+ void write (PlayerText text, TextType type, DCPTimePeriod period);
void finish ();
boost::shared_ptr<dcp::Reel> create_reel (std::list<ReferencedReelAsset> const & refs, std::list<boost::shared_ptr<Font> > 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<pair<FontFiles, string> > fc_config_fonts;
string
-marked_up (list<TextCaption> subtitles, int target_height, float fade_factor)
+marked_up (list<StringText> subtitles, int target_height, float fade_factor)
{
string out;
- BOOST_FOREACH (TextCaption const & i, subtitles) {
+ BOOST_FOREACH (StringText const & i, subtitles) {
out += "<span ";
if (i.italic()) {
out += "style=\"italic\" ";
@@ -91,7 +91,7 @@ set_source_rgba (Cairo::RefPtr<Cairo::Context> context, dcp::Colour colour, floa
* at the same time and with the same fade in/out.
*/
static PositionImage
-render_line (list<TextCaption> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate)
+render_line (list<StringText> subtitles, list<shared_ptr<Font> > 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<TextCaption> subtitles, list<shared_ptr<Font> > fonts, dcp::Si
* @param frame_rate DCP frame rate.
*/
list<PositionImage>
-render_text (list<TextCaption> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate)
+render_text (list<StringText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate)
{
- list<TextCaption> pending;
+ list<StringText> pending;
list<PositionImage> 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 <dcp/util.h>
class Font;
-std::string marked_up (std::list<TextCaption> subtitles, int target_height, float fade_factor);
+std::string marked_up (std::list<StringText> subtitles, int target_height, float fade_factor);
std::list<PositionImage> render_text (
- std::list<TextCaption>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int
+ std::list<StringText>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int
);
diff --git a/src/lib/text_caption.h b/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
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 <sub/subrip_reader.h>
#include <sub/ssa_reader.h>
#include <sub/collect.h>
@@ -39,7 +39,7 @@ using boost::scoped_array;
using boost::optional;
using dcp::Data;
-TextCaptionFile::TextCaptionFile (shared_ptr<const TextCaptionFileContent> content)
+StringTextFile::StringTextFile (shared_ptr<const StringTextFileContent> content)
{
Data in (content->path (0));
@@ -96,7 +96,7 @@ TextCaptionFile::TextCaptionFile (shared_ptr<const TextCaptionFileContent> conte
/** @return time of first subtitle, if there is one */
optional<ContentTime>
-TextCaptionFile::first () const
+StringTextFile::first () const
{
if (_subtitles.empty()) {
return optional<ContentTime>();
@@ -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
index 4a5657a08..0091973a4 100644
--- a/src/lib/text_caption_file.h
+++ b/src/lib/string_text_file.h
@@ -26,22 +26,22 @@
#include <boost/shared_ptr.hpp>
#include <vector>
-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<const TextCaptionFileContent>);
+ explicit StringTextFile (boost::shared_ptr<const StringTextFileContent>);
boost::optional<ContentTime> first () const;
ContentTime length () const;
diff --git a/src/lib/text_caption_file_content.cc b/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 <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <iostream>
@@ -35,24 +35,24 @@ using std::cout;
using boost::shared_ptr;
using dcp::raw_convert;
-TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
+StringTextFileContent::StringTextFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
: Content (film, path)
{
- caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, CAPTION_OPEN)));
+ caption.push_back (shared_ptr<TextContent> (new TextContent (this, CAPTION_OPEN)));
}
-TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
+StringTextFileContent::StringTextFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
: Content (film, node)
, _length (node->number_child<ContentTime::Type> ("Length"))
{
- caption = CaptionContent::from_xml (this, node, version);
+ caption = TextContent::from_xml (this, node, version);
}
void
-TextCaptionFileContent::examine (boost::shared_ptr<Job> job)
+StringTextFileContent::examine (boost::shared_ptr<Job> 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> 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
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<const Film>, boost::filesystem::path);
- TextCaptionFileContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+ StringTextFileContent (boost::shared_ptr<const Film>, boost::filesystem::path);
+ StringTextFileContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
- boost::shared_ptr<TextCaptionFileContent> shared_from_this () {
- return boost::dynamic_pointer_cast<TextCaptionFileContent> (Content::shared_from_this ());
+ boost::shared_ptr<StringTextFileContent> shared_from_this () {
+ return boost::dynamic_pointer_cast<StringTextFileContent> (Content::shared_from_this ());
}
void examine (boost::shared_ptr<Job>);
diff --git a/src/lib/text_caption_file_decoder.cc b/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 <dcp/subtitle_string.h>
#include <boost/foreach.hpp>
#include <iostream>
@@ -35,19 +35,19 @@ using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
-TextCaptionFileDecoder::TextCaptionFileDecoder (shared_ptr<const TextCaptionFileContent> content, shared_ptr<Log> log)
- : TextCaptionFile (content)
+StringTextFileDecoder::StringTextFileDecoder (shared_ptr<const StringTextFileContent> content, shared_ptr<Log> log)
+ : StringTextFile (content)
, _next (0)
{
ContentTime first;
if (!_subtitles.empty()) {
first = content_time_period(_subtitles[0]).from;
}
- caption.push_back (shared_ptr<CaptionDecoder> (new CaptionDecoder (this, content->only_caption(), log, first)));
+ caption.push_back (shared_ptr<TextDecoder> (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
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<const TextCaptionFileContent>, boost::shared_ptr<Log> log);
+ StringTextFileDecoder (boost::shared_ptr<const StringTextFileContent>, boost::shared_ptr<Log> log);
void seek (ContentTime time, bool accurate);
bool pass ();
diff --git a/src/lib/caption_content.cc b/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 <Caption> nodes under node (according to version).
- * The list could be empty if no CaptionContents are found.
+/** @return TextContents from node or <Caption> nodes under node (according to version).
+ * The list could be empty if no TextContents are found.
*/
-list<shared_ptr<CaptionContent> >
-CaptionContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version)
+list<shared_ptr<TextContent> >
+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<shared_ptr<CaptionContent> >();
+ return list<shared_ptr<TextContent> >();
}
/* 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<double>("SubtitleXOffset") && !node->optional_number_child<double>("SubtitleOffset")) {
- return list<shared_ptr<CaptionContent> >();
+ return list<shared_ptr<TextContent> >();
}
- list<shared_ptr<CaptionContent> > c;
- c.push_back (shared_ptr<CaptionContent> (new CaptionContent (parent, node, version)));
+ list<shared_ptr<TextContent> > c;
+ c.push_back (shared_ptr<TextContent> (new TextContent (parent, node, version)));
return c;
}
if (!node->optional_node_child("Caption")) {
- return list<shared_ptr<CaptionContent> >();
+ return list<shared_ptr<TextContent> >();
}
- list<shared_ptr<CaptionContent> > c;
+ list<shared_ptr<TextContent> > c;
BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Caption")) {
- c.push_back (shared_ptr<CaptionContent> (new CaptionContent (parent, i, version)));
+ c.push_back (shared_ptr<TextContent> (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<shared_ptr<Content> > c)
+TextContent::TextContent (Content* parent, vector<shared_ptr<Content> > 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<CaptionContent> ref = c[0]->only_caption();
+ shared_ptr<TextContent> ref = c[0]->only_caption();
DCPOMATIC_ASSERT (ref);
list<shared_ptr<Font> > ref_fonts = ref->fonts ();
@@ -314,7 +314,7 @@ CaptionContent::CaptionContent (Content* parent, vector<shared_ptr<Content> > 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<string> (x_scale())
+ "_" + raw_convert<string> (y_scale())
@@ -399,14 +399,14 @@ CaptionContent::identifier () const
}
void
-CaptionContent::add_font (shared_ptr<Font> font)
+TextContent::add_font (shared_ptr<Font> 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<Font> 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<dcp::Colour>(), CaptionContentProperty::COLOUR);
+ maybe_set (_colour, optional<dcp::Colour>(), 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<dcp::Effect>(), CaptionContentProperty::EFFECT);
+ maybe_set (_effect, optional<dcp::Effect>(), 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<dcp::Colour>(), CaptionContentProperty::EFFECT_COLOUR);
+ maybe_set (_effect_colour, optional<dcp::Colour>(), 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<ContentTime>(), CaptionContentProperty::FADE_IN);
+ maybe_set (_fade_in, optional<ContentTime>(), 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<ContentTime>(), CaptionContentProperty::FADE_OUT);
+ maybe_set (_fade_out, optional<ContentTime>(), 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<const CaptionContent> c)
+TextContent::take_settings_from (shared_ptr<const TextContent> c)
{
set_use (c->_use);
set_burn (c->_burn);
@@ -554,7 +554,7 @@ CaptionContent::take_settings_from (shared_ptr<const CaptionContent> 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
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<boost::shared_ptr<Content> >);
+ TextContent (Content* parent, TextType original_type);
+ TextContent (Content* parent, std::vector<boost::shared_ptr<Content> >);
void as_xml (xmlpp::Node *) const;
std::string identifier () const;
- void take_settings_from (boost::shared_ptr<const CaptionContent> c);
+ void take_settings_from (boost::shared_ptr<const TextContent> c);
void add_font (boost::shared_ptr<Font> 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<boost::shared_ptr<CaptionContent> > from_xml (Content* parent, cxml::ConstNodePtr, int version);
+ static std::list<boost::shared_ptr<TextContent> > 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
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<const CaptionContent> c,
+ shared_ptr<const TextContent> c,
shared_ptr<Log> log,
ContentTime first
)
@@ -58,14 +58,14 @@ CaptionDecoder::CaptionDecoder (
* of the video frame)
*/
void
-CaptionDecoder::emit_bitmap_start (ContentTime from, shared_ptr<Image> image, dcpomatic::Rect<double> rect)
+TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<Image> image, dcpomatic::Rect<double> 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<dcp::SubtitleString> s)
+TextDecoder::emit_plain_start (ContentTime from, list<dcp::SubtitleString> 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<dcp::SubtitleString> 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<dcp::SubtitleString> s)
+TextDecoder::emit_plain (ContentTimePeriod period, list<dcp::SubtitleString> 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
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 <dcp/subtitle_string.h>
#include <boost/signals2.hpp>
@@ -35,12 +35,12 @@ namespace sub {
class Image;
-class CaptionDecoder : public DecoderPart
+class TextDecoder : public DecoderPart
{
public:
- CaptionDecoder (
+ TextDecoder (
Decoder* parent,
- boost::shared_ptr<const CaptionContent>,
+ boost::shared_ptr<const TextContent>,
boost::shared_ptr<Log> log,
ContentTime first
);
@@ -58,16 +58,16 @@ public:
void seek ();
- boost::shared_ptr<const CaptionContent> content () const {
+ boost::shared_ptr<const TextContent> content () const {
return _content;
}
- boost::signals2::signal<void (ContentBitmapCaption)> BitmapStart;
- boost::signals2::signal<void (ContentTextCaption)> PlainStart;
- boost::signals2::signal<void (ContentTime, CaptionType)> Stop;
+ boost::signals2::signal<void (ContentBitmapText)> BitmapStart;
+ boost::signals2::signal<void (ContentStringText)> PlainStart;
+ boost::signals2::signal<void (ContentTime, TextType)> Stop;
private:
- boost::shared_ptr<const CaptionContent> _content;
+ boost::shared_ptr<const TextContent> _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<string> (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 <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
@@ -104,7 +104,7 @@ public:
bool can_repeat (Frame) const;
void repeat (Frame, Eyes);
void write (boost::shared_ptr<const AudioBuffers>, DCPTime time);
- void write (PlayerCaption text, CaptionType type, DCPTimePeriod period);
+ void write (PlayerText text, TextType type, DCPTimePeriod period);
void write (std::list<boost::shared_ptr<Font> > 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 <dcp/exceptions.h>
#include <dcp/raw_convert.h>
#include <wx/generic/aboutdlgg.h>
@@ -580,8 +580,8 @@ private:
}
if (d->caption()) {
- list<shared_ptr<CaptionContent> >::iterator j = i->caption.begin ();
- list<shared_ptr<CaptionContent> >::const_iterator k = _clipboard->caption.begin ();
+ list<shared_ptr<TextContent> >::iterator j = i->caption.begin ();
+ list<shared_ptr<TextContent> >::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<DCPContent> dcp)
{
- BOOST_FOREACH (shared_ptr<CaptionContent> i, dcp->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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 <boost/bind.hpp>
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 = _player.lock ();
DCPOMATIC_ASSERT (player);
- list<TextCaption> to_show;
- BOOST_FOREACH (PlayerCaption i, player->closed_captions_for_frame(time)) {
- BOOST_FOREACH (TextCaption j, i.text) {
+ list<StringText> 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<TextCaption>::const_iterator j = to_show.begin();
+ list<StringText>::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 <wx/wx.h>
#include <wx/notebook.h>
#include <wx/listctrl.h>
@@ -128,7 +128,7 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> 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<CaptionType>(i));
+ _caption_panel[i] = new TextPanel (this, static_cast<TextType>(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<Content> i, selected()) {
DCPTime p;
p = i->position();
- if (dynamic_pointer_cast<TextCaptionFileContent>(i) && i->paths_valid()) {
+ if (dynamic_pointer_cast<StringTextFileContent>(i) && i->paths_valid()) {
/* Rather special case; if we select a text subtitle file jump to its
first subtitle.
*/
- TextCaptionFile ts (dynamic_pointer_cast<TextCaptionFileContent>(i));
+ StringTextFile ts (dynamic_pointer_cast<StringTextFileContent>(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<CaptionContent> j, i->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> 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<ContentSubPanel *> _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 <dcp/locale_convert.h>
@@ -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 <RtAudio.h>
#include <wx/wx.h>
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 <wx/wx.h>
#include <boost/foreach.hpp>
#include <iostream>
@@ -34,7 +34,7 @@ using std::string;
using std::cout;
using boost::shared_ptr;
-FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<Content> content, shared_ptr<CaptionContent> caption)
+FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<Content> content, shared_ptr<TextContent> caption)
: wxDialog (parent, wxID_ANY, _("Fonts"))
, _content (content)
, _caption (caption)
@@ -100,7 +100,7 @@ void
FontsDialog::setup ()
{
shared_ptr<Content> content = _content.lock ();
- shared_ptr<CaptionContent> caption = _caption.lock ();
+ shared_ptr<TextContent> caption = _caption.lock ();
if (!content || !caption) {
return;
}
@@ -140,7 +140,7 @@ void
FontsDialog::edit_clicked ()
{
shared_ptr<Content> content = _content.lock ();
- shared_ptr<CaptionContent> caption = _caption.lock ();
+ shared_ptr<TextContent> 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 <boost/filesystem.hpp>
class Content;
-class CaptionContent;
+class TextContent;
class FontsDialog : public wxDialog
{
public:
- FontsDialog (wxWindow* parent, boost::shared_ptr<Content>, boost::shared_ptr<CaptionContent> caption);
+ FontsDialog (wxWindow* parent, boost::shared_ptr<Content>, boost::shared_ptr<TextContent> caption);
private:
void setup ();
@@ -39,7 +39,7 @@ private:
void edit_clicked ();
boost::weak_ptr<Content> _content;
- boost::weak_ptr<CaptionContent> _caption;
+ boost::weak_ptr<TextContent> _caption;
wxListCtrl* _fonts;
wxButton* _edit;
};
diff --git a/src/wx/caption_appearance_dialog.cc b/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 <wx/wx.h>
@@ -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> content, shared_ptr<CaptionContent> caption)
+SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr<Content> content, shared_ptr<TextContent> caption)
: wxDialog (parent, wxID_ANY, _("Caption appearance"))
, _content (content)
, _caption (caption)
@@ -110,7 +110,7 @@ CaptionAppearanceDialog::CaptionAppearanceDialog (wxWindow* parent, shared_ptr<C
overall_sizer->Add (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_ptr<C
_outline_width->SetValue (_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<RGBA, RGBAColourPicker*>::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
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> content, boost::shared_ptr<CaptionContent> caption);
+ SubtitleAppearanceDialog (wxWindow* parent, boost::shared_ptr<Content> content, boost::shared_ptr<TextContent> caption);
void apply ();
@@ -60,7 +60,7 @@ private:
std::map<RGBA, RGBAColourPicker*> _pickers;
boost::shared_ptr<Content> _content;
- boost::shared_ptr<CaptionContent> _caption;
+ boost::shared_ptr<TextContent> _caption;
boost::shared_ptr<FFmpegSubtitleStream> _stream;
boost::signals2::scoped_connection _content_connection;
diff --git a/src/wx/caption_panel.cc b/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 <wx/spinctrl.h>
#include <boost/foreach.hpp>
@@ -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<CaptionContent> caption;
+ shared_ptr<TextContent> 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<Content> 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<Content> 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<Content> 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<Content> i, sel) {
/* These are the content types that could include subtitles */
shared_ptr<const FFmpegContent> fc = boost::dynamic_pointer_cast<const FFmpegContent> (i);
- shared_ptr<const TextCaptionFileContent> sc = boost::dynamic_pointer_cast<const TextCaptionFileContent> (i);
+ shared_ptr<const StringTextFileContent> sc = boost::dynamic_pointer_cast<const StringTextFileContent> (i);
shared_ptr<const DCPContent> dc = boost::dynamic_pointer_cast<const DCPContent> (i);
shared_ptr<const DCPSubtitleContent> dsc = boost::dynamic_pointer_cast<const DCPSubtitleContent> (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<Content> 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<Content> 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<Content> 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<Content> 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<Content> 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 = 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
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
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> film, shared_ptr<Content> content, shared_ptr<CaptionContent> caption, shared_ptr<Decoder> decoder, FilmViewer* viewer)
+TextView::TextView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<TextContent> caption, shared_ptr<Decoder> 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> film, shared_ptr<Co
wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
sizer->Add (_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> film, shared_ptr<Co
_subs = 0;
_frc = film->active_frame_rate_change (content->position());
- /* Find the decoder that is being used for our CaptionContent and attach to it */
- BOOST_FOREACH (shared_ptr<CaptionDecoder> i, decoder->caption) {
+ /* Find the decoder that is being used for our TextContent and attach to it */
+ BOOST_FOREACH (shared_ptr<TextDecoder> 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> film, shared_ptr<Co
}
void
-CaptionView::data_start (ContentTextCaption cts)
+TextView::data_start (ContentStringText cts)
{
BOOST_FOREACH (dcp::SubtitleString const & i, cts.subs) {
wxListItem list_item;
@@ -114,7 +114,7 @@ CaptionView::data_start (ContentTextCaption cts)
}
void
-CaptionView::data_stop (ContentTime time)
+TextView::data_stop (ContentTime time)
{
if (!_last_count) {
return;
@@ -126,7 +126,7 @@ CaptionView::data_stop (ContentTime time)
}
void
-CaptionView::subtitle_selected (wxListEvent& ev)
+TextView::subtitle_selected (wxListEvent& ev)
{
if (!Config::instance()->jump_to_selected ()) {
return;
diff --git a/src/wx/caption_view.h b/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 <boost/shared_ptr.hpp>
#include <wx/wx.h>
#include <wx/listctrl.h>
@@ -26,15 +26,15 @@
class Decoder;
class FilmViewer;
-class CaptionView : public wxDialog
+class TextView : public wxDialog
{
public:
- CaptionView (
- wxWindow *, boost::shared_ptr<Film>, boost::shared_ptr<Content> content, boost::shared_ptr<CaptionContent> caption, boost::shared_ptr<Decoder>, FilmViewer* viewer
+ TextView (
+ wxWindow *, boost::shared_ptr<Film>, boost::shared_ptr<Content> content, boost::shared_ptr<TextContent> caption, boost::shared_ptr<Decoder>, 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 <wx/graphics.h>
@@ -228,7 +228,7 @@ Timeline::recreate_views ()
_views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, i)));
}
- BOOST_FOREACH (shared_ptr<CaptionContent> j, i->caption) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->caption) {
_views.push_back (shared_ptr<TimelineView> (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<Content> c, shared_ptr<CaptionContent> caption)
+TimelineTextContentView::TimelineTextContentView (Timeline& tl, shared_ptr<Content> c, shared_ptr<TextContent> 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<Content>, boost::shared_ptr<CaptionContent>);
+ TimelineTextContentView (Timeline& tl, boost::shared_ptr<Content>, boost::shared_ptr<TextContent>);
private:
bool active () const;
wxColour background_colour () const;
wxColour foreground_colour () const;
- boost::shared_ptr<CaptionContent> _caption;
+ boost::shared_ptr<TextContent> _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 <dcp/locale_convert.h>
#include <boost/foreach.hpp>
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<TextCaption> content (new TextCaption (film, "test/data/subrip2.srt"));
+ shared_ptr<StringText> 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<DCPContent> background_dcp (new DCPContent(film2, film->dir(film->dcp_name())));
film2->examine_and_add_content (background_dcp);
- shared_ptr<TextCaption> sub = dynamic_pointer_cast<TextCaption> (
+ shared_ptr<StringText> sub = dynamic_pointer_cast<StringText> (
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 <dcp/dcp.h>
#include <dcp/cpl.h>
@@ -33,7 +33,7 @@ using boost::shared_ptr;
BOOST_AUTO_TEST_CASE (closed_caption_test1)
{
shared_ptr<Film> film = new_test_film2 ("closed_caption_test1");
- shared_ptr<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/subrip.srt"));
+ shared_ptr<StringTextFileContent> 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 <iostream>
@@ -43,10 +43,10 @@ using std::list;
using boost::shared_ptr;
using boost::optional;
-optional<ContentTextCaption> stored;
+optional<ContentStringText> 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<DCPDecoder> decoder (new DCPDecoder (content, film->log(), false));
decoder->only_caption()->PlainStart.connect (bind (store, _1));
- stored = optional<ContentTextCaption> ();
+ stored = optional<ContentStringText> ();
while (!decoder->pass() && !stored) {}
BOOST_REQUIRE (stored);
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2)
shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content, film->log()));
decoder->only_caption()->PlainStart.connect (bind (store, _1));
- stored = optional<ContentTextCaption> ();
+ stored = optional<ContentStringText> ();
while (!decoder->pass ()) {
if (stored && stored->from() == ContentTime(0)) {
BOOST_CHECK_EQUAL (stored->subs.front().text(), "&lt;b&gt;Hello world!&lt;/b&gt;");
@@ -140,7 +140,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3)
BOOST_REQUIRE (!wait_for_jobs ());
shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content, film->log()));
- stored = optional<ContentTextCaption> ();
+ stored = optional<ContentStringText> ();
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 <boost/test/unit_test.hpp>
@@ -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<TextCaptionFileContent> s (new TextCaptionFileContent (film, "test/data/subrip2.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> s (new TextCaptionFileContent (film, "test/data/subrip.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> s (new TextCaptionFileContent (film, "test/data/subrip2.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> s (new TextCaptionFileContent (film, "test/data/subrip.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> s (new TextCaptionFileContent (film, "test/data/subrip.srt"));
+ shared_ptr<StringTextFileContent> 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 <boost/test/unit_test.hpp>
@@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE (reels_test3)
shared_ptr<Content> dcp (new DCPContent (film, "test/data/reels_test2"));
film->examine_and_add_content (dcp);
- shared_ptr<Content> sub (new TextCaptionFileContent (film, "test/data/subrip.srt"));
+ shared_ptr<Content> 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<TextCaptionFileContent> subs (new TextCaptionFileContent (film, "test/data/subrip3.srt"));
+ shared_ptr<StringTextFileContent> 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 <boost/test/unit_test.hpp>
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 <boost/test/unit_test.hpp>
static void
-add (std::list<TextCaption>& s, std::string text, bool italic, bool bold, bool underline)
+add (std::list<StringText>& s, std::string text, bool italic, bool bold, bool underline)
{
s.push_back (
- TextCaption (
+ StringText (
dcp::SubtitleString (
boost::optional<std::string> (),
italic,
@@ -60,7 +60,7 @@ add (std::list<TextCaption>& 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<TextCaption> s;
+ std::list<StringText> s;
add (s, "Hello", false, false, false);
BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "<span size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
}
@@ -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<TextCaption> s;
+ std::list<StringText> s;
add (s, "Hello", false, true, false);
BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "<span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
}
@@ -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<TextCaption> s;
+ std::list<StringText> s;
add (s, "Hello", true, true, false);
BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "<span style=\"italic\" weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
}
@@ -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<TextCaption> s;
+ std::list<StringText> s;
add (s, "Hello", true, true, true);
BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "<span style=\"italic\" weight=\"bold\" underline=\"single\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
}
@@ -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<TextCaption> s;
+ std::list<StringText> s;
add (s, "Hello", false, true, false);
add (s, " world.", false, false, false);
BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "<span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span><span size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\"> world.</span>");
@@ -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<TextCaption> s;
+ std::list<StringText> 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 <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
@@ -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<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/subrip2.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/subrip2.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> content (new TextCaptionFileContent (film, private_data / "Ankoemmling_short.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/subrip2.srt"));
+ shared_ptr<StringTextFileContent> 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<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/subrip2.srt"));
+ shared_ptr<StringTextFileContent> 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> film = new_test_film2 ("srt_subtitle_test6");
film->set_interop (false);
- shared_ptr<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/frames.srt"));
+ shared_ptr<StringTextFileContent> 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> film = new_test_film ("subrip_render_test");
- shared_ptr<TextCaptionFile> content (new TextCaptionFile (film, "test/data/subrip.srt"));
+ shared_ptr<StringTextFile> content (new StringTextFile (film, "test/data/subrip.srt"));
content->examine (shared_ptr<Job> (), true);
BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471));
shared_ptr<SubRipDecoder> decoder (new SubRipDecoder (content));
- list<ContentTextCaption> cts = decoder->get_plain_texts (
+ list<ContentStringText> 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 <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
@@ -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<TextCaptionFileContent> content (new TextCaptionFileContent (film, private_data / "DKH_UT_EN20160601def.ssa"));
+ shared_ptr<StringTextFileContent> 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 <boost/test/unit_test.hpp>
using boost::shared_ptr;
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (subtitle_charset_test2)
shared_ptr<Content> content = content_factory (film, "test/data/osx.srt").front ();
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- shared_ptr<TextCaptionFileContent> ts = dynamic_pointer_cast<TextCaptionFileContent> (content);
+ shared_ptr<StringTextFileContent> ts = dynamic_pointer_cast<StringTextFileContent> (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 <dcp/cpl.h>
@@ -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<TextCaptionFileContent> content (new TextCaptionFileContent (film, "test/data/subrip5.srt"));
+ shared_ptr<StringTextFileContent> 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);