player

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionStrings

func OptionStrings() []string

OptionStrings returns a slice of all String values of the enum

Types

type Option

type Option uint8
const (
	Option3xRewind  Option = iota // <<<
	Option2xRewind                // <<
	Option1xRewind                // <
	OptionPlayPause               // |>||
	Option1xForward               // >
	Option2xForward               // >>
	Option3xForward               // >>>
)

func OptionString

func OptionString(s string) (Option, error)

OptionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func OptionValues

func OptionValues() []Option

OptionValues returns all values of the enum

func (Option) DynamicString

func (o Option) DynamicString(isPlaying bool) string

func (Option) IsAOption

func (i Option) IsAOption() bool

IsAOption returns "true" if the value is listed in the enum definition. "false" otherwise

func (Option) Speed

func (o Option) Speed() float64

func (Option) String

func (i Option) String() string

type Player

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

func NewPlayer

func NewPlayer(m *movie.Movie, logger *slog.Logger, renderer *lipgloss.Renderer) *Player

func (*Player) Close

func (p *Player) Close()

func (*Player) HelpView

func (p *Player) HelpView() string

func (*Player) Init

func (p *Player) Init() tea.Cmd

func (*Player) OptionsView

func (p *Player) OptionsView() string

func (*Player) Update

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

func (*Player) View

func (p *Player) View() string

type Styles

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

	MarginX, MarginY string
}

func NewStyles

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

type ViewCache

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

func NewCache

func NewCache(update func() string) *ViewCache

func (*ViewCache) Invalidate

func (v *ViewCache) Invalidate()

func (*ViewCache) String

func (v *ViewCache) String() string

Jump to

Keyboard shortcuts

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