From 80400212e939dc2f3b987cb6df57709929aa5178 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 12 Feb 2016 00:13:14 +0000 Subject: [PATCH] Rename SubRip -> TextSubtitle. --- src/lib/content_factory.cc | 10 ++-- src/lib/exceptions.cc | 4 +- src/lib/exceptions.h | 8 +-- src/lib/player.cc | 16 +++--- src/lib/{subrip.cc => text_subtitle.cc} | 10 ++-- src/lib/{subrip.h => text_subtitle.h} | 20 ++++---- ...ip_content.cc => text_subtitle_content.cc} | 50 +++++++++---------- ...brip_content.h => text_subtitle_content.h} | 18 +++---- ...ip_decoder.cc => text_subtitle_decoder.cc} | 24 ++++----- ...brip_decoder.h => text_subtitle_decoder.h} | 14 +++--- src/lib/wscript | 6 +-- src/wx/subtitle_appearance_dialog.cc | 4 +- src/wx/subtitle_appearance_dialog.h | 6 +-- src/wx/subtitle_panel.cc | 22 ++++---- src/wx/subtitle_view.cc | 4 +- src/wx/timing_panel.cc | 8 +-- test/burnt_subtitle_test.cc | 4 +- test/reels_test.cc | 6 +-- test/srt_subtitle_test.cc | 8 +-- test/subrip_test.cc | 2 +- test/xml_subtitle_test.cc | 4 +- 21 files changed, 124 insertions(+), 124 deletions(-) rename src/lib/{subrip.cc => text_subtitle.cc} (91%) rename src/lib/{subrip.h => text_subtitle.h} (71%) rename src/lib/{subrip_content.cc => text_subtitle_content.cc} (71%) rename src/lib/{subrip_content.h => text_subtitle_content.h} (78%) rename src/lib/{subrip_decoder.cc => text_subtitle_decoder.cc} (81%) rename src/lib/{subrip_decoder.h => text_subtitle_decoder.h} (77%) diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 3aa8ca9d3..2b17d69e4 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -24,7 +24,7 @@ #include "ffmpeg_content.h" #include "image_content.h" #include "sndfile_content.h" -#include "subrip_content.h" +#include "text_subtitle_content.h" #include "dcp_content.h" #include "dcp_subtitle_content.h" #include "util.h" @@ -56,8 +56,8 @@ content_factory (shared_ptr film, cxml::NodePtr node, int version, l content.reset (new ImageContent (film, node, version)); } else if (type == "Sndfile") { content.reset (new SndfileContent (film, node, version)); - } else if (type == "SubRip") { - content.reset (new SubRipContent (film, node, version)); + } else if (type == "SubRip" || type == "TextSubtitle") { + content.reset (new TextSubtitleContent (film, node, version)); } else if (type == "DCP") { content.reset (new DCPContent (film, node, version)); } else if (type == "DCPSubtitle") { @@ -118,8 +118,8 @@ content_factory (shared_ptr film, boost::filesystem::path path) content.reset (new ImageContent (film, path)); } else if (SndfileContent::valid_file (path)) { content.reset (new SndfileContent (film, path)); - } else if (ext == ".srt") { - content.reset (new SubRipContent (film, path)); + } else if (ext == ".srt" || ext == ".ssa") { + content.reset (new TextSubtitleContent (film, path)); } else if (ext == ".xml") { content.reset (new DCPSubtitleContent (film, path)); } else if (ext == ".mxf" && dcp::SMPTESubtitleAsset::valid_mxf (path)) { diff --git a/src/lib/exceptions.cc b/src/lib/exceptions.cc index c15e134ee..968e81439 100644 --- a/src/lib/exceptions.cc +++ b/src/lib/exceptions.cc @@ -63,8 +63,8 @@ PixelFormatError::PixelFormatError (string o, AVPixelFormat f) } -SubRipError::SubRipError (string saw, string expecting, boost::filesystem::path f) - : FileError (String::compose (_("Error in SubRip file: saw %1 while expecting %2"), saw.empty() ? "[nothing]" : saw, expecting), f) +TextSubtitleError::TextSubtitleError (string saw, string expecting, boost::filesystem::path f) + : FileError (String::compose (_("Error in subtitle file: saw %1 while expecting %2"), saw.empty() ? "[nothing]" : saw, expecting), f) { } diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index da8761304..3e7289a50 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -211,13 +211,13 @@ public: PixelFormatError (std::string o, AVPixelFormat f); }; -/** @class SubRipError - * @brief An error that occurs while parsing a SubRip file. +/** @class TextSubtitleError + * @brief An error that occurs while parsing a TextSubtitleError file. */ -class SubRipError : public FileError +class TextSubtitleError : public FileError { public: - SubRipError (std::string, std::string, boost::filesystem::path); + TextSubtitleError (std::string, std::string, boost::filesystem::path); }; class DCPError : public std::runtime_error diff --git a/src/lib/player.cc b/src/lib/player.cc index ecf37b576..fc1332573 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -27,8 +27,8 @@ #include "sndfile_decoder.h" #include "sndfile_content.h" #include "subtitle_content.h" -#include "subrip_decoder.h" -#include "subrip_content.h" +#include "text_subtitle_decoder.h" +#include "text_subtitle_content.h" #include "dcp_content.h" #include "job.h" #include "image.h" @@ -174,10 +174,10 @@ Player::setup_pieces () as simultaneous video content (like we do with audio). */ - /* SubRipContent */ - shared_ptr rc = dynamic_pointer_cast (i); + /* TextSubtitleContent */ + shared_ptr rc = dynamic_pointer_cast (i); if (rc) { - decoder.reset (new SubRipDecoder (rc)); + decoder.reset (new TextSubtitleDecoder (rc)); frc = FrameRateChange (rc->subtitle_video_frame_rate(), _film->video_frame_rate()); } @@ -220,9 +220,9 @@ Player::playlist_content_changed (weak_ptr w, int property, bool freque property == ContentProperty::PATH || property == VideoContentProperty::VIDEO_FRAME_TYPE || property == DCPContentProperty::CAN_BE_PLAYED || - property == SubRipContentProperty::SUBTITLE_COLOUR || - property == SubRipContentProperty::SUBTITLE_OUTLINE || - property == SubRipContentProperty::SUBTITLE_OUTLINE_COLOUR + property == TextSubtitleContentProperty::TEXT_SUBTITLE_COLOUR || + property == TextSubtitleContentProperty::TEXT_SUBTITLE_OUTLINE || + property == TextSubtitleContentProperty::TEXT_SUBTITLE_OUTLINE_COLOUR ) { _have_valid_pieces = false; diff --git a/src/lib/subrip.cc b/src/lib/text_subtitle.cc similarity index 91% rename from src/lib/subrip.cc rename to src/lib/text_subtitle.cc index c4166cb28..d55ff68d7 100644 --- a/src/lib/subrip.cc +++ b/src/lib/text_subtitle.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,10 +17,10 @@ */ -#include "subrip.h" +#include "text_subtitle.h" #include "cross.h" #include "exceptions.h" -#include "subrip_content.h" +#include "text_subtitle_content.h" #include #include #include @@ -36,7 +36,7 @@ using boost::shared_ptr; using boost::scoped_array; using dcp::Data; -SubRip::SubRip (shared_ptr content) +TextSubtitle::TextSubtitle (shared_ptr content) { Data in (content->path (0)); @@ -70,7 +70,7 @@ SubRip::SubRip (shared_ptr content) } ContentTime -SubRip::length () const +TextSubtitle::length () const { if (_subtitles.empty ()) { return ContentTime (); diff --git a/src/lib/subrip.h b/src/lib/text_subtitle.h similarity index 71% rename from src/lib/subrip.h rename to src/lib/text_subtitle.h index 35687eb00..4614f6bd0 100644 --- a/src/lib/subrip.h +++ b/src/lib/text_subtitle.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,24 +17,24 @@ */ -#ifndef DCPOMATIC_SUBRIP_H -#define DCPOMATIC_SUBRIP_H +#ifndef DCPOMATIC_TEXT_SUBTITLE_H +#define DCPOMATIC_TEXT_SUBTITLE_H #include "dcpomatic_time.h" #include #include #include -class SubRipContent; -class subrip_time_test; -class subrip_coordinate_test; -class subrip_content_test; -class subrip_parse_test; +class TextSubtitleContent; +class text_subtitle_time_test; +class text_subtitle_coordinate_test; +class text_subtitle_content_test; +class text_subtitle_parse_test; -class SubRip +class TextSubtitle { public: - SubRip (boost::shared_ptr); + TextSubtitle (boost::shared_ptr); ContentTime length () const; diff --git a/src/lib/subrip_content.cc b/src/lib/text_subtitle_content.cc similarity index 71% rename from src/lib/subrip_content.cc rename to src/lib/text_subtitle_content.cc index a6eb07629..93ac1d091 100644 --- a/src/lib/subrip_content.cc +++ b/src/lib/text_subtitle_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +17,9 @@ */ -#include "subrip_content.h" +#include "text_subtitle_content.h" #include "util.h" -#include "subrip.h" +#include "text_subtitle.h" #include "film.h" #include "font.h" #include "raw_convert.h" @@ -33,13 +33,13 @@ using std::cout; using boost::shared_ptr; using boost::lexical_cast; -std::string const SubRipContent::font_id = "font"; +std::string const TextSubtitleContent::font_id = "font"; -int const SubRipContentProperty::SUBTITLE_COLOUR = 300; -int const SubRipContentProperty::SUBTITLE_OUTLINE = 301; -int const SubRipContentProperty::SUBTITLE_OUTLINE_COLOUR = 302; +int const TextSubtitleContentProperty::TEXT_SUBTITLE_COLOUR = 300; +int const TextSubtitleContentProperty::TEXT_SUBTITLE_OUTLINE = 301; +int const TextSubtitleContentProperty::TEXT_SUBTITLE_OUTLINE_COLOUR = 302; -SubRipContent::SubRipContent (shared_ptr film, boost::filesystem::path path) +TextSubtitleContent::TextSubtitleContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) , SubtitleContent (film, path) , _colour (255, 255, 255) @@ -49,7 +49,7 @@ SubRipContent::SubRipContent (shared_ptr film, boost::filesystem::pa } -SubRipContent::SubRipContent (shared_ptr film, cxml::ConstNodePtr node, int version) +TextSubtitleContent::TextSubtitleContent (shared_ptr film, cxml::ConstNodePtr node, int version) : Content (film, node) , SubtitleContent (film, node, version) , _length (node->number_child ("Length")) @@ -70,10 +70,10 @@ SubRipContent::SubRipContent (shared_ptr film, cxml::ConstNodePtr no } void -SubRipContent::examine (boost::shared_ptr job) +TextSubtitleContent::examine (boost::shared_ptr job) { Content::examine (job); - SubRip s (shared_from_this ()); + TextSubtitle s (shared_from_this ()); /* Default to turning these subtitles on */ set_use_subtitles (true); @@ -84,21 +84,21 @@ SubRipContent::examine (boost::shared_ptr job) } string -SubRipContent::summary () const +TextSubtitleContent::summary () const { return path_summary() + " " + _("[subtitles]"); } string -SubRipContent::technical_summary () const +TextSubtitleContent::technical_summary () const { - return Content::technical_summary() + " - " + _("SubRip subtitles"); + return Content::technical_summary() + " - " + _("Text subtitles"); } void -SubRipContent::as_xml (xmlpp::Node* node) const +TextSubtitleContent::as_xml (xmlpp::Node* node) const { - node->add_child("Type")->add_child_text ("SubRip"); + node->add_child("Type")->add_child_text ("TextSubtitle"); Content::as_xml (node); SubtitleContent::as_xml (node); node->add_child("Length")->add_child_text (raw_convert (_length.get ())); @@ -112,14 +112,14 @@ SubRipContent::as_xml (xmlpp::Node* node) const } DCPTime -SubRipContent::full_length () const +TextSubtitleContent::full_length () const { FrameRateChange const frc (subtitle_video_frame_rate(), film()->video_frame_rate ()); return DCPTime (_length, frc); } void -SubRipContent::set_subtitle_video_frame_rate (int r) +TextSubtitleContent::set_subtitle_video_frame_rate (int r) { { boost::mutex::scoped_lock lm (_mutex); @@ -130,7 +130,7 @@ SubRipContent::set_subtitle_video_frame_rate (int r) } double -SubRipContent::subtitle_video_frame_rate () const +TextSubtitleContent::subtitle_video_frame_rate () const { { boost::mutex::scoped_lock lm (_mutex); @@ -146,7 +146,7 @@ SubRipContent::subtitle_video_frame_rate () const } void -SubRipContent::set_colour (dcp::Colour colour) +TextSubtitleContent::set_colour (dcp::Colour colour) { { boost::mutex::scoped_lock lm (_mutex); @@ -157,11 +157,11 @@ SubRipContent::set_colour (dcp::Colour colour) _colour = colour; } - signal_changed (SubRipContentProperty::SUBTITLE_COLOUR); + signal_changed (TextSubtitleContentProperty::TEXT_SUBTITLE_COLOUR); } void -SubRipContent::set_outline (bool o) +TextSubtitleContent::set_outline (bool o) { { boost::mutex::scoped_lock lm (_mutex); @@ -172,11 +172,11 @@ SubRipContent::set_outline (bool o) _outline = o; } - signal_changed (SubRipContentProperty::SUBTITLE_OUTLINE); + signal_changed (TextSubtitleContentProperty::TEXT_SUBTITLE_OUTLINE); } void -SubRipContent::set_outline_colour (dcp::Colour colour) +TextSubtitleContent::set_outline_colour (dcp::Colour colour) { { boost::mutex::scoped_lock lm (_mutex); @@ -187,5 +187,5 @@ SubRipContent::set_outline_colour (dcp::Colour colour) _outline_colour = colour; } - signal_changed (SubRipContentProperty::SUBTITLE_OUTLINE_COLOUR); + signal_changed (TextSubtitleContentProperty::TEXT_SUBTITLE_OUTLINE_COLOUR); } diff --git a/src/lib/subrip_content.h b/src/lib/text_subtitle_content.h similarity index 78% rename from src/lib/subrip_content.h rename to src/lib/text_subtitle_content.h index 68864f58c..52d44ae54 100644 --- a/src/lib/subrip_content.h +++ b/src/lib/text_subtitle_content.h @@ -19,23 +19,23 @@ #include "subtitle_content.h" -class SubRipContentProperty +class TextSubtitleContentProperty { public: - static int const SUBTITLE_COLOUR; - static int const SUBTITLE_OUTLINE; - static int const SUBTITLE_OUTLINE_COLOUR; + static int const TEXT_SUBTITLE_COLOUR; + static int const TEXT_SUBTITLE_OUTLINE; + static int const TEXT_SUBTITLE_OUTLINE_COLOUR; }; -class SubRipContent : public SubtitleContent +class TextSubtitleContent : public SubtitleContent { public: - SubRipContent (boost::shared_ptr, boost::filesystem::path); - SubRipContent (boost::shared_ptr, cxml::ConstNodePtr, int); + TextSubtitleContent (boost::shared_ptr, boost::filesystem::path); + TextSubtitleContent (boost::shared_ptr, cxml::ConstNodePtr, int); - boost::shared_ptr shared_from_this () { - return boost::dynamic_pointer_cast (Content::shared_from_this ()); + boost::shared_ptr shared_from_this () { + return boost::dynamic_pointer_cast (Content::shared_from_this ()); } /* Content */ diff --git a/src/lib/subrip_decoder.cc b/src/lib/text_subtitle_decoder.cc similarity index 81% rename from src/lib/subrip_decoder.cc rename to src/lib/text_subtitle_decoder.cc index 2f8b8a5f3..893fd5d3c 100644 --- a/src/lib/subrip_decoder.cc +++ b/src/lib/text_subtitle_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,8 +17,8 @@ */ -#include "subrip_decoder.h" -#include "subrip_content.h" +#include "text_subtitle_decoder.h" +#include "text_subtitle_content.h" #include #include #include @@ -32,16 +32,16 @@ using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; -SubRipDecoder::SubRipDecoder (shared_ptr content) +TextSubtitleDecoder::TextSubtitleDecoder (shared_ptr content) : SubtitleDecoder (content) - , SubRip (content) + , TextSubtitle (content) , _next (0) { } void -SubRipDecoder::seek (ContentTime time, bool accurate) +TextSubtitleDecoder::seek (ContentTime time, bool accurate) { SubtitleDecoder::seek (time, accurate); @@ -52,7 +52,7 @@ SubRipDecoder::seek (ContentTime time, bool accurate) } bool -SubRipDecoder::pass (PassReason, bool) +TextSubtitleDecoder::pass (PassReason, bool) { if (_next >= _subtitles.size ()) { return true; @@ -60,7 +60,7 @@ SubRipDecoder::pass (PassReason, bool) /* XXX: we are ignoring positioning specified in the file */ - shared_ptr content = dynamic_pointer_cast (_subtitle_content); + shared_ptr content = dynamic_pointer_cast (_subtitle_content); DCPOMATIC_ASSERT (content); list out; @@ -77,7 +77,7 @@ SubRipDecoder::pass (PassReason, bool) BOOST_FOREACH (sub::Block j, i.blocks) { out.push_back ( dcp::SubtitleString ( - SubRipContent::font_id, + TextSubtitleContent::font_id, j.italic, /* force the colour to whatever is configured */ content->colour(), @@ -109,13 +109,13 @@ SubRipDecoder::pass (PassReason, bool) } list -SubRipDecoder::image_subtitles_during (ContentTimePeriod, bool) const +TextSubtitleDecoder::image_subtitles_during (ContentTimePeriod, bool) const { return list (); } list -SubRipDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const +TextSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const { /* XXX: inefficient */ @@ -132,7 +132,7 @@ SubRipDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const } ContentTimePeriod -SubRipDecoder::content_time_period (sub::Subtitle s) const +TextSubtitleDecoder::content_time_period (sub::Subtitle s) const { return ContentTimePeriod ( ContentTime::from_seconds (s.from.all_as_seconds()), diff --git a/src/lib/subrip_decoder.h b/src/lib/text_subtitle_decoder.h similarity index 77% rename from src/lib/subrip_decoder.h rename to src/lib/text_subtitle_decoder.h index f76d04aeb..67d2caca8 100644 --- a/src/lib/subrip_decoder.h +++ b/src/lib/text_subtitle_decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,18 +17,18 @@ */ -#ifndef DCPOMATIC_SUBRIP_DECODER_H -#define DCPOMATIC_SUBRIP_DECODER_H +#ifndef DCPOMATIC_TEXT_SUBTITLE_DECODER_H +#define DCPOMATIC_TEXT_SUBTITLE_DECODER_H #include "subtitle_decoder.h" -#include "subrip.h" +#include "text_subtitle.h" -class SubRipContent; +class TextSubtitleContent; -class SubRipDecoder : public SubtitleDecoder, public SubRip +class TextSubtitleDecoder : public SubtitleDecoder, public TextSubtitle { public: - SubRipDecoder (boost::shared_ptr); + TextSubtitleDecoder (boost::shared_ptr); protected: void seek (ContentTime time, bool accurate); diff --git a/src/lib/wscript b/src/lib/wscript index 88cb9d4dc..f6ca52fb7 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -118,9 +118,9 @@ sources = """ sndfile_decoder.cc sndfile_examiner.cc string_log_entry.cc - subrip.cc - subrip_content.cc - subrip_decoder.cc + text_subtitle.cc + text_subtitle_content.cc + text_subtitle_decoder.cc subtitle_content.cc subtitle_decoder.cc timer.cc diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc index 0db55edfe..8e158bbac 100644 --- a/src/wx/subtitle_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -18,13 +18,13 @@ */ #include "subtitle_appearance_dialog.h" -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include #include using boost::shared_ptr; -SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr content) +SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr content) : TableDialog (parent, _("Subtitle appearance"), 2, 1, true) , _content (content) { diff --git a/src/wx/subtitle_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h index f4fe307d2..fddb902ac 100644 --- a/src/wx/subtitle_appearance_dialog.h +++ b/src/wx/subtitle_appearance_dialog.h @@ -22,12 +22,12 @@ class wxCheckBox; class wxColourPickerCtrl; -class SubRipContent; +class TextSubtitleContent; class SubtitleAppearanceDialog : public TableDialog { public: - SubtitleAppearanceDialog (wxWindow* parent, boost::shared_ptr content); + SubtitleAppearanceDialog (wxWindow* parent, boost::shared_ptr content); void apply (); @@ -36,5 +36,5 @@ private: wxCheckBox* _outline; wxColourPickerCtrl* _outline_colour; - boost::shared_ptr _content; + boost::shared_ptr _content; }; diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 591166a9e..3024617e5 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -25,10 +25,10 @@ #include "fonts_dialog.h" #include "subtitle_appearance_dialog.h" #include "lib/ffmpeg_content.h" -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "lib/ffmpeg_subtitle_stream.h" #include "lib/dcp_subtitle_content.h" -#include "lib/subrip_decoder.h" +#include "lib/text_subtitle_decoder.h" #include "lib/dcp_subtitle_decoder.h" #include "lib/dcp_content.h" #include @@ -233,13 +233,13 @@ SubtitlePanel::setup_sensitivity () { int any_subs = 0; int ffmpeg_subs = 0; - int subrip_subs = 0; + int text_subs = 0; int dcp_subs = 0; int image_subs = 0; SubtitleContentList sel = _parent->selected_subtitle (); BOOST_FOREACH (shared_ptr i, sel) { shared_ptr fc = boost::dynamic_pointer_cast (i); - shared_ptr sc = boost::dynamic_pointer_cast (i); + shared_ptr sc = boost::dynamic_pointer_cast (i); shared_ptr dsc = boost::dynamic_pointer_cast (i); if (fc) { if (fc->has_subtitles ()) { @@ -247,7 +247,7 @@ SubtitlePanel::setup_sensitivity () ++any_subs; } } else if (sc) { - ++subrip_subs; + ++text_subs; ++any_subs; } else if (dsc) { ++dcp_subs; @@ -283,9 +283,9 @@ SubtitlePanel::setup_sensitivity () _y_scale->Enable (!reference && any_subs > 0 && use); _language->Enable (!reference && any_subs > 0 && use); _stream->Enable (!reference && ffmpeg_subs == 1); - _subtitle_view_button->Enable (!reference && (subrip_subs == 1 || dcp_subs == 1)); - _fonts_dialog_button->Enable (!reference && (subrip_subs == 1 || dcp_subs == 1)); - _appearance_dialog_button->Enable (!reference && subrip_subs == 1); + _subtitle_view_button->Enable (!reference && (text_subs == 1 || dcp_subs == 1)); + _fonts_dialog_button->Enable (!reference && (text_subs == 1 || dcp_subs == 1)); + _appearance_dialog_button->Enable (!reference && text_subs == 1); } void @@ -379,9 +379,9 @@ SubtitlePanel::subtitle_view_clicked () shared_ptr decoder; - shared_ptr sr = dynamic_pointer_cast (c.front ()); + shared_ptr sr = dynamic_pointer_cast (c.front ()); if (sr) { - decoder.reset (new SubRipDecoder (sr)); + decoder.reset (new TextSubtitleDecoder (sr)); } shared_ptr dc = dynamic_pointer_cast (c.front ()); @@ -432,7 +432,7 @@ SubtitlePanel::appearance_dialog_clicked () SubtitleContentList c = _parent->selected_subtitle (); DCPOMATIC_ASSERT (c.size() == 1); - shared_ptr sr = dynamic_pointer_cast (c.front ()); + shared_ptr sr = dynamic_pointer_cast (c.front ()); DCPOMATIC_ASSERT (sr); SubtitleAppearanceDialog* d = new SubtitleAppearanceDialog (this, sr); diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc index f54b19680..916f1eedc 100644 --- a/src/wx/subtitle_view.cc +++ b/src/wx/subtitle_view.cc @@ -17,10 +17,10 @@ */ -#include "lib/subrip_decoder.h" +#include "lib/text_subtitle_decoder.h" #include "lib/content_subtitle.h" #include "lib/film.h" -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "subtitle_view.h" #include "wx_util.h" diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index c7567455b..a29240f8d 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -27,7 +27,7 @@ #include "lib/raw_convert.h" #include "lib/subtitle_content.h" #include "lib/dcp_subtitle_content.h" -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include #include #include @@ -393,13 +393,13 @@ TimingPanel::set_video_frame_rate () BOOST_FOREACH (shared_ptr i, _parent->selected ()) { shared_ptr vc = dynamic_pointer_cast (i); shared_ptr dsc = dynamic_pointer_cast (i); - shared_ptr ssc = dynamic_pointer_cast (i); + shared_ptr tsc = dynamic_pointer_cast (i); if (vc) { vc->set_video_frame_rate (raw_convert (wx_to_std (_video_frame_rate->GetValue ()))); } else if (dsc) { dsc->set_subtitle_video_frame_rate (raw_convert (wx_to_std (_video_frame_rate->GetValue ()))); - } else if (ssc) { - ssc->set_subtitle_video_frame_rate (raw_convert (wx_to_std (_video_frame_rate->GetValue ()))); + } else if (tsc) { + tsc->set_subtitle_video_frame_rate (raw_convert (wx_to_std (_video_frame_rate->GetValue ()))); } _set_video_frame_rate->Enable (false); } diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index e2f7272be..fc5b88578 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -22,7 +22,7 @@ */ #include -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "lib/dcp_subtitle_content.h" #include "lib/film.h" #include "lib/ratio.h" @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); content->set_use_subtitles (true); content->set_burn_subtitles (true); film->examine_and_add_content (content, true); diff --git a/test/reels_test.cc b/test/reels_test.cc index 12a311fe8..b5a24f7fc 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -23,7 +23,7 @@ #include "lib/image_content.h" #include "lib/dcp_content_type.h" #include "lib/dcp_content.h" -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "test.h" #include #include @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE (reels_test3) shared_ptr dcp (new DCPContent (film, "test/data/reels_test2")); film->examine_and_add_content (dcp); - shared_ptr sub (new SubRipContent (film, "test/data/subrip.srt")); + shared_ptr sub (new TextSubtitleContent (film, "test/data/subrip.srt")); film->examine_and_add_content (sub); wait_for_jobs (); @@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) content[i]->set_video_length (24); } - shared_ptr subs (new SubRipContent (film, "test/data/subrip3.srt")); + shared_ptr subs (new TextSubtitleContent (film, "test/data/subrip3.srt")); film->examine_and_add_content (subs); wait_for_jobs (); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 759c2720c..c2d3e27bd 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -22,7 +22,7 @@ */ #include "lib/film.h" -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "lib/dcp_content_type.h" #include "lib/font.h" #include "lib/ratio.h" @@ -42,7 +42,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (true); - shared_ptr content (new SubRipContent (film, private_data / "Ankoemmling.srt")); + shared_ptr content (new TextSubtitleContent (film, private_data / "Ankoemmling.srt")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/subrip_test.cc b/test/subrip_test.cc index cd517cfe9..d443a416d 100644 --- a/test/subrip_test.cc +++ b/test/subrip_test.cc @@ -39,7 +39,7 @@ using boost::dynamic_pointer_cast; BOOST_AUTO_TEST_CASE (subrip_render_test) { shared_ptr film = new_test_film ("subrip_render_test"); - shared_ptr content (new SubRipContent (film, "test/data/subrip.srt")); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip.srt")); content->examine (shared_ptr (), true); BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471)); diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc index 837c73c58..554591b92 100644 --- a/test/xml_subtitle_test.cc +++ b/test/xml_subtitle_test.cc @@ -22,7 +22,7 @@ */ #include -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" @@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); content->set_use_subtitles (true); content->set_burn_subtitles (false); film->examine_and_add_content (content); -- 2.30.2