caps

package module
v0.0.0-...-07b967f Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLang = "en-US"

Variables

This section is empty.

Functions

func SplitLines

func SplitLines(s string) []string

Types

type Caption

type Caption struct {
	Start *float64
	End   *float64
	Nodes []CaptionContent
	Style StyleProps
}

func NewCaption

func NewCaption(start, end *float64, nodes []CaptionContent, style StyleProps) Caption

func (Caption) FormatEnd

func (c Caption) FormatEnd() string

func (Caption) FormatEndWithSeparator

func (c Caption) FormatEndWithSeparator(sep string) string

func (Caption) FormatStart

func (c Caption) FormatStart() string

func (Caption) FormatStartWithSeparator

func (c Caption) FormatStartWithSeparator(sep string) string

func (Caption) IsEmpty

func (c Caption) IsEmpty() bool

func (Caption) String

func (c Caption) String() string

func (Caption) Text

func (c Caption) Text() string

type CaptionContent

type CaptionContent interface {
	Text() bool
	Style() bool
	LineBreak() bool
	Content() string
}

func NewCaptionStyle

func NewCaptionStyle(start bool, style StyleProps) CaptionContent

func NewCaptionText

func NewCaptionText(text string) CaptionContent

func NewLineBreak

func NewLineBreak() CaptionContent

type CaptionLineBreak

type CaptionLineBreak struct {
	// contains filtered or unexported fields
}

func (CaptionLineBreak) Content

func (c CaptionLineBreak) Content() string

func (CaptionLineBreak) LineBreak

func (c CaptionLineBreak) LineBreak() bool

func (CaptionLineBreak) Style

func (CaptionLineBreak) Style() bool

func (CaptionLineBreak) Text

func (CaptionLineBreak) Text() bool

type CaptionReader

type CaptionReader interface {
	Read([]byte) (*CaptionSet, error)
	Detect([]byte) bool
}

type CaptionSet

type CaptionSet struct {
	Styles   map[string]StyleProps
	Captions map[string][]*Caption
}

func NewCaptionSet

func NewCaptionSet() *CaptionSet

func (CaptionSet) AddStyle

func (c CaptionSet) AddStyle(style StyleProps)

func (CaptionSet) GetCaptions

func (c CaptionSet) GetCaptions(lang string) []*Caption

func (CaptionSet) GetStyle

func (c CaptionSet) GetStyle(id string) StyleProps

func (CaptionSet) GetStyles

func (c CaptionSet) GetStyles() []StyleProps

func (CaptionSet) IsEmpty

func (c CaptionSet) IsEmpty() bool

func (CaptionSet) Languages

func (c CaptionSet) Languages() []string

func (CaptionSet) SetCaptions

func (c CaptionSet) SetCaptions(lang string, captions []*Caption)

type CaptionStyle

type CaptionStyle struct {
	Props StyleProps
	Start bool
	// contains filtered or unexported fields
}

func (CaptionStyle) Content

func (c CaptionStyle) Content() string

func (CaptionStyle) LineBreak

func (CaptionStyle) LineBreak() bool

func (CaptionStyle) Style

func (c CaptionStyle) Style() bool

func (CaptionStyle) Text

func (CaptionStyle) Text() bool

type CaptionText

type CaptionText struct {
	// contains filtered or unexported fields
}

func (CaptionText) Content

func (c CaptionText) Content() string

func (CaptionText) LineBreak

func (CaptionText) LineBreak() bool

func (CaptionText) Style

func (CaptionText) Style() bool

func (CaptionText) Text

func (CaptionText) Text() bool

type CaptionWriter

type CaptionWriter interface {
	Write(*CaptionSet) ([]byte, error)
}

type StyleProps

type StyleProps struct {
	ID         string
	Class      string
	TextAlign  string
	FontFamily string
	FontSize   string
	Color      string
	Italics    bool
	Bold       bool
	Underline  bool
}

FIXME This is a simple placeholder for style types, this can be better represented but I need to implement more caption types first(this was written with just dfxp)

func DefaultStyleProps

func DefaultStyleProps() StyleProps

func (StyleProps) String

func (s StyleProps) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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