player

package
v0.0.0-...-3cb6ec2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Playing = "Playing"
	Paused  = "Paused"
	Stopped = "Stopped"
)

Variables

This section is empty.

Functions

func FormatPosition

func FormatPosition(ms int64) string

func ListPlayers

func ListPlayers(bus *dbus.Conn) ([]string, error)

Types

type Player

type Player struct {
	DB            *sql.DB
	Bus           *dbus.Conn
	Cli           *cli.PbmCli
	Cmd           *exec.Cmd
	Bookmark      *model.Bookmark
	BusName       string
	NameOwner     string
	MprisObj      dbus.BusObject
	Position      int64
	PositionTime  time.Time
	TrackId       dbus.ObjectPath
	Status        string
	Length        int64
	ProcessFinish chan error
	Signals       chan *dbus.Signal
	ExitCode      int
}

func New

func New(cli *cli.PbmCli, db *sql.DB, bus *dbus.Conn) *Player

func (*Player) EnsureBookmark

func (player *Player) EnsureBookmark() error

func (*Player) GetPropertiesRemote

func (player *Player) GetPropertiesRemote() (*Properties, error)

func (*Player) HasBookmark

func (player *Player) HasBookmark() bool

func (*Player) LoadBookmark

func (player *Player) LoadBookmark(url *model.XesamUrl) error

func (*Player) Manage

func (player *Player) Manage() error

func (*Player) RunCmd

func (player *Player) RunCmd() error

func (*Player) SaveBookmark

func (player *Player) SaveBookmark() error

func (*Player) SetName

func (player *Player) SetName(name string)

func (*Player) SetPlayerProperties

func (player *Player) SetPlayerProperties(properties *Properties)

type PlayerCmdError

type PlayerCmdError struct {
	ExitCode int
	// contains filtered or unexported fields
}

func (*PlayerCmdError) Error

func (e *PlayerCmdError) Error() string

type Properties

type Properties struct {
	Position    int64
	HasPosition bool
	Length      int64
	HasLength   bool
	Url         *model.XesamUrl
	Status      string
	TrackId     dbus.ObjectPath
}

Jump to

Keyboard shortcuts

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