1
0
Fork 0

Modernize the EBU STL writer a bit

This commit is contained in:
Thomas Goyne 2014-07-01 13:30:24 -07:00
parent ce503a1fb5
commit abcd2bd61b
2 changed files with 8 additions and 27 deletions

View File

@ -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<EbuTextRow> 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<std::string> Ebu3264SubtitleFormat::GetWriteWildcards() const
{
std::vector<std::string> 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

View File

@ -27,7 +27,7 @@
class Ebu3264SubtitleFormat final : public SubtitleFormat {
public:
Ebu3264SubtitleFormat();
std::vector<std::string> GetWriteWildcards() const override;
std::vector<std::string> 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);