player

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookPlayerInitialized = iota
	HookFileLoadStarted
	HookPlaybackPaused
	HookPlaybackResumed
	HookVolumeChanged
	HookFileLoaded
	HookFileEnded
	HookGenericUpdate
	HookLoopTrackChanged
	HookPlaylistSongChanged
	HookLoopPlaylistChanged
	HookIdle
	HookSavingTrackToPlaylist
	HookSeek
)
View Source
const (
	StatusLoopNone = iota
	StatusLoopTrack
	StatusLoopPlaylist
)

Variables

View Source
var MpvInstance *mpv.Mpv

Functions

func AppendFile added in v0.0.2

func AppendFile(filePath string) error

func ClearPlaylist added in v0.0.2

func ClearPlaylist() error

func FetchLyric added in v0.0.2

func FetchLyric()

func ForceUpdate added in v0.0.2

func ForceUpdate()

func GetPosition added in v0.0.2

func GetPosition() (float64, error)

func Initialize added in v0.0.2

func Initialize()

func LoadFile added in v0.0.2

func LoadFile(filePath string) error

func LoopNone added in v0.0.2

func LoopNone() error

func LoopPlaylist added in v0.0.2

func LoopPlaylist() error

func LoopTrack added in v0.0.2

func LoopTrack() error

func Pause added in v0.0.2

func Pause() error

func Play added in v0.0.2

func Play() error

func PlayPause added in v0.0.2

func PlayPause() error

func PlaySearchResult added in v0.0.2

func PlaySearchResult(result *search.SearchResult, playlist *storage.Playlist) error

func PlaylistNext added in v0.0.2

func PlaylistNext() error

func PlaylistPrevious added in v0.0.2

func PlaylistPrevious() error

func RegisterHook added in v0.0.2

func RegisterHook(cb HookCallback, hookType int)

func RegisterHooks added in v0.0.2

func RegisterHooks(cb HookCallback, hookTypes ...int)

func RemoveCurrentFromPlaylist added in v0.0.2

func RemoveCurrentFromPlaylist() error

func SaveToPlaylist added in v0.0.2

func SaveToPlaylist()

func Seek added in v0.0.2

func Seek(seconds int) error

func SetPosition added in v0.0.2

func SetPosition(pos float64) error

func SetVolume added in v0.0.2

func SetVolume(volume float64) error

func Stop added in v0.0.2

func Stop() error

Types

type HookCallback added in v0.0.2

type HookCallback func(params ...interface{})

type LoopStatus added in v0.0.2

type LoopStatus int

type PlayerState added in v0.0.2

type PlayerState struct {
	Data                         *storage.TunerData
	Paused                       bool
	Idle                         bool
	Result                       *search.SearchResult
	Playlist                     *storage.Playlist
	PlaylistIndex                int
	Volume                       float64
	Duration                     float64
	ShowHelp, ShowURL, ShowLyric bool
	Lyric                        SongLyric
	Loop                         LoopStatus
	SavingToPlaylist             bool
}
var State *PlayerState

func (*PlayerState) GetPlaying added in v0.0.2

func (s *PlayerState) GetPlaying() *search.SearchResult

func (*PlayerState) IsPlaylist added in v0.0.2

func (s *PlayerState) IsPlaylist() bool

type SongLyric added in v0.0.2

type SongLyric struct {
	Lines []string
	Index int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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