Versions in this module Expand all Collapse all v0 v0.2.2 Nov 17, 2020 Changes in this version + const LanguageEnglish + const LanguageFrench + var BytesBOM = []byte + var ColorBlack = &Color + var ColorBlue = &Color + var ColorCyan = &Color + var ColorGray = &Color + var ColorGreen = &Color + var ColorLime = &Color + var ColorMagenta = &Color + var ColorMaroon = &Color + var ColorNavy = &Color + var ColorOlive = &Color + var ColorPurple = &Color + var ColorRed = &Color + var ColorSilver = &Color + var ColorTeal = &Color + var ColorWhite = &Color + var ColorYellow = &Color + var ErrInvalidExtension = errors.New("astisub: invalid extension") + var ErrNoSubtitlesToWrite = errors.New("astisub: no subtitles to write") + var ErrNoValidTeletextPID = errors.New("astisub: no valid teletext PID") + var Now = func() time.Time + type Color struct + Alpha uint8 + Blue uint8 + Green uint8 + Red uint8 + func (c *Color) SSAString() string + func (c *Color) TTMLString() string + type Item struct + Comments []string + EndAt time.Duration + InlineStyle *StyleAttributes + Lines []Line + Region *Region + StartAt time.Duration + Style *Style + func (i Item) String() string + type Line struct + Items []LineItem + VoiceName string + func (l Line) String() string + type LineItem struct + InlineStyle *StyleAttributes + Style *Style + Text string + type Metadata struct + Comments []string + Framerate int + Language string + SSACollisions string + SSAOriginalEditing string + SSAOriginalScript string + SSAOriginalTiming string + SSAOriginalTranslation string + SSAPlayDepth *int + SSAPlayResX *int + SSAPlayResY *int + SSAScriptType string + SSAScriptUpdatedBy string + SSASynchPoint string + SSATimer *float64 + SSAUpdateDetails string + SSAWrapStyle string + STLMaximumNumberOfDisplayableCharactersInAnyTextRow *int + STLMaximumNumberOfDisplayableRows *int + STLPublisher string + TTMLCopyright string + Title string + type Options struct + Filename string + Teletext TeletextOptions + type Region struct + ID string + InlineStyle *StyleAttributes + Style *Style + type Style struct + ID string + InlineStyle *StyleAttributes + Style *Style + type StyleAttributes struct + SSAAlignment *int + SSAAlphaLevel *float64 + SSAAngle *float64 + SSABackColour *Color + SSABold *bool + SSABorderStyle *int + SSAEffect string + SSAEncoding *int + SSAFontName string + SSAFontSize *float64 + SSAItalic *bool + SSALayer *int + SSAMarginLeft *int + SSAMarginRight *int + SSAMarginVertical *int + SSAMarked *bool + SSAOutline *float64 + SSAOutlineColour *Color + SSAPrimaryColour *Color + SSAScaleX *float64 + SSAScaleY *float64 + SSASecondaryColour *Color + SSAShadow *float64 + SSASpacing *float64 + SSAStrikeout *bool + SSAUnderline *bool + STLBoxing *bool + STLItalics *bool + STLUnderline *bool + TTMLBackgroundColor string + TTMLColor string + TTMLDirection string + TTMLDisplay string + TTMLDisplayAlign string + TTMLExtent string + TTMLFontFamily string + TTMLFontSize string + TTMLFontStyle string + TTMLFontWeight string + TTMLLineHeight string + TTMLOpacity string + TTMLOrigin string + TTMLOverflow string + TTMLPadding string + TTMLShowBackground string + TTMLTextAlign string + TTMLTextDecoration string + TTMLTextOutline string + TTMLUnicodeBidi string + TTMLVisibility string + TTMLWrapOption string + TTMLWritingMode string + TTMLZIndex int + TeletextColor *Color + TeletextDoubleHeight *bool + TeletextDoubleSize *bool + TeletextDoubleWidth *bool + TeletextSpacesAfter *int + TeletextSpacesBefore *int + WebVTTAlign string + WebVTTLine string + WebVTTLines int + WebVTTPosition string + WebVTTRegionAnchor string + WebVTTScroll string + WebVTTSize string + WebVTTVertical string + WebVTTViewportAnchor string + WebVTTWidth string + type Subtitles struct + Items []*Item + Metadata *Metadata + Regions map[string]*Region + Styles map[string]*Style + func NewSubtitles() *Subtitles + func Open(o Options) (s *Subtitles, err error) + func OpenFile(filename string) (*Subtitles, error) + func ReadFromSRT(i io.Reader) (o *Subtitles, err error) + func ReadFromSSA(i io.Reader) (o *Subtitles, err error) + func ReadFromSTL(i io.Reader) (o *Subtitles, err error) + func ReadFromTTML(i io.Reader) (o *Subtitles, err error) + func ReadFromTeletext(r io.Reader, o TeletextOptions) (s *Subtitles, err error) + func ReadFromWebVTT(i io.Reader) (o *Subtitles, err error) + func (s *Subtitles) Add(d time.Duration) + func (s *Subtitles) ForceDuration(d time.Duration, addDummyItem bool) + func (s *Subtitles) Fragment(f time.Duration) + func (s *Subtitles) Merge(i *Subtitles) + func (s *Subtitles) Optimize() + func (s *Subtitles) Order() + func (s *Subtitles) RemoveStyling() + func (s *Subtitles) Unfragment() + func (s Subtitles) Duration() time.Duration + func (s Subtitles) IsEmpty() bool + func (s Subtitles) Write(dst string) (err error) + func (s Subtitles) WriteToSRT(o io.Writer) (err error) + func (s Subtitles) WriteToSSA(o io.Writer) (err error) + func (s Subtitles) WriteToSTL(o io.Writer) (err error) + func (s Subtitles) WriteToTTML(o io.Writer) (err error) + func (s Subtitles) WriteToWebVTT(o io.Writer) (err error) + type TTMLIn struct + Framerate int + Lang string + Metadata TTMLInMetadata + Regions []TTMLInRegion + Styles []TTMLInStyle + Subtitles []TTMLInSubtitle + XMLName xml.Name + type TTMLInDuration struct + func (d *TTMLInDuration) UnmarshalText(i []byte) (err error) + type TTMLInHeader struct + ID string + Style string + type TTMLInItem struct + Style string + Text string + XMLName xml.Name + type TTMLInItems []TTMLInItem + func (i *TTMLInItems) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) + type TTMLInMetadata struct + Copyright string + Title string + type TTMLInRegion struct + XMLName xml.Name + type TTMLInStyle struct + XMLName xml.Name + type TTMLInStyleAttributes struct + BackgroundColor string + Color string + Direction string + Display string + DisplayAlign string + Extent string + FontFamily string + FontSize string + FontStyle string + FontWeight string + LineHeight string + Opacity string + Origin string + Overflow string + Padding string + ShowBackground string + TextAlign string + TextDecoration string + TextOutline string + UnicodeBidi string + Visibility string + WrapOption string + WritingMode string + ZIndex int + type TTMLInSubtitle struct + Begin *TTMLInDuration + End *TTMLInDuration + ID string + Items string + Region string + Style string + type TTMLOut struct + Lang string + Metadata *TTMLOutMetadata + Regions []TTMLOutRegion + Styles []TTMLOutStyle + Subtitles []TTMLOutSubtitle + XMLName xml.Name + XMLNamespaceTTM string + XMLNamespaceTTS string + type TTMLOutDuration time.Duration + func (t TTMLOutDuration) MarshalText() ([]byte, error) + type TTMLOutHeader struct + ID string + Style string + type TTMLOutItem struct + Style string + Text string + XMLName xml.Name + type TTMLOutMetadata struct + Copyright string + Title string + type TTMLOutRegion struct + XMLName xml.Name + type TTMLOutStyle struct + XMLName xml.Name + type TTMLOutStyleAttributes struct + BackgroundColor string + Color string + Direction string + Display string + DisplayAlign string + Extent string + FontFamily string + FontSize string + FontStyle string + FontWeight string + LineHeight string + Opacity string + Origin string + Overflow string + Padding string + ShowBackground string + TextAlign string + TextDecoration string + TextOutline string + UnicodeBidi string + Visibility string + WrapOption string + WritingMode string + ZIndex int + type TTMLOutSubtitle struct + Begin TTMLOutDuration + End TTMLOutDuration + ID string + Items []TTMLOutItem + Region string + Style string + type TeletextOptions struct + PID int + Page int