Documentation
¶
Overview ¶
Package subformat is used to manipulate different subtitle formats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCouldNotDetermineFormat = errors.New("could not determine format to use") ErrFormatMismatch = errors.New("format mismatch between the output file extension and the format given. use one or the other") )
Functions ¶
func AddExtensionToSubFile ¶
func AddExtensionToSubFile(file string, fileFormat FormatType) string
Types ¶
type FormatType ¶
type FormatType int
const ( FormatTypeSRT FormatType = iota + 1 FormatTypeSTL FormatTypeTTML FormatTypeSSA FormatTypeVTT FormatTypeASS )
func SubFormatFromFileName ¶
func SubFormatFromFileName(fileName string) (FormatType, error)
func SubFormatFromFileNameOrFormatString ¶
func SubFormatFromFileNameOrFormatString(fileName string, format string) (FormatType, error)
func SubFormatFromString ¶
func SubFormatFromString(s string) (FormatType, error)
func (FormatType) String ¶
func (t FormatType) String() string
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
func NewSubFormatter ¶
func NewSubFormatter(subtitleType FormatType, r io.Reader) (Formatter, error)
func NewSubFormatterFromFile ¶
func (*Formatter) ConvertToAndWrite ¶
func (s *Formatter) ConvertToAndWrite(newFormatType FormatType, out io.Writer) error
func (*Formatter) Type ¶
func (s *Formatter) Type() FormatType
Click to show internal directories.
Click to hide internal directories.