player

package
Version: v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	HOOK_PLAYER_INITIALIZED = iota
	HOOK_FILE_LOAD_STARTED
	HOOK_PLAYBACK_PAUSED
	HOOK_PLAYBACK_RESUMED
	HOOK_VOLUME_CHANGED
	HOOK_FILE_LOADED
	HOOK_FILE_ENDED
	HOOK_GENERIC_UPDATE
	HOOK_LOOP_TRACK_CHANGED
	HOOK_PLAYLIST_SONG_CHANGED
	HOOK_LOOP_PLAYLIST_CHANGED
	HOOK_IDLE
	HOOK_SAVING_TRACK_TO_PLAYLIST
	HOOK_SEEK
)
View Source
const (
	LOOP_NONE = iota
	LOOP_TRACK
	LOOP_PLAYLIST
)

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
t or T : Toggle theme light dark auto
y or Y : Canonical URL