class Subtitles::SRT

Defined in:

format/srt.cr

Constant Summary

SRT_PART_REGEX = /^(\d+)\r?\n(\d{1,2}:\d{1,2}:\d{1,2}([.,]\d{1,3})?)\s*\-\-\>\s*(\d{1,2}:\d{1,2}:\d{1,2}([.,]\d{1,3})?)\r?\n([\s\S]*)(\r?\n)*$/i
SRT_REGEX = /^\d+\r?\n\d{1,2}:\d{1,2}:\d{1,2}([.,]\d{1,3})?\s*\-\-\>\s*\d{1,2}:\d{1,2}:\d{1,2}([.,]\d{1,3})?/i
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") #

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

Read in an SSA compatible subtitle from the given filepath.


[View source]

Class Method Detail

def self.detect(content : String) #

[View source]
def self.detect(content : IO) #

[View source]

Instance Method Detail

def content : IO #

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

[View source]