More renaming; text -> plain.
authorCarl Hetherington <cth@carlh.net>
Wed, 18 Jul 2018 22:40:25 +0000 (23:40 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 19 Jul 2018 22:36:56 +0000 (23:36 +0100)
sed -i "s/TextTextContent/PlainText/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/wx/*.h src/tools/*.cc test/*.cc
sed -i "s/text_text/plain_text/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/wx/*.h src/tools/*.cc test/*.cc src/lib/wscript
mv src/lib/text_text_content.cc src/lib/plain_text_content.cc
mv src/lib/text_text_content.h src/lib/plain_text_content.h
mv src/lib/text_text_decoder.cc src/lib/plain_text_decoder.cc
mv src/lib/text_text_decoder.h src/lib/plain_text_decoder.h

27 files changed:
src/lib/content_factory.cc
src/lib/decoder_factory.cc
src/lib/plain_text_content.cc [new file with mode: 0644]
src/lib/plain_text_content.h [new file with mode: 0644]
src/lib/plain_text_decoder.cc [new file with mode: 0644]
src/lib/plain_text_decoder.h [new file with mode: 0644]
src/lib/text_file.h
src/lib/text_subtitle.cc
src/lib/text_subtitle.h
src/lib/text_text_content.cc [deleted file]
src/lib/text_text_content.h [deleted file]
src/lib/text_text_decoder.cc [deleted file]
src/lib/text_text_decoder.h [deleted file]
src/lib/wscript
src/wx/content_panel.cc
src/wx/subtitle_appearance_dialog.cc
src/wx/subtitle_panel.cc
src/wx/subtitle_view.cc
src/wx/timing_panel.cc
test/burnt_subtitle_test.cc
test/ffmpeg_encoder_test.cc
test/player_test.cc
test/reels_test.cc
test/srt_subtitle_test.cc
test/ssa_subtitle_test.cc
test/subtitle_charset_test.cc
test/subtitle_reel_number_test.cc

index 14ca579e934593ccffac1fd165fce88eef84d80c..24ad9557807416624eb0e083663ad1691fd2ab46 100644 (file)
@@ -26,7 +26,7 @@
 #include "audio_content.h"
 #include "image_content.h"
 #include "atmos_mxf_content.h"
-#include "text_text_content.h"
+#include "plain_text_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 TextTextContent (film, node, version));
+               content.reset (new PlainText (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 TextTextContent (film, path));
+                       single.reset (new PlainText (film, path));
                } else if (ext == ".xml") {
                        cxml::Document doc;
                        doc.read_file (path);
index 1a0af1b2c07cdfb834566f6ec5a470153f6015b6..4301edd17bf814b2336a7c9d866fe7013b7277a4 100644 (file)
@@ -24,8 +24,8 @@
 #include "dcp_decoder.h"
 #include "image_content.h"
 #include "image_decoder.h"
-#include "text_text_content.h"
-#include "text_text_decoder.h"
+#include "plain_text_content.h"
+#include "plain_text_decoder.h"
 #include "dcp_text_content.h"
 #include "dcp_text_decoder.h"
 #include "video_mxf_content.h"
@@ -54,7 +54,7 @@ decoder_factory (shared_ptr<const Content> content, shared_ptr<Log> log, bool fa
                return shared_ptr<Decoder> (new ImageDecoder (ic, log));
        }
 
-       shared_ptr<const TextTextContent> rc = dynamic_pointer_cast<const TextTextContent> (content);
+       shared_ptr<const PlainText> rc = dynamic_pointer_cast<const PlainText> (content);
        if (rc) {
                return shared_ptr<Decoder> (new TextTextDecoder (rc, log));
        }
diff --git a/src/lib/plain_text_content.cc b/src/lib/plain_text_content.cc
new file mode 100644 (file)
index 0000000..6ca783c
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "plain_text_content.h"
+#include "util.h"
+#include "text_subtitle.h"
+#include "film.h"
+#include "font.h"
+#include "text_content.h"
+#include <dcp/raw_convert.h>
+#include <libxml++/libxml++.h>
+#include <iostream>
+
+#include "i18n.h"
+
+using std::string;
+using std::cout;
+using boost::shared_ptr;
+using dcp::raw_convert;
+
+PlainText::PlainText (shared_ptr<const Film> film, boost::filesystem::path path)
+       : Content (film, path)
+{
+       subtitle.reset (new TextContent (this));
+}
+
+PlainText::PlainText (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
+       : Content (film, node)
+       , _length (node->number_child<ContentTime::Type> ("Length"))
+{
+       subtitle = TextContent::from_xml (this, node, version);
+}
+
+void
+PlainText::examine (boost::shared_ptr<Job> job)
+{
+       Content::examine (job);
+       TextSubtitle s (shared_from_this ());
+
+       /* Default to turning these subtitles on */
+       subtitle->set_use (true);
+
+       boost::mutex::scoped_lock lm (_mutex);
+       _length = s.length ();
+       subtitle->add_font (shared_ptr<Font> (new Font (TEXT_FONT_ID)));
+}
+
+string
+PlainText::summary () const
+{
+       return path_summary() + " " + _("[subtitles]");
+}
+
+string
+PlainText::technical_summary () const
+{
+       return Content::technical_summary() + " - " + _("Text subtitles");
+}
+
+void
+PlainText::as_xml (xmlpp::Node* node, bool with_paths) const
+{
+       node->add_child("Type")->add_child_text ("TextSubtitle");
+       Content::as_xml (node, with_paths);
+
+       if (subtitle) {
+               subtitle->as_xml (node);
+       }
+
+       node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));
+}
+
+DCPTime
+PlainText::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_content.h b/src/lib/plain_text_content.h
new file mode 100644 (file)
index 0000000..7a7ef66
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "content.h"
+
+class Job;
+
+/** @class PlainText
+ *  @brief SubRip or SSA subtitles.
+ */
+class PlainText : public Content
+{
+public:
+       PlainText (boost::shared_ptr<const Film>, boost::filesystem::path);
+       PlainText (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+
+       boost::shared_ptr<PlainText> shared_from_this () {
+               return boost::dynamic_pointer_cast<PlainText> (Content::shared_from_this ());
+       }
+
+       void examine (boost::shared_ptr<Job>);
+       std::string summary () const;
+       std::string technical_summary () const;
+       void as_xml (xmlpp::Node *, bool with_paths) const;
+       DCPTime full_length () const;
+
+private:
+       ContentTime _length;
+};
diff --git a/src/lib/plain_text_decoder.cc b/src/lib/plain_text_decoder.cc
new file mode 100644 (file)
index 0000000..71f7bed
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "plain_text_decoder.h"
+#include "plain_text_content.h"
+#include "text_content.h"
+#include <dcp/subtitle_string.h>
+#include <boost/foreach.hpp>
+#include <iostream>
+
+using std::list;
+using std::vector;
+using std::string;
+using std::cout;
+using std::max;
+using boost::shared_ptr;
+using boost::optional;
+using boost::dynamic_pointer_cast;
+
+TextTextDecoder::TextTextDecoder (shared_ptr<const PlainText> content, shared_ptr<Log> log)
+       : TextSubtitle (content)
+       , _next (0)
+{
+       ContentTime first;
+       if (!_subtitles.empty()) {
+               first = content_time_period(_subtitles[0]).from;
+       }
+       subtitle.reset (new TextDecoder (this, content->subtitle, log, first));
+}
+
+void
+TextTextDecoder::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.
+       */
+       time -= ContentTime::from_seconds (5);
+       if (time < ContentTime()) {
+               time = ContentTime();
+       }
+
+       Decoder::seek (time, accurate);
+
+       _next = 0;
+       while (_next < _subtitles.size() && ContentTime::from_seconds (_subtitles[_next].from.all_as_seconds ()) < time) {
+               ++_next;
+       }
+}
+
+bool
+TextTextDecoder::pass ()
+{
+       if (_next >= _subtitles.size ()) {
+               return true;
+       }
+
+       ContentTimePeriod const p = content_time_period (_subtitles[_next]);
+       subtitle->emit_text (p, _subtitles[_next]);
+
+       ++_next;
+       return false;
+}
+
+ContentTimePeriod
+TextTextDecoder::content_time_period (sub::Subtitle s) const
+{
+       return ContentTimePeriod (
+               ContentTime::from_seconds (s.from.all_as_seconds()),
+               ContentTime::from_seconds (s.to.all_as_seconds())
+               );
+}
diff --git a/src/lib/plain_text_decoder.h b/src/lib/plain_text_decoder.h
new file mode 100644 (file)
index 0000000..4bdedf5
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DCPOMATIC_TEXT_SUBTITLE_DECODER_H
+#define DCPOMATIC_TEXT_SUBTITLE_DECODER_H
+
+#include "text_decoder.h"
+#include "text_subtitle.h"
+
+class PlainText;
+
+class TextTextDecoder : public Decoder, public TextSubtitle
+{
+public:
+       TextTextDecoder (boost::shared_ptr<const PlainText>, boost::shared_ptr<Log> log);
+
+       void seek (ContentTime time, bool accurate);
+       bool pass ();
+
+private:
+       ContentTimePeriod content_time_period (sub::Subtitle s) const;
+
+       size_t _next;
+};
+
+#endif
index 346571fc1e743bf1a43d24e899d703d6915f7dd2..8cf0d3eaef736767c62044fdf344317afbad8180 100644 (file)
@@ -29,7 +29,7 @@
 class TextFileContent;
 class text_file_time_test;
 class text_file_coordinate_test;
-class text_text_content_test;
+class plain_text_content_test;
 class text_file_parse_test;
 
 class TextFile
index 35acb90228bc42d0f9cc4b7827b7d883d6420b31..35801e160557a8d21057583758415eceb70d7cb2 100644 (file)
@@ -21,7 +21,7 @@
 #include "text_subtitle.h"
 #include "cross.h"
 #include "exceptions.h"
-#include "text_text_content.h"
+#include "plain_text_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;
 
-TextSubtitle::TextSubtitle (shared_ptr<const TextTextContent> content)
+TextSubtitle::TextSubtitle (shared_ptr<const PlainText> content)
 {
        Data in (content->path (0));
 
index 0cd33c9fb078eb9af4257746be3c3589a3dbc2df..60571a4397ece1a4adc6710395a29ad573eccfe8 100644 (file)
 #include <boost/shared_ptr.hpp>
 #include <vector>
 
-class TextTextContent;
+class PlainText;
 class text_subtitle_time_test;
 class text_subtitle_coordinate_test;
-class text_text_content_test;
+class plain_text_content_test;
 class text_subtitle_parse_test;
 
 class TextSubtitle
 {
 public:
-       explicit TextSubtitle (boost::shared_ptr<const TextTextContent>);
+       explicit TextSubtitle (boost::shared_ptr<const PlainText>);
 
        boost::optional<ContentTime> first () const;
        ContentTime length () const;
diff --git a/src/lib/text_text_content.cc b/src/lib/text_text_content.cc
deleted file mode 100644 (file)
index 1ff66c4..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "text_text_content.h"
-#include "util.h"
-#include "text_subtitle.h"
-#include "film.h"
-#include "font.h"
-#include "text_content.h"
-#include <dcp/raw_convert.h>
-#include <libxml++/libxml++.h>
-#include <iostream>
-
-#include "i18n.h"
-
-using std::string;
-using std::cout;
-using boost::shared_ptr;
-using dcp::raw_convert;
-
-TextTextContent::TextTextContent (shared_ptr<const Film> film, boost::filesystem::path path)
-       : Content (film, path)
-{
-       subtitle.reset (new TextContent (this));
-}
-
-TextTextContent::TextTextContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
-       : Content (film, node)
-       , _length (node->number_child<ContentTime::Type> ("Length"))
-{
-       subtitle = TextContent::from_xml (this, node, version);
-}
-
-void
-TextTextContent::examine (boost::shared_ptr<Job> job)
-{
-       Content::examine (job);
-       TextSubtitle s (shared_from_this ());
-
-       /* Default to turning these subtitles on */
-       subtitle->set_use (true);
-
-       boost::mutex::scoped_lock lm (_mutex);
-       _length = s.length ();
-       subtitle->add_font (shared_ptr<Font> (new Font (TEXT_FONT_ID)));
-}
-
-string
-TextTextContent::summary () const
-{
-       return path_summary() + " " + _("[subtitles]");
-}
-
-string
-TextTextContent::technical_summary () const
-{
-       return Content::technical_summary() + " - " + _("Text subtitles");
-}
-
-void
-TextTextContent::as_xml (xmlpp::Node* node, bool with_paths) const
-{
-       node->add_child("Type")->add_child_text ("TextSubtitle");
-       Content::as_xml (node, with_paths);
-
-       if (subtitle) {
-               subtitle->as_xml (node);
-       }
-
-       node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));
-}
-
-DCPTime
-TextTextContent::full_length () const
-{
-       FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate ());
-       return DCPTime (_length, frc);
-}
diff --git a/src/lib/text_text_content.h b/src/lib/text_text_content.h
deleted file mode 100644 (file)
index ccc86fb..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "content.h"
-
-class Job;
-
-/** @class TextTextContent
- *  @brief SubRip or SSA subtitles.
- */
-class TextTextContent : public Content
-{
-public:
-       TextTextContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       TextTextContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
-
-       boost::shared_ptr<TextTextContent> shared_from_this () {
-               return boost::dynamic_pointer_cast<TextTextContent> (Content::shared_from_this ());
-       }
-
-       void examine (boost::shared_ptr<Job>);
-       std::string summary () const;
-       std::string technical_summary () const;
-       void as_xml (xmlpp::Node *, bool with_paths) const;
-       DCPTime full_length () const;
-
-private:
-       ContentTime _length;
-};
diff --git a/src/lib/text_text_decoder.cc b/src/lib/text_text_decoder.cc
deleted file mode 100644 (file)
index 2ae5cd3..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "text_text_decoder.h"
-#include "text_text_content.h"
-#include "text_content.h"
-#include <dcp/subtitle_string.h>
-#include <boost/foreach.hpp>
-#include <iostream>
-
-using std::list;
-using std::vector;
-using std::string;
-using std::cout;
-using std::max;
-using boost::shared_ptr;
-using boost::optional;
-using boost::dynamic_pointer_cast;
-
-TextTextDecoder::TextTextDecoder (shared_ptr<const TextTextContent> content, shared_ptr<Log> log)
-       : TextSubtitle (content)
-       , _next (0)
-{
-       ContentTime first;
-       if (!_subtitles.empty()) {
-               first = content_time_period(_subtitles[0]).from;
-       }
-       subtitle.reset (new TextDecoder (this, content->subtitle, log, first));
-}
-
-void
-TextTextDecoder::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.
-       */
-       time -= ContentTime::from_seconds (5);
-       if (time < ContentTime()) {
-               time = ContentTime();
-       }
-
-       Decoder::seek (time, accurate);
-
-       _next = 0;
-       while (_next < _subtitles.size() && ContentTime::from_seconds (_subtitles[_next].from.all_as_seconds ()) < time) {
-               ++_next;
-       }
-}
-
-bool
-TextTextDecoder::pass ()
-{
-       if (_next >= _subtitles.size ()) {
-               return true;
-       }
-
-       ContentTimePeriod const p = content_time_period (_subtitles[_next]);
-       subtitle->emit_text (p, _subtitles[_next]);
-
-       ++_next;
-       return false;
-}
-
-ContentTimePeriod
-TextTextDecoder::content_time_period (sub::Subtitle s) const
-{
-       return ContentTimePeriod (
-               ContentTime::from_seconds (s.from.all_as_seconds()),
-               ContentTime::from_seconds (s.to.all_as_seconds())
-               );
-}
diff --git a/src/lib/text_text_decoder.h b/src/lib/text_text_decoder.h
deleted file mode 100644 (file)
index daaf2fc..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_TEXT_SUBTITLE_DECODER_H
-#define DCPOMATIC_TEXT_SUBTITLE_DECODER_H
-
-#include "text_decoder.h"
-#include "text_subtitle.h"
-
-class TextTextContent;
-
-class TextTextDecoder : public Decoder, public TextSubtitle
-{
-public:
-       TextTextDecoder (boost::shared_ptr<const TextTextContent>, boost::shared_ptr<Log> log);
-
-       void seek (ContentTime time, bool accurate);
-       bool pass ();
-
-private:
-       ContentTimePeriod content_time_period (sub::Subtitle s) const;
-
-       size_t _next;
-};
-
-#endif
index 4a7132e48d3a444ed96f2fea405fb3cf87d0e233..b3e04e28b24de5275facf96e9c14fad52d615cd9 100644 (file)
@@ -135,8 +135,8 @@ sources = """
           text_content.cc
           text_decoder.cc
           text_subtitle.cc
-          text_text_content.cc
-          text_text_decoder.cc
+          plain_text_content.cc
+          plain_text_decoder.cc
           timer.cc
           transcode_job.cc
           types.cc
index 2c0f35f6cae478dc6d1d3dc42a53b8a1c9f3665e..225ac5d6b22ebf6a6b836766df2697555c2d4ee7 100644 (file)
@@ -39,7 +39,7 @@
 #include "lib/config.h"
 #include "lib/log.h"
 #include "lib/compose.hpp"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/text_subtitle.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<TextTextContent>(i) && i->paths_valid()) {
+               if (dynamic_pointer_cast<PlainText>(i) && i->paths_valid()) {
                        /* Rather special case; if we select a text subtitle file jump to its
                           first subtitle.
                        */
-                       TextSubtitle ts (dynamic_pointer_cast<TextTextContent>(i));
+                       TextSubtitle ts (dynamic_pointer_cast<PlainText>(i));
                        if (ts.first()) {
                                p += DCPTime(ts.first().get(), _film->active_frame_rate_change(i->position()));
                        }
index f78ed9ab5ed4b585640e9e9cbd849661bb242f0e..eb13a8f2762bf2ae610f5d35c4be617d97a2fab1 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "subtitle_appearance_dialog.h"
 #include "rgba_colour_picker.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/text_content.h"
 #include "lib/ffmpeg_subtitle_stream.h"
 #include "lib/ffmpeg_content.h"
index da7891ca8eb1f41d44acd6f4594340dbbc6f550a..3308f40e9d70129425baab41256a7e1be0109d72 100644 (file)
 #include "fonts_dialog.h"
 #include "subtitle_appearance_dialog.h"
 #include "lib/ffmpeg_content.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/ffmpeg_subtitle_stream.h"
 #include "lib/dcp_text_content.h"
-#include "lib/text_text_decoder.h"
+#include "lib/plain_text_decoder.h"
 #include "lib/dcp_text_decoder.h"
 #include "lib/dcp_content.h"
 #include "lib/text_content.h"
@@ -265,7 +265,7 @@ SubtitlePanel::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 TextTextContent> sc = boost::dynamic_pointer_cast<const TextTextContent> (i);
+               shared_ptr<const PlainText> sc = boost::dynamic_pointer_cast<const PlainText> (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) {
index 7efe10d0ce2c48cd2c8b0b396a50b419b493bd64..eb63ca443106643c4265ccf4b5d5d5961830bf26 100644 (file)
 
 */
 
-#include "lib/text_text_decoder.h"
+#include "lib/plain_text_decoder.h"
 #include "lib/content_subtitle.h"
 #include "lib/video_decoder.h"
 #include "lib/audio_decoder.h"
 #include "lib/film.h"
 #include "lib/config.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "subtitle_view.h"
 #include "film_viewer.h"
 #include "wx_util.h"
index 315ead52430eb641339f964a8e2385fb01f6ae81..67a6596854c2df08c04d1adf01128b03f03e9e25 100644 (file)
@@ -29,7 +29,7 @@
 #include "lib/text_content.h"
 #include "lib/dcp_text_content.h"
 #include "lib/audio_content.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/video_content.h"
 #include <dcp/locale_convert.h>
 #include <boost/foreach.hpp>
index f0e60284b18d3a8a224af5b072e7e4c1cfe0a66e..e01e1e3d180e9dd96a74231f97116f87155ce44f 100644 (file)
@@ -23,7 +23,7 @@
  *  @ingroup specific
  */
 
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/dcp_text_content.h"
 #include "lib/film.h"
 #include "lib/ratio.h"
@@ -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<TextTextContent> content (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> content (new PlainText (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<TextTextContent> sub = dynamic_pointer_cast<TextTextContent> (
+       shared_ptr<PlainText> sub = dynamic_pointer_cast<PlainText> (
                content_factory(film2, "test/data/subrip2.srt").front()
                );
        sub->subtitle->set_burn (true);
index cfe607b8df5fd74b8e86bc0d64f92e643a01ee38..65f98ed1a59a80b97b1003408c0dbd49af7e9287 100644 (file)
@@ -24,7 +24,7 @@
 #include "lib/image_content.h"
 #include "lib/video_content.h"
 #include "lib/audio_content.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/ratio.h"
 #include "lib/transcode_job.h"
 #include "lib/dcp_content.h"
@@ -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<TextTextContent> s (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> s (new PlainText (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->subtitle->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<TextTextContent> s (new TextTextContent (film, "test/data/subrip.srt"));
+       shared_ptr<PlainText> s (new PlainText (film, "test/data/subrip.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->subtitle->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<TextTextContent> s (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> s (new PlainText (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->subtitle->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<TextTextContent> s (new TextTextContent (film, "test/data/subrip.srt"));
+       shared_ptr<PlainText> s (new PlainText (film, "test/data/subrip.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
        s->subtitle->set_colour (dcp::Colour (255, 255, 0));
index f59205e16693357b0371b3ff692b1aff96f49348..915dab4f74a065d96562ef0fe0d10473b86b2f2a 100644 (file)
@@ -31,7 +31,7 @@
 #include "lib/player.h"
 #include "lib/video_content.h"
 #include "lib/image_content.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/content_factory.h"
 #include "lib/dcp_content.h"
 #include "lib/text_content.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<TextTextContent> s (new TextTextContent (film, "test/data/subrip.srt"));
+       shared_ptr<PlainText> s (new PlainText (film, "test/data/subrip.srt"));
        film->examine_and_add_content (s);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index f793cef1d32f4ec5355cf1b7352dbb0394c26b17..2949adc73309c45a1387a9dfa26ea8bce85fa99a 100644 (file)
@@ -30,7 +30,7 @@
 #include "lib/dcp_content_type.h"
 #include "lib/dcp_content.h"
 #include "lib/video_content.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_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 TextTextContent (film, "test/data/subrip.srt"));
+       shared_ptr<Content> sub (new PlainText (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<TextTextContent> subs (new TextTextContent (film, "test/data/subrip3.srt"));
+       shared_ptr<PlainText> subs (new PlainText (film, "test/data/subrip3.srt"));
        film->examine_and_add_content (subs);
        wait_for_jobs ();
 
index d931cf8033e4400f22caa42e44e97e1087bfcd40..199af34ad1c3b0f2bb640c508ad32c11a4ef41d6 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "lib/film.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/dcp_content_type.h"
 #include "lib/font.h"
 #include "lib/ratio.h"
@@ -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<TextTextContent> content (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> content (new PlainText (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<TextTextContent> content (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> content (new PlainText (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<TextTextContent> content (new TextTextContent (film, private_data / "Ankoemmling_short.srt"));
+       shared_ptr<PlainText> content (new PlainText (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<TextTextContent> content (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> content (new PlainText (film, "test/data/subrip2.srt"));
        content->subtitle->set_use (true);
        content->subtitle->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<TextTextContent> content (new TextTextContent (film, "test/data/subrip2.srt"));
+       shared_ptr<PlainText> content (new PlainText (film, "test/data/subrip2.srt"));
        content->subtitle->set_use (true);
        content->subtitle->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<TextTextContent> content (new TextTextContent (film, "test/data/frames.srt"));
+       shared_ptr<PlainText> content (new PlainText (film, "test/data/frames.srt"));
        content->subtitle->set_use (true);
        content->subtitle->set_burn (false);
        film->examine_and_add_content (content);
@@ -185,7 +185,7 @@ 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<TextTextContent> content (new TextTextContent (film, "test/data/subrip.srt"));
+       shared_ptr<PlainText> content (new PlainText (film, "test/data/subrip.srt"));
        content->examine (shared_ptr<Job> (), true);
        BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471));
 
index b8d7a7c911e44ec9eb676916b831ff6c65b11888..7e2233cca9fc83d3e4f92495309d42f4c6a5e92f 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "lib/film.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/dcp_content_type.h"
 #include "lib/font.h"
 #include "lib/ratio.h"
@@ -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<TextTextContent> content (new TextTextContent (film, private_data / "DKH_UT_EN20160601def.ssa"));
+       shared_ptr<PlainText> content (new PlainText (film, private_data / "DKH_UT_EN20160601def.ssa"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
index 828411c9b5236d9fb1995980a45334328f0c80f7..9b2de21327578b0ffdde57b29f5407360a6a7790 100644 (file)
@@ -23,7 +23,7 @@
 #include "lib/film.h"
 #include "lib/content_factory.h"
 #include "lib/text_subtitle.h"
-#include "lib/text_text_content.h"
+#include "lib/plain_text_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<TextTextContent> ts = dynamic_pointer_cast<TextTextContent> (content);
+       shared_ptr<PlainText> ts = dynamic_pointer_cast<PlainText> (content);
        BOOST_REQUIRE (ts);
        /* Make sure we got the subtitle data from the file */
        BOOST_REQUIRE_EQUAL (content->full_length().get(), 6052032);
index 749ef9e73773d798b2da70b79f76a47b6ea9fdb8..d150e90dd5819873bd8eb3ad2c1aab594445fcde 100644 (file)
@@ -18,7 +18,7 @@
 
 */
 
-#include "lib/text_text_content.h"
+#include "lib/plain_text_content.h"
 #include "lib/film.h"
 #include "lib/ratio.h"
 #include "lib/text_content.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<TextTextContent> content (new TextTextContent (film, "test/data/subrip5.srt"));
+       shared_ptr<PlainText> content (new PlainText (film, "test/data/subrip5.srt"));
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->subtitle->set_use (true);