srt

package
v0.0.0-...-f890984 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 5 Imported by: 1

README

GoDoc cover.run go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSrt

func LoadSrt(v *SubRip, filepath string) error

LoadSrt loads the provided file into the given object. It fixes the \ufeff problem that some parsers have.

func WriteSrt

func WriteSrt(v *SubRip, outpath string) error

WriteSrt takes a SubRip object and the path to which to write the file as a string

Types

type SubRip

type SubRip struct {
	Subtitle struct {
		Content []Subtitle
	}
}

SubRip is the overall file descriptor. It provides a container for us to dump subtitles into.

func ParseSrt

func ParseSrt(filename string) (*SubRip, error)

ParseSrt is the loader for srt files. Takes the path of the file being opened as the argument.

type Subtitle

type Subtitle struct {
	Id    int
	Start string
	End   string
	Line  []string
}

Subtitle struct provides all of the elements of an .srt subtitle with lines of subtitles being broken up into []strings

func CreateSubtitle

func CreateSubtitle(id int, start string, end string, text []string) *Subtitle

CreateSubtitle creates a subtitle object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL