abstract class Subtitles::Substation
- Subtitles::Substation
- Subtitles::Format
- Reference
- Object
Direct Known Subclasses
Defined in:
format/substation.crConstant Summary
-
SRT_TIME_FORMAT =
"%H:%M:%S.%L"
Constructors
-
.new(content : IO)
initialize with the content
-
.new(content string : String)
initialize with the content
-
.new(captions : Captions, eol = "\r\n")
Build SSA-compatible subtitles from the given
Caption
s. -
.new(*, filepath : String)
Read in an SSA compatible subtitle from the given filepath.
Class Method Summary
-
.default_style
The default style for subtitles coming from formats without formatting options.
-
.detect(content : String)
Check that the given content is a Substation filetype Returns
Subtitles::ASS
if the file is a .ass file,Subtitles::SSA
if it's a .ssa file, annil
if it's neither. -
.detect(content : IO)
Check that the given content is a Substation filetype Returns
Subtitles::ASS
if the file is a .ass file,Subtitles::SSA
if it's a .ssa file, annil
if it's neither. -
.first_dialogue_column
The content of the first column of a dialogue row.
-
.first_format_column
The content of the first column of a format row.
-
.style_format_columns
The column headers for the default style
-
.styles_section_header
The header for the Styles section.
Instance Method Summary
-
#columns : Array(String)
The columns the dialogue uses
-
#columns=(columns)
The columns the dialogue uses
- #content : IO
-
#eol : String
The end-of-line character: '\n' on Unix-like systems, '\r\n' on windows.
-
#eol=(eol)
The end-of-line character: '\n' on Unix-like systems, '\r\n' on windows.
-
#to_captions(eol = "\r\n")
Convert this Substation subtitles file to an intermediary format for conversion to another format.
Instance methods inherited from class Subtitles::Format
content : IO
content,
to_captions
to_captions
Class methods inherited from class Subtitles::Format
detect
detect,
from_extension(extension string : String) : self.class?
from_extension
Constructor Detail
Build SSA-compatible subtitles from the given Caption
s.
Class Method Detail
The default style for subtitles coming from formats without formatting options.
Check that the given content is a Substation filetype
Returns Subtitles::ASS
if the file is a .ass file, Subtitles::SSA
if
it's a .ssa file, an nil
if it's neither.
Check that the given content is a Substation filetype
Returns Subtitles::ASS
if the file is a .ass file, Subtitles::SSA
if
it's a .ssa file, an nil
if it's neither.
The header for the Styles section. Either [V4 Styles] or [V4+ Styles]
Instance Method Detail
Convert this Substation subtitles file to an intermediary format for conversion to another format. This process is lossy. At least all comments will be lost, probably some other information too.