From abcd2bd61ba2dfb09fe8c13b737385a0dc221adb Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 1 Jul 2014 13:30:24 -0700 Subject: [PATCH] Modernize the EBU STL writer a bit --- src/subtitle_format_ebu3264.cpp | 33 +++++++-------------------------- src/subtitle_format_ebu3264.h | 2 +- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/subtitle_format_ebu3264.cpp b/src/subtitle_format_ebu3264.cpp index 665901e7e..a00312fd4 100644 --- a/src/subtitle_format_ebu3264.cpp +++ b/src/subtitle_format_ebu3264.cpp @@ -164,28 +164,16 @@ namespace PositionBottom = 0 }; - int group_number; ///< always 0 for compat + int group_number = 0; ///< always 0 for compat /// subtitle number is assigned when generating blocks - CumulativeStatus cumulative_status; ///< always NotCumulative for compat - int time_in; ///< frame number - int time_out; ///< frame number - bool comment_flag; ///< always false for compat - JustificationCode justification_code; ///< never Unchanged presentation for compat - VerticalPosition vertical_position; ///< translated to row on tti conversion + CumulativeStatus cumulative_status = NotCumulative; ///< always NotCumulative for compat + int time_in = 0; ///< frame number + int time_out = 0; ///< frame number + bool comment_flag = false; ///< always false for compat + JustificationCode justification_code = JustifyCentre; ///< never Unchanged presentation for compat + VerticalPosition vertical_position = PositionBottom; ///< translated to row on tti conversion std::vector text_rows; ///< text split into rows, still unicode - EbuSubtitle() - : group_number(0) - , cumulative_status(NotCumulative) - , time_in(0) - , time_out(0) - , comment_flag(false) - , justification_code(JustifyCentre) - , vertical_position(PositionBottom) - , text_rows() - { - } - void SplitLines(int max_width, int split_type) { // split_type is an SSA wrap style number @@ -628,13 +616,6 @@ Ebu3264SubtitleFormat::Ebu3264SubtitleFormat() { } -std::vector Ebu3264SubtitleFormat::GetWriteWildcards() const -{ - std::vector formats; - formats.push_back("stl"); - return formats; -} - void Ebu3264SubtitleFormat::WriteFile(const AssFile *src, agi::fs::path const& filename, agi::vfr::Framerate const& fps, std::string const&) const { // collect data from user diff --git a/src/subtitle_format_ebu3264.h b/src/subtitle_format_ebu3264.h index afa07fa51..e7e5cc452 100644 --- a/src/subtitle_format_ebu3264.h +++ b/src/subtitle_format_ebu3264.h @@ -27,7 +27,7 @@ class Ebu3264SubtitleFormat final : public SubtitleFormat { public: Ebu3264SubtitleFormat(); - std::vector GetWriteWildcards() const override; + std::vector GetWriteWildcards() const override { return {"stl"}; } void WriteFile(const AssFile *src, agi::fs::path const& filename, agi::vfr::Framerate const& fps, std::string const& encoding) const override; DEFINE_EXCEPTION(ConversionFailed, agi::InvalidInputException);