abstract class Subtitles::Substation

Direct Known Subclasses

Defined in:

format/substation.cr

Constant Summary

SRT_TIME_FORMAT = "%H:%M:%S.%L"

Constructors

Class Method Summary

Instance Method Summary

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

def self.new(content : IO) #

initialize with the content


[View source]
def self.new(content string : String) #

initialize with the content


[View source]
def self.new(captions : Captions, eol = "\r\n") #

Build SSA-compatible subtitles from the given Captions.


[View source]
def self.new(*, filepath : String) #

Read in an SSA compatible subtitle from the given filepath.


[View source]

Class Method Detail

def self.default_style #

The default style for subtitles coming from formats without formatting options.


[View source]
def self.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, an nil if it's neither.


[View source]
def self.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, an nil if it's neither.


[View source]
def self.first_dialogue_column #

The content of the first column of a dialogue row.


[View source]
def self.first_format_column #

The content of the first column of a format row.


[View source]
def self.style_format_columns #

The column headers for the default style


[View source]
def self.styles_section_header #

The header for the Styles section. Either [V4 Styles] or [V4+ Styles]


[View source]

Instance Method Detail

def columns : Array(String) #

The columns the dialogue uses


[View source]
def columns=(columns) #

The columns the dialogue uses


[View source]
def content : IO #

[View source]
def eol : String #

The end-of-line character: '\n' on Unix-like systems, '\r\n' on windows.


[View source]
def eol=(eol) #

The end-of-line character: '\n' on Unix-like systems, '\r\n' on windows.


[View source]
def to_captions(eol = "\r\n") #

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.


[View source]