movie

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const FileSuffix = ".txt"
View Source
const SpeedFlag = "speed"

Variables

View Source
var ErrInvalidSpeed = errors.New("speed must be greater than 0")

Functions

func CompleteMovieName added in v1.3.0

func CompleteMovieName(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func Flags

func Flags(flags *flag.FlagSet)

Types

type Frame

type Frame struct {
	Duration time.Duration
	Data     string
	Progress string
}

func (*Frame) CalcDuration

func (f *Frame) CalcDuration(multiplier float64) time.Duration

type Info added in v1.3.0

type Info struct {
	Path      string
	Name      string
	Duration  time.Duration
	Default   bool
	NumFrames int
	Size      int64
}

func GetInfo added in v1.4.0

func GetInfo(fsys fs.FS, path string) (Info, error)

func ListEmbedded added in v1.3.0

func ListEmbedded() ([]Info, error)

type Movie

type Movie struct {
	Filename string
	Frames   []Frame
	Height   int
	Width    int
	Sections []int
}

func FromFlags

func FromFlags(flags *flag.FlagSet, path string) (Movie, error)

func NewMovie added in v1.4.0

func NewMovie() Movie

func (Movie) Duration

func (m Movie) Duration() time.Duration

func (*Movie) LoadFile added in v1.4.0

func (m *Movie) LoadFile(path string, src io.Reader, speed float64) error

Jump to

Keyboard shortcuts

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