Documentation ¶
Index ¶
- type ControlCommand
- type MpdPlayer
- func (player MpdPlayer) AddAlbum(album *model.Album) (err error)
- func (player MpdPlayer) AddTrack(track *model.Track) (err error)
- func (player MpdPlayer) AddTracks(tracks []*model.Track) (err error)
- func (player MpdPlayer) Clear() (err error)
- func (player *MpdPlayer) Close() (err error)
- func (player *MpdPlayer) GetCollection() (collection *model.Collection, err error)
- func (player *MpdPlayer) HandleControlCommand(cmd *ControlCommand) (err error)
- func (player *MpdPlayer) HandlePlaylistCommand(cmd *PlaylistCommand) (err error)
- func (player MpdPlayer) List() (results []PlaylistTrack, err error)
- func (player MpdPlayer) Next() (err error)
- func (player MpdPlayer) Pause() (err error)
- func (player MpdPlayer) Play() (err error)
- func (player MpdPlayer) Prev() (err error)
- func (player *MpdPlayer) Reconnect() (err error)
- func (player *MpdPlayer) RefreshCollection() (model.Collection, error)
- func (player *MpdPlayer) Status() (status PlayerStatus, err error)
- func (player MpdPlayer) Stop() (err error)
- func (player MpdPlayer) VolumeDelta(volumeDelta int) (err error)
- type Player
- type PlayerStatus
- type PlaylistCommand
- type PlaylistTrack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlCommand ¶
type MpdPlayer ¶
type MpdPlayer struct {
// contains filtered or unexported fields
}
Implement Player interface with MPD backend
func (*MpdPlayer) GetCollection ¶
func (player *MpdPlayer) GetCollection() (collection *model.Collection, err error)
these can all be defined on Player
func (*MpdPlayer) HandleControlCommand ¶
func (player *MpdPlayer) HandleControlCommand(cmd *ControlCommand) (err error)
func (*MpdPlayer) HandlePlaylistCommand ¶
func (player *MpdPlayer) HandlePlaylistCommand(cmd *PlaylistCommand) (err error)
func (MpdPlayer) List ¶
func (player MpdPlayer) List() (results []PlaylistTrack, err error)
*
- Implement playlist interface via mpd
func (*MpdPlayer) RefreshCollection ¶
func (player *MpdPlayer) RefreshCollection() (model.Collection, error)
func (*MpdPlayer) Status ¶
func (player *MpdPlayer) Status() (status PlayerStatus, err error)
func (MpdPlayer) VolumeDelta ¶
type Player ¶
type Player interface { GetCollection() (*model.Collection, error) RefreshCollection() (model.Collection, error) // Playlist methods List() ([]PlaylistTrack, error) AddAlbum(*model.Album) error AddTrack(*model.Track) error AddTracks([]*model.Track) error Clear() error // Player control methods Status() (status PlayerStatus, err error) HandleControlCommand(cmd *ControlCommand) error HandlePlaylistCommand(cmd *PlaylistCommand) error // Cleanup Close() error }
In theory we could have different backends, so define an interface that will allow for that.
type PlayerStatus ¶
type PlayerStatus struct { State string Volume int CurrentArtist string CurrentAlbum string CurrentTrack string Elapsed int Length int }
What we return when we ask for current status
type PlaylistCommand ¶
Click to show internal directories.
Click to hide internal directories.