mp

package
v0.0.0-...-863df89 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPlayerRunning = errors.New("No player running")
	ErrNoFilepath      = errors.New("No filepath or URL")
)

Functions

This section is empty.

Types

type AudioDevice

type AudioDevice struct {
	ID          int
	Name        string
	Description string
	Current     bool
}

type Metadata

type Metadata struct {
	Title  string `json:"title"`
	Artist string `json:"artist"`
	Album  string `json:"album"`
	Genre  string `json:"genre"`
	Track  string `json:"track"`
	Date   string `json:"date"`

	Pos Position `json:"position"`
}

type Mp

type Mp struct {
	mpv.Client
}

Mp wraps mpv.Client

func Connect

func Connect(ctx *cli.Context) (*Mp, error)

TODO: remove this compat package and put stuff from pkg/com in here

func NewMp

func NewMp(socketPath string) (c *Mp, err error)

NewMp returns a new client on the socket at socketPath

func (*Mp) AudioDeviceList

func (c *Mp) AudioDeviceList() ([]AudioDevice, error)

func (*Mp) Clear

func (c *Mp) Clear() error

func (*Mp) GetAudioDevice

func (c *Mp) GetAudioDevice() (string, error)

func (*Mp) GetIntProperty

func (c *Mp) GetIntProperty(prop string) (int, error)

func (*Mp) Goto

func (c *Mp) Goto(pos int) error

func (*Mp) LoadAppend

func (c *Mp) LoadAppend(tracks ...string) error

func (*Mp) LoadListAppend

func (c *Mp) LoadListAppend(path string) error

func (*Mp) LoadListReplace

func (c *Mp) LoadListReplace(path string) error

func (*Mp) LoadNext

func (c *Mp) LoadNext(tracks ...string) error

func (*Mp) LoadPlay

func (c *Mp) LoadPlay(tracks ...string) error

func (*Mp) LoadReplace

func (c *Mp) LoadReplace(tracks ...string) error

func (*Mp) MediaTitle

func (c *Mp) MediaTitle() (string, error)

func (*Mp) Move

func (c *Mp) Move(from, to int) error

func (*Mp) Next

func (c *Mp) Next() error

func (*Mp) Now

func (c *Mp) Now() (meta Metadata, err error)

func (Mp) Paused

func (c Mp) Paused() bool

func (*Mp) Play

func (c *Mp) Play() error

func (*Mp) PlaylistLen

func (c *Mp) PlaylistLen() (int, error)

func (*Mp) PlaylistPos

func (c *Mp) PlaylistPos() (int, error)

func (*Mp) Prev

func (c *Mp) Prev() error

func (*Mp) Queue

func (c *Mp) Queue() (Queue, error)

func (*Mp) Quit

func (c *Mp) Quit() error

func (*Mp) Remove

func (c *Mp) Remove(n int) error

func (*Mp) SetAudioDevice

func (c *Mp) SetAudioDevice(id int) error

func (*Mp) Shuffle

func (c *Mp) Shuffle() error

func (*Mp) Stop

func (c *Mp) Stop() error

func (*Mp) Volume

func (c *Mp) Volume() (Volume, error)

func (*Mp) VolumeDown

func (c *Mp) VolumeDown(val float64) error

func (*Mp) VolumeUp

func (c *Mp) VolumeUp(val float64) error

type Position

type Position struct {
	Len         time.Duration `json:"duration"`
	Current     time.Duration `json:"current"`
	CurrentPerc float64       `json:"current_percent"`
}

type Queue

type Queue []Track

type Track

type Track struct {
	Index    int    `json:"index"`
	Title    string `json:"title"`
	Location string `json:"location"`
	Playing  bool   `json:"playing"`
	Current  bool   `json:"current"`
}

type Volume

type Volume float64

Jump to

Keyboard shortcuts

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