Documentation ¶
Index ¶
- Constants
- Variables
- type MusicPlayer
- type Player
- func (p *Player) Add(url, actionUser string) (songs []songplayer.Playable, err error)
- func (p *Player) AddSongPlayer(player songplayer.SongPlayer)
- func (p *Player) EmptyQueue()
- func (p *Player) GetCurrent() (song songplayer.Playable, remaining time.Duration)
- func (p *Player) GetHistory() (songs []songplayer.Playable)
- func (p *Player) GetQueue() (songs []songplayer.Playable)
- func (p *Player) GetSongPlayer(name string) (songPlayer songplayer.SongPlayer)
- func (p *Player) GetSongPlayers() (players []songplayer.SongPlayer)
- func (p *Player) GetStatistics() (stats *Statistics)
- func (p *Player) GetStatus() (status Status)
- func (p *Player) Init()
- func (p *Player) Insert(url string, queuePosition int, actionUser string) (songs []songplayer.Playable, err error)
- func (p *Player) Jump(deltaIndex int) (song songplayer.Playable, err error)
- func (p *Player) Next() (song songplayer.Playable, err error)
- func (p *Player) Pause() (err error)
- func (p *Player) Play() (song songplayer.Playable, err error)
- func (p *Player) Previous() (song songplayer.Playable, err error)
- func (p *Player) Remove(queuePosition, amount int) (err error)
- func (p *Player) Seek(positionSeconds int) (err error)
- func (p *Player) ShuffleQueue()
- func (p *Player) Stop() (err error)
- type QueueStorage
- type Statistics
- type StatsStorage
- type Status
Constants ¶
View Source
const ( EVENT_QUEUE_ERROR_LOADING = "queue_error_loading" EVENT_QUEUE_LOADED = "queue_loaded" EVENT_QUEUE_UPDATED = "queue_updated" EVENT_STATS_ERROR_LOADING = "stats_error_loading" EVENT_STATS_LOADED = "stats_loaded" EVENT_STATS_UPDATED = "stats_updated" EVENT_ADDED_SONGS_USER = "added_songs_user" EVENT_SONGS_ADDED = "songs_added" EVENT_SONGS_REMOVED = "songs_removed" EVENT_NEXT_SONG = "next_song" EVENT_PREVIOUS_SONG = "previous_song" EVENT_JUMP_SONG = "jump_song" EVENT_PLAY_START = "play_start" EVENT_PLAY_DONE = "play_done" EVENT_SONG_SEEK = "song_seek" EVENT_PAUSE = "pause" EVENT_UNPAUSE = "unpause" EVENT_STOP = "stop" EVENT_QUEUE_DONE = "queue_done" )
Variables ¶
View Source
var ErrNothingPlaying = errors.New("nothing currently playing")
Functions ¶
This section is empty.
Types ¶
type MusicPlayer ¶
type MusicPlayer interface { eventemitter.Observable GetSongPlayer(name string) (player songplayer.SongPlayer) GetSongPlayers() (players []songplayer.SongPlayer) GetHistory() (songs []songplayer.Playable) GetQueue() (songs []songplayer.Playable) GetCurrent() (song songplayer.Playable, remaining time.Duration) Add(url, actionUser string) (addedSongs []songplayer.Playable, err error) Insert(url string, queuePosition int, actionUser string) (addedSongs []songplayer.Playable, err error) Remove(queuePosition, amount int) (err error) ShuffleQueue() EmptyQueue() GetStatus() (status Status) Play() (song songplayer.Playable, err error) Seek(positionSeconds int) (err error) Next() (song songplayer.Playable, err error) Previous() (song songplayer.Playable, err error) Jump(deltaIndex int) (song songplayer.Playable, err error) Stop() (err error) Pause() (err error) GetStatistics() (stats *Statistics) }
type Player ¶
type Player struct { *eventemitter.Emitter // contains filtered or unexported fields }
func (*Player) Add ¶ added in v1.5.0
func (p *Player) Add(url, actionUser string) (songs []songplayer.Playable, err error)
func (*Player) AddSongPlayer ¶
func (p *Player) AddSongPlayer(player songplayer.SongPlayer)
func (*Player) EmptyQueue ¶
func (p *Player) EmptyQueue()
func (*Player) GetCurrent ¶ added in v1.5.0
func (p *Player) GetCurrent() (song songplayer.Playable, remaining time.Duration)
func (*Player) GetHistory ¶ added in v1.5.0
func (p *Player) GetHistory() (songs []songplayer.Playable)
func (*Player) GetQueue ¶ added in v1.5.0
func (p *Player) GetQueue() (songs []songplayer.Playable)
func (*Player) GetSongPlayer ¶
func (p *Player) GetSongPlayer(name string) (songPlayer songplayer.SongPlayer)
func (*Player) GetSongPlayers ¶
func (p *Player) GetSongPlayers() (players []songplayer.SongPlayer)
func (*Player) GetStatistics ¶ added in v1.5.0
func (p *Player) GetStatistics() (stats *Statistics)
func (*Player) Jump ¶ added in v1.5.0
func (p *Player) Jump(deltaIndex int) (song songplayer.Playable, err error)
func (*Player) Previous ¶ added in v1.5.0
func (p *Player) Previous() (song songplayer.Playable, err error)
func (*Player) ShuffleQueue ¶
func (p *Player) ShuffleQueue()
type QueueStorage ¶ added in v1.5.0
type QueueStorage struct {
// contains filtered or unexported fields
}
func NewQueueStorage ¶ added in v1.5.0
func NewQueueStorage(path string) (qs *QueueStorage)
func (*QueueStorage) OnQueueUpdate ¶ added in v1.5.0
func (qs *QueueStorage) OnQueueUpdate(args ...interface{})
func (*QueueStorage) ReadQueue ¶ added in v1.5.0
func (qs *QueueStorage) ReadQueue() (urls []string, err error)
type Statistics ¶ added in v1.5.0
type StatsStorage ¶ added in v1.5.0
type StatsStorage struct {
// contains filtered or unexported fields
}
func NewStatsStorage ¶ added in v1.5.0
func NewStatsStorage(path string) (qs *StatsStorage)
func (*StatsStorage) OnStatsUpdate ¶ added in v1.5.0
func (s *StatsStorage) OnStatsUpdate(args ...interface{})
func (*StatsStorage) ReadStats ¶ added in v1.5.0
func (s *StatsStorage) ReadStats() (stats *Statistics, err error)
func (*StatsStorage) SaveStats ¶ added in v1.5.0
func (s *StatsStorage) SaveStats(stats *Statistics) (err error)
Click to show internal directories.
Click to hide internal directories.