Documentation ¶
Index ¶
- Variables
- type EventHandler
- type PlayState
- type Session
- func (s *Session) PlayTrack(path, next string)
- func (s *Session) Seek(pos float64) error
- func (s *Session) SetHandler(h EventHandler)
- func (s *Session) SetMute(muted bool) error
- func (s *Session) SetPlay(playing bool) error
- func (s *Session) SetVolume(perc float64) error
- func (s *Session) Start()
- func (s *Session) Stop()
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoPlaylistLoaded = errors.New("no playlist loaded")
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface { OnSongFinish() OnPauseUpdate(pause bool) }
EventHandler methods are all called in the glib main thread.
type PlayState ¶
type PlayState struct {
// contains filtered or unexported fields
}
PlayState wraps the current playback state.
type Session ¶
type Session struct { Playback *mpvipc.Connection PlayState *PlayState Command *exec.Cmd // OnAsyncError is called on both nil and non-nil. OnAsyncError func(error) // contains filtered or unexported fields }
func NewSession ¶
func (*Session) PlayTrack ¶
PlayTrack asynchronously loads and plays a file. An error is not returned because mpv doesn't seem to return one regardless.
func (*Session) SetHandler ¶
func (s *Session) SetHandler(h EventHandler)
Click to show internal directories.
Click to hide internal directories.