mdvd

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMdvd

func LoadMdvd(v *Mdvd, filepath string) error

LoadMdvd loads a file into an mdvd object

func ParseDefault

func ParseDefault(in string) (text string, tags []string, err error)

ParseDefault parses the default line

func ParseLine

func ParseLine(in string) (start, end int64, text string, tags []string, err error)

ParseLine parses an individual Microdvd line file

func WriteMdvd

func WriteMdvd(v *Mdvd, outpath string) error

WriteMdvd writes a .sub file from an Mdvd object

Types

type Event

type Event struct {
	Start     int64
	End       int64
	Tags      []Tag
	IsDefault bool
	Text      string
}

Event - these compose the body and are the main subtitle events

func CreateDefault

func CreateDefault(tags []Tag, text string) *Event

CreateDefault creates a Default event which does not have a timestamp

func CreateEvent

func CreateEvent(start, end int64, tags []Tag, def bool, text string) *Event

CreateEvent Creates a microDVD event

type Mdvd

type Mdvd struct {
	Body []Event
}

Mdvd is the main mdvd subtitle object

func ParseMdvd

func ParseMdvd(filename string) (*Mdvd, error)

ParseMdvd parses a file into a Mdvd object

type Tag

type Tag struct {
	Type  string
	Value string
}

Tag - tags are formatting tags that contain styling information

func CreateTag

func CreateTag(tag string) *Tag

CreateTag creates a tag object

func TagBash

func TagBash(in []string) (tags []Tag)

TagBash converts a set of []strings to a set of Tags

Jump to

Keyboard shortcuts

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