summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-19 21:48:27 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-19 23:45:23 +0100
commit9cb73fbc0fa4643612f01665bc6d9fc430656f32 (patch)
tree2b13822810da4118e4af6810c78c2f78d90099b8 /src
parentb9dc4932eba9e84f50abe62d8cd779b8b436f3a4 (diff)
Reword again: Text -> Caption and Plain -> Text.
sed -i "s/ActiveText/ActiveCaptions/g" src/lib/*.{cc,h} sed -i "s/active_text.h/active_captions.h/g" src/lib/*.{cc,h} sed -i "s/active_text.cc/active_captions.cc/g" src/lib/wscript mv src/lib/active_text.cc src/lib/active_captions.cc mv src/lib/active_text.h src/lib/active_captions.h sed -i "s/PlainTextFileContent/TextCaptionFileContent/g" src/lib/*.{cc,h} src/wx/*.cc sed -i "s/PlainTextFile/TextCaptionFile/g" src/lib/*.{cc,h} src/wx/*.cc sed -i "s/plain_text_file_content/text_caption_file_content/g" src/lib/*.{cc,h} src/lib/wscript src/wx/*.{cc,h} test/*.cc mv src/lib/plain_text_file_content.cc src/lib/text_caption_file_content.cc mv src/lib/plain_text_file_content.h src/lib/text_caption_file_content.h sed -i "s/PlainTextFileDecoder/TextCaptionFileDecoder/g" src/lib/*.{cc,h} sed -i "s/plain_text_file_decoder/text_caption_file_decoder/g" src/lib/*.{cc,h} src/lib/wscript src/wx/*.{cc,h} mv src/lib/plain_text_file_decoder.cc src/lib/text_caption_file_decoder.cc mv src/lib/plain_text_file_decoder.h src/lib/text_caption_file_decoder.h sed -i "s/PlayerText/PlayerCaption/g" src/lib/*.{cc,h} sed -i "s/player_text.cc/player_caption.cc/g" src/lib/wscript sed -i "s/player_text.h/player_caption.h/g" src/lib/*.{cc,h} mv src/lib/player_text.cc src/lib/player_caption.cc mv src/lib/player_text.h src/lib/player_caption.h sed -i "s/ContentPlainText/ContentTextCaption/g" src/lib/*.{cc,h} src/wx/*.{cc,h} sed -i "s/ContentBitmapText/ContentBitmapCaption/g" src/lib/*.{cc,h} src/wx/*.{cc,h} sed -i "s/PlainText/TextCaption/g" src/lib/*.{cc,h} test/*.cc sed -i "s/plain_text.h/text_caption.h/g" src/lib/*.{cc,h} mv src/lib/plain_text.h src/lib/text_caption.h
Diffstat (limited to 'src')
-rw-r--r--src/lib/active_captions.cc (renamed from src/lib/active_text.cc)22
-rw-r--r--src/lib/active_captions.h (renamed from src/lib/active_text.h)20
-rw-r--r--src/lib/content_factory.cc6
-rw-r--r--src/lib/content_text.h8
-rw-r--r--src/lib/dcp_encoder.cc2
-rw-r--r--src/lib/dcp_encoder.h4
-rw-r--r--src/lib/decoder_factory.cc8
-rw-r--r--src/lib/encoder.h2
-rw-r--r--src/lib/ffmpeg_encoder.cc2
-rw-r--r--src/lib/ffmpeg_encoder.h2
-rw-r--r--src/lib/plain_text_file.cc8
-rw-r--r--src/lib/plain_text_file.h12
-rw-r--r--src/lib/player.cc14
-rw-r--r--src/lib/player.h12
-rw-r--r--src/lib/player_caption.cc (renamed from src/lib/player_text.cc)4
-rw-r--r--src/lib/player_caption.h (renamed from src/lib/player_text.h)6
-rw-r--r--src/lib/reel_writer.cc4
-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/text_caption.h (renamed from src/lib/plain_text.h)6
-rw-r--r--src/lib/text_caption_file_content.cc (renamed from src/lib/plain_text_file_content.cc)18
-rw-r--r--src/lib/text_caption_file_content.h (renamed from src/lib/plain_text_file_content.h)12
-rw-r--r--src/lib/text_caption_file_decoder.cc (renamed from src/lib/plain_text_file_decoder.cc)14
-rw-r--r--src/lib/text_caption_file_decoder.h (renamed from src/lib/plain_text_file_decoder.h)6
-rw-r--r--src/lib/text_decoder.cc4
-rw-r--r--src/lib/text_decoder.h4
-rw-r--r--src/lib/writer.cc2
-rw-r--r--src/lib/writer.h4
-rw-r--r--src/lib/wscript8
-rw-r--r--src/wx/caption_panel.cc6
-rw-r--r--src/wx/content_panel.cc6
-rw-r--r--src/wx/subtitle_appearance_dialog.cc2
-rw-r--r--src/wx/subtitle_view.cc6
-rw-r--r--src/wx/subtitle_view.h2
-rw-r--r--src/wx/timing_panel.cc2
36 files changed, 130 insertions, 130 deletions
diff --git a/src/lib/active_text.cc b/src/lib/active_captions.cc
index 885aa034c..972095e37 100644
--- a/src/lib/active_text.cc
+++ b/src/lib/active_captions.cc
@@ -18,7 +18,7 @@
*/
-#include "active_text.h"
+#include "active_captions.h"
#include "piece.h"
#include "text_content.h"
#include <boost/shared_ptr.hpp>
@@ -35,10 +35,10 @@ using boost::optional;
* @param period Period of interest.
* @param always_burn_subtitles Always burn subtitles even if their content is not set to burn.
*/
-list<PlayerText>
-ActiveText::get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const
+list<PlayerCaption>
+ActiveCaptions::get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const
{
- list<PlayerText> ps;
+ list<PlayerCaption> ps;
for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) {
@@ -68,7 +68,7 @@ ActiveText::get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const
* @param time Time to remove before.
*/
void
-ActiveText::clear_before (DCPTime time)
+ActiveCaptions::clear_before (DCPTime time)
{
Map updated;
for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) {
@@ -91,7 +91,7 @@ ActiveText::clear_before (DCPTime time)
* @param from From time for these subtitles.
*/
void
-ActiveText::add_from (weak_ptr<Piece> piece, PlayerText ps, DCPTime from)
+ActiveCaptions::add_from (weak_ptr<Piece> piece, PlayerCaption ps, DCPTime from)
{
if (_data.find(piece) == _data.end()) {
_data[piece] = list<Period>();
@@ -104,14 +104,14 @@ ActiveText::add_from (weak_ptr<Piece> piece, PlayerText ps, DCPTime from)
* @param to To time for the last subtitle submitted to add_from for this piece.
* @return Return the corresponding subtitles and their from time.
*/
-pair<PlayerText, DCPTime>
-ActiveText::add_to (weak_ptr<Piece> piece, DCPTime to)
+pair<PlayerCaption, DCPTime>
+ActiveCaptions::add_to (weak_ptr<Piece> piece, DCPTime to)
{
DCPOMATIC_ASSERT (_data.find(piece) != _data.end());
_data[piece].back().to = to;
- BOOST_FOREACH (PlainText& i, _data[piece].back().subs.text) {
+ BOOST_FOREACH (TextCaption& i, _data[piece].back().subs.text) {
i.set_out (dcp::Time(to.seconds(), 1000));
}
@@ -122,7 +122,7 @@ ActiveText::add_to (weak_ptr<Piece> piece, DCPTime to)
* @return true if we have any active subtitles from this piece.
*/
bool
-ActiveText::have (weak_ptr<Piece> piece) const
+ActiveCaptions::have (weak_ptr<Piece> piece) const
{
Map::const_iterator i = _data.find(piece);
if (i == _data.end()) {
@@ -133,7 +133,7 @@ ActiveText::have (weak_ptr<Piece> piece) const
}
void
-ActiveText::clear ()
+ActiveCaptions::clear ()
{
_data.clear ();
}
diff --git a/src/lib/active_text.h b/src/lib/active_captions.h
index 09ef1cdaf..718ba393e 100644
--- a/src/lib/active_text.h
+++ b/src/lib/active_captions.h
@@ -18,29 +18,29 @@
*/
-/** @file src/lib/active_text.h
- * @brief ActiveText class.
+/** @file src/lib/active_captions.h
+ * @brief ActiveCaptions class.
*/
#include "dcpomatic_time.h"
-#include "player_text.h"
+#include "player_caption.h"
#include <boost/noncopyable.hpp>
#include <list>
#include <map>
class Piece;
-/** @class ActiveText
+/** @class ActiveCaptions
* @brief A class to maintain information on active subtitles for Player.
*/
-class ActiveText : public boost::noncopyable
+class ActiveCaptions : public boost::noncopyable
{
public:
- std::list<PlayerText> get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const;
+ std::list<PlayerCaption> get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const;
void clear_before (DCPTime time);
void clear ();
- void add_from (boost::weak_ptr<Piece> piece, PlayerText ps, DCPTime from);
- std::pair<PlayerText, DCPTime> add_to (boost::weak_ptr<Piece> piece, DCPTime to);
+ void add_from (boost::weak_ptr<Piece> piece, PlayerCaption ps, DCPTime from);
+ std::pair<PlayerCaption, DCPTime> add_to (boost::weak_ptr<Piece> piece, DCPTime to);
bool have (boost::weak_ptr<Piece> piece) const;
private:
@@ -49,12 +49,12 @@ private:
public:
Period () {}
- Period (PlayerText s, DCPTime f)
+ Period (PlayerCaption s, DCPTime f)
: subs (s)
, from (f)
{}
- PlayerText subs;
+ PlayerCaption subs;
DCPTime from;
boost::optional<DCPTime> to;
};
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index 167b3f4e9..9429f1c46 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 "plain_text_file_content.h"
+#include "text_caption_file_content.h"
#include "dcp_content.h"
#include "dcp_text_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 PlainTextFileContent (film, node, version));
+ content.reset (new TextCaptionFileContent (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 PlainTextFileContent (film, path));
+ single.reset (new TextCaptionFileContent (film, path));
} else if (ext == ".xml") {
cxml::Document doc;
doc.read_file (path);
diff --git a/src/lib/content_text.h b/src/lib/content_text.h
index eaba64ecf..1b550c96d 100644
--- a/src/lib/content_text.h
+++ b/src/lib/content_text.h
@@ -51,10 +51,10 @@ private:
TextType _type;
};
-class ContentBitmapText : public ContentText
+class ContentBitmapCaption : public ContentText
{
public:
- ContentBitmapText (ContentTime f, TextType type, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r)
+ ContentBitmapCaption (ContentTime f, TextType type, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r)
: ContentText (f, type)
, sub (im, r)
{}
@@ -67,10 +67,10 @@ public:
* 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 ContentPlainText : public ContentText
+class ContentTextCaption : public ContentText
{
public:
- ContentPlainText (ContentTime f, TextType type, std::list<dcp::SubtitleString> s)
+ ContentTextCaption (ContentTime f, TextType type, std::list<dcp::SubtitleString> s)
: ContentText (f, type)
, subs (s)
{}
diff --git a/src/lib/dcp_encoder.cc b/src/lib/dcp_encoder.cc
index cfc7da903..9766aad33 100644
--- a/src/lib/dcp_encoder.cc
+++ b/src/lib/dcp_encoder.cc
@@ -141,7 +141,7 @@ DCPEncoder::audio (shared_ptr<AudioBuffers> data, DCPTime time)
}
void
-DCPEncoder::text (PlayerText data, TextType type, DCPTimePeriod period)
+DCPEncoder::text (PlayerCaption data, TextType type, DCPTimePeriod period)
{
if (type == TEXT_CLOSED_CAPTION || _non_burnt_subtitles) {
_writer->write (data, type, period);
diff --git a/src/lib/dcp_encoder.h b/src/lib/dcp_encoder.h
index 8a2ad947d..850ead656 100644
--- a/src/lib/dcp_encoder.h
+++ b/src/lib/dcp_encoder.h
@@ -19,7 +19,7 @@
*/
#include "types.h"
-#include "player_text.h"
+#include "player_caption.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 text (PlayerText, TextType, DCPTimePeriod);
+ void text (PlayerCaption, TextType, DCPTimePeriod);
boost::shared_ptr<Writer> _writer;
boost::shared_ptr<J2KEncoder> _j2k_encoder;
diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc
index a7367dd24..3d4ce8a7b 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 "plain_text_file_content.h"
-#include "plain_text_file_decoder.h"
+#include "text_caption_file_content.h"
+#include "text_caption_file_decoder.h"
#include "dcp_text_content.h"
#include "dcp_text_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 PlainTextFileContent> rc = dynamic_pointer_cast<const PlainTextFileContent> (content);
+ shared_ptr<const TextCaptionFileContent> rc = dynamic_pointer_cast<const TextCaptionFileContent> (content);
if (rc) {
- return shared_ptr<Decoder> (new PlainTextFileDecoder (rc, log));
+ return shared_ptr<Decoder> (new TextCaptionFileDecoder (rc, log));
}
shared_ptr<const DCPTextContent> dsc = dynamic_pointer_cast<const DCPTextContent> (content);
diff --git a/src/lib/encoder.h b/src/lib/encoder.h
index f4116c50c..27fa0745f 100644
--- a/src/lib/encoder.h
+++ b/src/lib/encoder.h
@@ -22,7 +22,7 @@
#define DCPOMATIC_ENCODER_H
#include "types.h"
-#include "player_text.h"
+#include "player_caption.h"
#include <boost/weak_ptr.hpp>
#include <boost/signals2.hpp>
diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc
index e9d872c8f..cc2591498 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 (PlayerText, DCPTimePeriod)
+FFmpegEncoder::subtitle (PlayerCaption, DCPTimePeriod)
{
}
diff --git a/src/lib/ffmpeg_encoder.h b/src/lib/ffmpeg_encoder.h
index b1d07eb7f..35fd85064 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 (PlayerText, DCPTimePeriod);
+ void subtitle (PlayerCaption, DCPTimePeriod);
void setup_video ();
void setup_audio ();
diff --git a/src/lib/plain_text_file.cc b/src/lib/plain_text_file.cc
index 4ed13491c..666953c40 100644
--- a/src/lib/plain_text_file.cc
+++ b/src/lib/plain_text_file.cc
@@ -21,7 +21,7 @@
#include "plain_text_file.h"
#include "cross.h"
#include "exceptions.h"
-#include "plain_text_file_content.h"
+#include "text_caption_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;
-PlainTextFile::PlainTextFile (shared_ptr<const PlainTextFileContent> content)
+TextCaptionFile::TextCaptionFile (shared_ptr<const TextCaptionFileContent> content)
{
Data in (content->path (0));
@@ -96,7 +96,7 @@ PlainTextFile::PlainTextFile (shared_ptr<const PlainTextFileContent> content)
/** @return time of first subtitle, if there is one */
optional<ContentTime>
-PlainTextFile::first () const
+TextCaptionFile::first () const
{
if (_subtitles.empty()) {
return optional<ContentTime>();
@@ -106,7 +106,7 @@ PlainTextFile::first () const
}
ContentTime
-PlainTextFile::length () const
+TextCaptionFile::length () const
{
if (_subtitles.empty ()) {
return ContentTime ();
diff --git a/src/lib/plain_text_file.h b/src/lib/plain_text_file.h
index 34dc08465..8c74d9e59 100644
--- a/src/lib/plain_text_file.h
+++ b/src/lib/plain_text_file.h
@@ -26,22 +26,22 @@
#include <boost/shared_ptr.hpp>
#include <vector>
-class PlainTextFileContent;
+class TextCaptionFileContent;
class plain_text_time_test;
class plain_text_coordinate_test;
class plain_text_content_test;
class plain_text_parse_test;
-/** @class PlainTextFile
- * @brief Base for PlainTextFile decoder and examiner.
+/** @class TextCaptionFile
+ * @brief Base for TextCaptionFile decoder and examiner.
*
* In fact this is sufficient for the examiner, so it's used as-is rather than deriving
- * a pointless PlainTextFileExaminer.
+ * a pointless TextCaptionFileExaminer.
*/
-class PlainTextFile
+class TextCaptionFile
{
public:
- explicit PlainTextFile (boost::shared_ptr<const PlainTextFileContent>);
+ explicit TextCaptionFile (boost::shared_ptr<const TextCaptionFileContent>);
boost::optional<ContentTime> first () const;
ContentTime length () const;
diff --git a/src/lib/player.cc b/src/lib/player.cc
index e300b5448..a7cd0fd94 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -663,7 +663,7 @@ Player::subtitles_for_frame (DCPTime time) const
int const vfr = _film->video_frame_rate();
- BOOST_FOREACH (PlayerText i, _active_text[TEXT_SUBTITLE].get_burnt (DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_subtitles)) {
+ BOOST_FOREACH (PlayerCaption i, _active_text[TEXT_SUBTITLE].get_burnt (DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_subtitles)) {
/* Image subtitles */
list<PositionImage> c = transform_bitmap_texts (i.image);
@@ -839,7 +839,7 @@ Player::audio (weak_ptr<Piece> wp, AudioStreamPtr stream, ContentAudio content_a
}
void
-Player::bitmap_text_start (weak_ptr<Piece> wp, ContentBitmapText subtitle)
+Player::bitmap_text_start (weak_ptr<Piece> wp, ContentBitmapCaption subtitle)
{
shared_ptr<Piece> piece = wp.lock ();
if (!piece) {
@@ -858,7 +858,7 @@ Player::bitmap_text_start (weak_ptr<Piece> wp, ContentBitmapText subtitle)
subtitle.sub.rectangle.width *= piece->content->subtitle->x_scale ();
subtitle.sub.rectangle.height *= piece->content->subtitle->y_scale ();
- PlayerText ps;
+ PlayerCaption ps;
ps.image.push_back (subtitle.sub);
DCPTime from (content_time_to_dcp (piece, subtitle.from()));
@@ -866,14 +866,14 @@ Player::bitmap_text_start (weak_ptr<Piece> wp, ContentBitmapText subtitle)
}
void
-Player::plain_text_start (weak_ptr<Piece> wp, ContentPlainText subtitle)
+Player::plain_text_start (weak_ptr<Piece> wp, ContentTextCaption subtitle)
{
shared_ptr<Piece> piece = wp.lock ();
if (!piece) {
return;
}
- PlayerText ps;
+ PlayerCaption ps;
DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
if (from > piece->content->end()) {
@@ -901,7 +901,7 @@ Player::plain_text_start (weak_ptr<Piece> wp, ContentPlainText subtitle)
}
s.set_in (dcp::Time(from.seconds(), 1000));
- ps.text.push_back (PlainText (s, piece->content->subtitle->outline_width()));
+ ps.text.push_back (TextCaption (s, piece->content->subtitle->outline_width()));
ps.add_fonts (piece->content->subtitle->fonts ());
}
@@ -926,7 +926,7 @@ Player::subtitle_stop (weak_ptr<Piece> wp, ContentTime to, TextType type)
return;
}
- pair<PlayerText, DCPTime> from = _active_text[type].add_to (wp, dcp_to);
+ pair<PlayerCaption, DCPTime> from = _active_text[type].add_to (wp, dcp_to);
if (piece->content->subtitle->use() && !_always_burn_subtitles && !piece->content->subtitle->burn()) {
Text (from.first, type, DCPTimePeriod (from.second, dcp_to));
diff --git a/src/lib/player.h b/src/lib/player.h
index c936524a2..16e9d57a5 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -21,8 +21,8 @@
#ifndef DCPOMATIC_PLAYER_H
#define DCPOMATIC_PLAYER_H
-#include "player_text.h"
-#include "active_text.h"
+#include "player_caption.h"
+#include "active_captions.h"
#include "content_text.h"
#include "film.h"
#include "content.h"
@@ -101,7 +101,7 @@ public:
/** Emitted when a caption is ready. This signal may be emitted considerably
* after the corresponding Video.
*/
- boost::signals2::signal<void (PlayerText, TextType, DCPTimePeriod)> Text;
+ boost::signals2::signal<void (PlayerCaption, TextType, DCPTimePeriod)> Text;
private:
friend class PlayerWrapper;
@@ -126,8 +126,8 @@ 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>, ContentBitmapText);
- void plain_text_start (boost::weak_ptr<Piece>, ContentPlainText);
+ void bitmap_text_start (boost::weak_ptr<Piece>, ContentBitmapCaption);
+ void plain_text_start (boost::weak_ptr<Piece>, ContentTextCaption);
void subtitle_stop (boost::weak_ptr<Piece>, ContentTime, TextType);
DCPTime one_video_frame () const;
void fill_audio (DCPTimePeriod period);
@@ -196,7 +196,7 @@ private:
Empty _black;
Empty _silent;
- ActiveText _active_text[TEXT_COUNT];
+ ActiveCaptions _active_text[TEXT_COUNT];
boost::shared_ptr<AudioProcessor> _audio_processor;
boost::signals2::scoped_connection _film_changed_connection;
diff --git a/src/lib/player_text.cc b/src/lib/player_caption.cc
index 16e89b0f1..74c847aae 100644
--- a/src/lib/player_text.cc
+++ b/src/lib/player_caption.cc
@@ -18,7 +18,7 @@
*/
-#include "player_text.h"
+#include "player_caption.h"
#include "font.h"
#include <boost/foreach.hpp>
@@ -26,7 +26,7 @@ using std::list;
using boost::shared_ptr;
void
-PlayerText::add_fonts (list<shared_ptr<Font> > fonts_)
+PlayerCaption::add_fonts (list<shared_ptr<Font> > fonts_)
{
BOOST_FOREACH (shared_ptr<Font> i, fonts_) {
bool got = false;
diff --git a/src/lib/player_text.h b/src/lib/player_caption.h
index 93b6cd970..2875790df 100644
--- a/src/lib/player_text.h
+++ b/src/lib/player_caption.h
@@ -23,12 +23,12 @@
#include "bitmap_text.h"
#include "dcpomatic_time.h"
-#include "plain_text.h"
+#include "text_caption.h"
class Font;
/** A set of text (subtitle/CCAP) which span the same time period */
-class PlayerText
+class PlayerCaption
{
public:
void add_fonts (std::list<boost::shared_ptr<Font> > fonts_);
@@ -36,7 +36,7 @@ public:
/** BitmapTexts, with their rectangles transformed as specified by their content */
std::list<BitmapText> image;
- std::list<PlainText> text;
+ std::list<TextCaption> text;
};
#endif
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index 8eb0461bc..77d583353 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -528,7 +528,7 @@ ReelWriter::write (shared_ptr<const AudioBuffers> audio)
}
void
-ReelWriter::write (PlayerText subs, TextType type, DCPTimePeriod period)
+ReelWriter::write (PlayerCaption subs, TextType type, DCPTimePeriod period)
{
/* XXX: we need separate libdcp asset types here and to know how different they are */
@@ -558,7 +558,7 @@ ReelWriter::write (PlayerText subs, TextType type, DCPTimePeriod period)
}
}
- BOOST_FOREACH (PlainText i, subs.text) {
+ BOOST_FOREACH (TextCaption 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));
diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h
index 6de1de68d..cd22fa775 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_text.h"
+#include "player_caption.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 (PlayerText text, TextType type, DCPTimePeriod period);
+ void write (PlayerCaption 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 77a8036e8..63ff2b74c 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<PlainText> subtitles, int target_height, float fade_factor)
+marked_up (list<TextCaption> subtitles, int target_height, float fade_factor)
{
string out;
- BOOST_FOREACH (PlainText const & i, subtitles) {
+ BOOST_FOREACH (TextCaption 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<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate)
+render_line (list<TextCaption> 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<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size
* @param frame_rate DCP frame rate.
*/
list<PositionImage>
-render_text (list<PlainText> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate)
+render_text (list<TextCaption> subtitles, list<shared_ptr<Font> > fonts, dcp::Size target, DCPTime time, int frame_rate)
{
- list<PlainText> pending;
+ list<TextCaption> pending;
list<PositionImage> images;
- BOOST_FOREACH (PlainText const & i, subtitles) {
+ BOOST_FOREACH (TextCaption 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 f9c35005e..0a8e97bc9 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 "plain_text.h"
+#include "text_caption.h"
#include <dcp/util.h>
class Font;
-std::string marked_up (std::list<PlainText> subtitles, int target_height, float fade_factor);
+std::string marked_up (std::list<TextCaption> subtitles, int target_height, float fade_factor);
std::list<PositionImage> render_text (
- std::list<PlainText>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int
+ std::list<TextCaption>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int
);
diff --git a/src/lib/plain_text.h b/src/lib/text_caption.h
index 05a95aef2..b4400f5bb 100644
--- a/src/lib/plain_text.h
+++ b/src/lib/text_caption.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 PlainText : public dcp::SubtitleString
+class TextCaption : public dcp::SubtitleString
{
public:
- explicit PlainText (dcp::SubtitleString dcp_)
+ explicit TextCaption (dcp::SubtitleString dcp_)
: dcp::SubtitleString (dcp_)
, outline_width (2)
{}
- PlainText (dcp::SubtitleString dcp_, int outline_width_)
+ TextCaption (dcp::SubtitleString dcp_, int outline_width_)
: dcp::SubtitleString (dcp_)
, outline_width (outline_width_)
{}
diff --git a/src/lib/plain_text_file_content.cc b/src/lib/text_caption_file_content.cc
index 2b52cee96..df5de93ef 100644
--- a/src/lib/plain_text_file_content.cc
+++ b/src/lib/text_caption_file_content.cc
@@ -18,7 +18,7 @@
*/
-#include "plain_text_file_content.h"
+#include "text_caption_file_content.h"
#include "util.h"
#include "plain_text_file.h"
#include "film.h"
@@ -35,13 +35,13 @@ using std::cout;
using boost::shared_ptr;
using dcp::raw_convert;
-PlainTextFileContent::PlainTextFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
+TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
: Content (film, path)
{
subtitle.reset (new TextContent (this));
}
-PlainTextFileContent::PlainTextFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
+TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
: Content (film, node)
, _length (node->number_child<ContentTime::Type> ("Length"))
{
@@ -49,10 +49,10 @@ PlainTextFileContent::PlainTextFileContent (shared_ptr<const Film> film, cxml::C
}
void
-PlainTextFileContent::examine (boost::shared_ptr<Job> job)
+TextCaptionFileContent::examine (boost::shared_ptr<Job> job)
{
Content::examine (job);
- PlainTextFile s (shared_from_this ());
+ TextCaptionFile s (shared_from_this ());
/* Default to turning these subtitles on */
subtitle->set_use (true);
@@ -63,19 +63,19 @@ PlainTextFileContent::examine (boost::shared_ptr<Job> job)
}
string
-PlainTextFileContent::summary () const
+TextCaptionFileContent::summary () const
{
return path_summary() + " " + _("[subtitles]");
}
string
-PlainTextFileContent::technical_summary () const
+TextCaptionFileContent::technical_summary () const
{
return Content::technical_summary() + " - " + _("Text subtitles");
}
void
-PlainTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const
+TextCaptionFileContent::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 @@ PlainTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const
}
DCPTime
-PlainTextFileContent::full_length () const
+TextCaptionFileContent::full_length () const
{
FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate ());
return DCPTime (_length, frc);
diff --git a/src/lib/plain_text_file_content.h b/src/lib/text_caption_file_content.h
index 603931e4c..f8f4a9851 100644
--- a/src/lib/plain_text_file_content.h
+++ b/src/lib/text_caption_file_content.h
@@ -22,17 +22,17 @@
class Job;
-/** @class PlainTextFileContent
+/** @class TextCaptionFileContent
* @brief A SubRip, SSA or ASS file.
*/
-class PlainTextFileContent : public Content
+class TextCaptionFileContent : public Content
{
public:
- PlainTextFileContent (boost::shared_ptr<const Film>, boost::filesystem::path);
- PlainTextFileContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+ TextCaptionFileContent (boost::shared_ptr<const Film>, boost::filesystem::path);
+ TextCaptionFileContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
- boost::shared_ptr<PlainTextFileContent> shared_from_this () {
- return boost::dynamic_pointer_cast<PlainTextFileContent> (Content::shared_from_this ());
+ boost::shared_ptr<TextCaptionFileContent> shared_from_this () {
+ return boost::dynamic_pointer_cast<TextCaptionFileContent> (Content::shared_from_this ());
}
void examine (boost::shared_ptr<Job>);
diff --git a/src/lib/plain_text_file_decoder.cc b/src/lib/text_caption_file_decoder.cc
index 40a605963..d1a72faeb 100644
--- a/src/lib/plain_text_file_decoder.cc
+++ b/src/lib/text_caption_file_decoder.cc
@@ -18,8 +18,8 @@
*/
-#include "plain_text_file_decoder.h"
-#include "plain_text_file_content.h"
+#include "text_caption_file_decoder.h"
+#include "text_caption_file_content.h"
#include "text_content.h"
#include "text_decoder.h"
#include <dcp/subtitle_string.h>
@@ -35,8 +35,8 @@ using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
-PlainTextFileDecoder::PlainTextFileDecoder (shared_ptr<const PlainTextFileContent> content, shared_ptr<Log> log)
- : PlainTextFile (content)
+TextCaptionFileDecoder::TextCaptionFileDecoder (shared_ptr<const TextCaptionFileContent> content, shared_ptr<Log> log)
+ : TextCaptionFile (content)
, _next (0)
{
ContentTime first;
@@ -47,7 +47,7 @@ PlainTextFileDecoder::PlainTextFileDecoder (shared_ptr<const PlainTextFileConten
}
void
-PlainTextFileDecoder::seek (ContentTime time, bool accurate)
+TextCaptionFileDecoder::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 @@ PlainTextFileDecoder::seek (ContentTime time, bool accurate)
}
bool
-PlainTextFileDecoder::pass ()
+TextCaptionFileDecoder::pass ()
{
if (_next >= _subtitles.size ()) {
return true;
@@ -80,7 +80,7 @@ PlainTextFileDecoder::pass ()
}
ContentTimePeriod
-PlainTextFileDecoder::content_time_period (sub::Subtitle s) const
+TextCaptionFileDecoder::content_time_period (sub::Subtitle s) const
{
return ContentTimePeriod (
ContentTime::from_seconds (s.from.all_as_seconds()),
diff --git a/src/lib/plain_text_file_decoder.h b/src/lib/text_caption_file_decoder.h
index ea64a294b..7f889e72d 100644
--- a/src/lib/plain_text_file_decoder.h
+++ b/src/lib/text_caption_file_decoder.h
@@ -24,13 +24,13 @@
#include "plain_text_file.h"
#include "decoder.h"
-class PlainTextFileContent;
+class TextCaptionFileContent;
class Log;
-class PlainTextFileDecoder : public Decoder, public PlainTextFile
+class TextCaptionFileDecoder : public Decoder, public TextCaptionFile
{
public:
- PlainTextFileDecoder (boost::shared_ptr<const PlainTextFileContent>, boost::shared_ptr<Log> log);
+ TextCaptionFileDecoder (boost::shared_ptr<const TextCaptionFileContent>, boost::shared_ptr<Log> log);
void seek (ContentTime time, bool accurate);
bool pass ();
diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc
index 2423fc738..932a57564 100644
--- a/src/lib/text_decoder.cc
+++ b/src/lib/text_decoder.cc
@@ -60,7 +60,7 @@ TextDecoder::TextDecoder (
void
TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<Image> image, dcpomatic::Rect<double> rect)
{
- BitmapStart (ContentBitmapText (from, _content->type(), image, rect));
+ BitmapStart (ContentBitmapCaption (from, _content->type(), image, rect));
_position = from;
}
@@ -94,7 +94,7 @@ TextDecoder::emit_plain_start (ContentTime from, list<dcp::SubtitleString> s)
}
}
- PlainStart (ContentPlainText (from, _content->type(), s));
+ PlainStart (ContentTextCaption (from, _content->type(), s));
_position = from;
}
diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h
index 96eba80e2..ed2763916 100644
--- a/src/lib/text_decoder.h
+++ b/src/lib/text_decoder.h
@@ -62,8 +62,8 @@ public:
return _content;
}
- boost::signals2::signal<void (ContentBitmapText)> BitmapStart;
- boost::signals2::signal<void (ContentPlainText)> PlainStart;
+ boost::signals2::signal<void (ContentBitmapCaption)> BitmapStart;
+ boost::signals2::signal<void (ContentTextCaption)> PlainStart;
boost::signals2::signal<void (ContentTime, TextType)> Stop;
private:
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 7b2944d32..ea4a6d29b 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 (PlayerText text, TextType type, DCPTimePeriod period)
+Writer::write (PlayerCaption text, TextType type, DCPTimePeriod period)
{
while (_text_reel[type]->period().to <= period.from) {
++_text_reel[type];
diff --git a/src/lib/writer.h b/src/lib/writer.h
index 484ca1285..a776e54c3 100644
--- a/src/lib/writer.h
+++ b/src/lib/writer.h
@@ -23,7 +23,7 @@
*/
#include "types.h"
-#include "player_text.h"
+#include "player_caption.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 (PlayerText text, TextType type, DCPTimePeriod period);
+ void write (PlayerCaption 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 ddbc1d4ff..71c94c28b 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -21,7 +21,7 @@ import os
import i18n
sources = """
- active_text.cc
+ active_captions.cc
analyse_audio_job.cc
atmos_mxf_content.cc
audio_analysis.cc
@@ -112,7 +112,7 @@ sources = """
mid_side_decoder.cc
overlaps.cc
player.cc
- player_text.cc
+ player_caption.cc
player_video.cc
playlist.cc
position_image.cc
@@ -135,8 +135,8 @@ sources = """
text_content.cc
text_decoder.cc
plain_text_file.cc
- plain_text_file_content.cc
- plain_text_file_decoder.cc
+ text_caption_file_content.cc
+ text_caption_file_decoder.cc
timer.cc
transcode_job.cc
types.cc
diff --git a/src/wx/caption_panel.cc b/src/wx/caption_panel.cc
index c4a71677b..20a0ad143 100644
--- a/src/wx/caption_panel.cc
+++ b/src/wx/caption_panel.cc
@@ -26,10 +26,10 @@
#include "fonts_dialog.h"
#include "subtitle_appearance_dialog.h"
#include "lib/ffmpeg_content.h"
-#include "lib/plain_text_file_content.h"
+#include "lib/text_caption_file_content.h"
#include "lib/ffmpeg_subtitle_stream.h"
#include "lib/dcp_text_content.h"
-#include "lib/plain_text_file_decoder.h"
+#include "lib/text_caption_file_decoder.h"
#include "lib/dcp_text_decoder.h"
#include "lib/dcp_content.h"
#include "lib/text_content.h"
@@ -303,7 +303,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 PlainTextFileContent> sc = boost::dynamic_pointer_cast<const PlainTextFileContent> (i);
+ shared_ptr<const TextCaptionFileContent> sc = boost::dynamic_pointer_cast<const TextCaptionFileContent> (i);
shared_ptr<const DCPContent> dc = boost::dynamic_pointer_cast<const DCPContent> (i);
shared_ptr<const DCPTextContent> dsc = boost::dynamic_pointer_cast<const DCPTextContent> (i);
if (fc) {
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 770015292..3dc0e2b63 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -39,7 +39,7 @@
#include "lib/config.h"
#include "lib/log.h"
#include "lib/compose.hpp"
-#include "lib/plain_text_file_content.h"
+#include "lib/text_caption_file_content.h"
#include "lib/plain_text_file.h"
#include <wx/wx.h>
#include <wx/notebook.h>
@@ -258,11 +258,11 @@ ContentPanel::selection_changed ()
BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
DCPTime p;
p = i->position();
- if (dynamic_pointer_cast<PlainTextFileContent>(i) && i->paths_valid()) {
+ if (dynamic_pointer_cast<TextCaptionFileContent>(i) && i->paths_valid()) {
/* Rather special case; if we select a text subtitle file jump to its
first subtitle.
*/
- PlainTextFile ts (dynamic_pointer_cast<PlainTextFileContent>(i));
+ TextCaptionFile ts (dynamic_pointer_cast<TextCaptionFileContent>(i));
if (ts.first()) {
p += DCPTime(ts.first().get(), _film->active_frame_rate_change(i->position()));
}
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index 77109909f..de6f1c8e8 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -20,7 +20,7 @@
#include "subtitle_appearance_dialog.h"
#include "rgba_colour_picker.h"
-#include "lib/plain_text_file_content.h"
+#include "lib/text_caption_file_content.h"
#include "lib/text_content.h"
#include "lib/ffmpeg_subtitle_stream.h"
#include "lib/ffmpeg_content.h"
diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc
index b2e74eb88..f33d6eddf 100644
--- a/src/wx/subtitle_view.cc
+++ b/src/wx/subtitle_view.cc
@@ -18,13 +18,13 @@
*/
-#include "lib/plain_text_file_decoder.h"
+#include "lib/text_caption_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/plain_text_file_content.h"
+#include "lib/text_caption_file_content.h"
#include "lib/text_decoder.h"
#include "subtitle_view.h"
#include "film_viewer.h"
@@ -92,7 +92,7 @@ SubtitleView::SubtitleView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<
}
void
-SubtitleView::data_start (ContentPlainText cts)
+SubtitleView::data_start (ContentTextCaption cts)
{
BOOST_FOREACH (dcp::SubtitleString const & i, cts.subs) {
wxListItem list_item;
diff --git a/src/wx/subtitle_view.h b/src/wx/subtitle_view.h
index 7272c608c..222fc3890 100644
--- a/src/wx/subtitle_view.h
+++ b/src/wx/subtitle_view.h
@@ -32,7 +32,7 @@ public:
SubtitleView (wxWindow *, boost::shared_ptr<Film>, boost::shared_ptr<Content> content, boost::shared_ptr<Decoder>, FilmViewer* viewer);
private:
- void data_start (ContentPlainText cts);
+ void data_start (ContentTextCaption cts);
void data_stop (ContentTime time);
void subtitle_selected (wxListEvent &);
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index 93ac02784..2a97f405f 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -29,7 +29,7 @@
#include "lib/text_content.h"
#include "lib/dcp_text_content.h"
#include "lib/audio_content.h"
-#include "lib/plain_text_file_content.h"
+#include "lib/text_caption_file_content.h"
#include "lib/video_content.h"
#include <dcp/locale_convert.h>
#include <boost/foreach.hpp>