movie

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 26 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)

func Quit added in v1.4.0

func Quit() tea.Msg

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
	Cap      int
	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

type Player added in v1.4.0

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

func NewPlayer added in v1.4.0

func NewPlayer(m *Movie, logger *log.Entry, renderer *lipgloss.Renderer) Player

func (Player) Init added in v1.4.0

func (p Player) Init() tea.Cmd

func (*Player) OptionsView added in v1.4.0

func (p *Player) OptionsView() string

func (Player) Update added in v1.4.0

func (p Player) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Player) View added in v1.4.0

func (p Player) View() string

type PlayerOption added in v1.4.0

type PlayerOption string
const (
	Option3xRewind  PlayerOption = "<<<"
	Option2xRewind  PlayerOption = "<<"
	Option1xRewind  PlayerOption = "<"
	OptionPause     PlayerOption = "||"
	OptionPlay      PlayerOption = "|>"
	Option1xForward PlayerOption = ">"
	Option2xForward PlayerOption = ">>"
	Option3xForward PlayerOption = ">>>"
)

type Styles added in v1.8.0

type Styles struct {
	Screen   lipgloss.Style
	Progress lipgloss.Style
	Options  lipgloss.Style
	Active   lipgloss.Style
	Selected lipgloss.Style

	MarginX, MarginY string
}

func NewStyles added in v1.8.0

func NewStyles(m *Movie, renderer *lipgloss.Renderer) Styles

Jump to

Keyboard shortcuts

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