Documentation ¶
Index ¶
- Constants
- Variables
- func AppendFile(filePath string) error
- func ClearPlaylist() error
- func FetchLyric()
- func ForceUpdate()
- func GetPosition() (float64, error)
- func Initialize()
- func LoadFile(filePath string) error
- func LoopNone() error
- func LoopPlaylist() error
- func LoopTrack() error
- func Pause() error
- func Play() error
- func PlayPause() error
- func PlaySearchResult(result *search.SearchResult, playlist *storage.Playlist) error
- func PlaylistNext() error
- func PlaylistPrevious() error
- func RegisterHook(cb HookCallback, hookType int)
- func RegisterHooks(cb HookCallback, hookTypes ...int)
- func RemoveCurrentFromPlaylist() error
- func SaveToPlaylist()
- func Seek(seconds int) error
- func SetPosition(pos float64) error
- func SetVolume(volume float64) error
- func Stop() error
- type HookCallback
- type LoopStatus
- type PlayerState
- type SongLyric
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 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 Initialize ¶ added in v0.0.2
func Initialize()
func LoopPlaylist ¶ added in v0.0.2
func LoopPlaylist() 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 SetPosition ¶ added in v0.0.2
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
Click to show internal directories.
Click to hide internal directories.