Documentation ¶
Index ¶
- func MusicDecode(data []byte) (beep.StreamSeekCloser, beep.Format, error)
- func StartIPCServer(port string)
- type Converter
- type DResults
- type Director
- type Music
- func (m *Music) DurationD() time.Duration
- func (m *Music) DurationN() int
- func (m *Music) PositionD() time.Duration
- func (m *Music) PositionN() int
- func (m *Music) Seek(d time.Duration) error
- func (m *Music) SetPositionD(d time.Duration) error
- func (m *Music) SetPositionN(p int) error
- func (m *Music) SetVolume(vp uint8)
- func (m *Music) Streamer() beep.StreamSeekCloser
- type MusicQueue
- func (q *MusicQueue) Clear()
- func (q *MusicQueue) Enqueue(music Music)
- func (q *MusicQueue) GetCurrIndex() int
- func (q *MusicQueue) GetCurrMusic() *Music
- func (q *MusicQueue) GetMusicByIndex(index int) *Music
- func (q *MusicQueue) GetMusicByName(name string) *Music
- func (q *MusicQueue) GetTitles() []string
- func (q *MusicQueue) IsEmpty() bool
- func (q *MusicQueue) QueueNext()
- func (q *MusicQueue) QueuePrev()
- func (q *MusicQueue) Remove(music *Music)
- func (q *MusicQueue) SetCurrIndex(index int)
- func (q *MusicQueue) SetCurrrMusic(m *Music)
- func (q *MusicQueue) Size() int
- type Player
- func (p *Player) AddMusicFromFile(path string, how callback) error
- func (p *Player) AddMusicFromHash(hash string, how callback) error
- func (p *Player) AddMusicFromOnline(unique string, engineName string, how callback) error
- func (p *Player) AddMusicsFromDir(dirPath string, how callback) error
- func (p *Player) CheckWhatIsThis(unknown string) DResults
- func (p *Player) CleanCache() error
- func (p *Player) CreatePlayList(plname string) error
- func (p *Player) DetectAndAddToPlayList(plname string, unknown string) ([]shared.SearchResult, error)
- func (p *Player) DetectAndPlay(unknown string) ([]shared.SearchResult, error)
- func (p *Player) GetAvailableMusicOptions(unknown string) []shared.SearchResult
- func (p *Player) GetCachedMusics() ([]shared.NameHash, error)
- func (p *Player) GetCurrMusicDuration() time.Duration
- func (p *Player) GetCurrMusicPosition() time.Duration
- func (p *Player) GetPlayListMusicNames(plname string) ([]string, error)
- func (p *Player) GetPlayerStatus() shared.Status
- func (p *Player) GetTheme() string
- func (p *Player) Next() error
- func (p *Player) Pause() error
- func (p *Player) Play() error
- func (p *Player) PlayListPlayAll(plname string) error
- func (p *Player) PlayListPlayMusic(plname string, music shared.IntOrString) error
- func (p *Player) PlayListsNames() ([]string, error)
- func (p *Player) Prev() error
- func (p *Player) RPCCleanCache(_ int, reply *int) error
- func (p *Player) RPCCreatePlayList(name string, reply *int) error
- func (p *Player) RPCDetectAndAddToPlayList(args shared.AddToPlayListArgs, reply *[]shared.SearchResult) error
- func (p *Player) RPCDetectAndPlay(query string, reply *[]shared.SearchResult) error
- func (p *Player) RPCGetCachedMusics(_ int, reply *[]shared.NameHash) error
- func (p *Player) RPCGetLogs(_ int, reply *[]string) error
- func (p *Player) RPCGetPlayerStatus(_ int, reply *shared.Status) error
- func (p *Player) RPCGetTheme(_ int, reply *string) error
- func (p *Player) RPCNext(_ int, reply *int) error
- func (p *Player) RPCPause(_ int, reply *int) error
- func (p *Player) RPCPlay(_ int, reply *int) error
- func (p *Player) RPCPlayListMusics(plname string, reply *[]string) error
- func (p *Player) RPCPlayListPlayAll(name string, reply *int) error
- func (p *Player) RPCPlayListPlayMusic(args shared.PlayListPlayMusicArgs, reply *int) error
- func (p *Player) RPCPlayListsNames(_ int, reply *[]string) error
- func (p *Player) RPCPrev(_ int, reply *int) error
- func (p *Player) RPCRemoveMusic(music shared.IntOrString, reply *int) error
- func (p *Player) RPCRemoveMusicFromPlayList(args shared.RemoveMusicFromPlayListArgs, reply *int) error
- func (p *Player) RPCRemovePlayList(name string, reply *int) error
- func (p *Player) RPCResume(_ int, reply *int) error
- func (p *Player) RPCSeek(d time.Duration, _ *int) error
- func (p *Player) RPCSetTheme(theme string, reply *int) error
- func (p *Player) RPCStop(_ int, reply *int) error
- func (p *Player) RPCVolume(vp uint8, reply *int) error
- func (p *Player) Remove(music shared.IntOrString) error
- func (p *Player) RemoveMusicFromPlayList(plname string, music shared.IntOrString) error
- func (p *Player) RemovePlayList(plname string) error
- func (p *Player) Resume() error
- func (p *Player) Seek(d time.Duration) error
- func (p *Player) SetTheme(theme string) error
- func (p *Player) Stop() error
- func (p *Player) Volume(vp uint8) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MusicDecode ¶
MusicDecode decodes MP3 data from a byte slice and returns a StreamSeekCloser and Format.
func StartIPCServer ¶
func StartIPCServer(port string)
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
func NewConverter ¶
type Director ¶
func NewDefaultDirector ¶
type Music ¶
func (*Music) SetPositionN ¶
func (*Music) Streamer ¶
func (m *Music) Streamer() beep.StreamSeekCloser
type MusicQueue ¶
type MusicQueue struct {
// contains filtered or unexported fields
}
func NewMusicQueue ¶
func NewMusicQueue() *MusicQueue
func (*MusicQueue) Clear ¶
func (q *MusicQueue) Clear()
func (*MusicQueue) Enqueue ¶
func (q *MusicQueue) Enqueue(music Music)
func (*MusicQueue) GetCurrIndex ¶
func (q *MusicQueue) GetCurrIndex() int
func (*MusicQueue) GetCurrMusic ¶
func (q *MusicQueue) GetCurrMusic() *Music
func (*MusicQueue) GetMusicByIndex ¶
func (q *MusicQueue) GetMusicByIndex(index int) *Music
func (*MusicQueue) GetMusicByName ¶
func (q *MusicQueue) GetMusicByName(name string) *Music
func (*MusicQueue) GetTitles ¶
func (q *MusicQueue) GetTitles() []string
func (*MusicQueue) IsEmpty ¶
func (q *MusicQueue) IsEmpty() bool
func (*MusicQueue) QueueNext ¶
func (q *MusicQueue) QueueNext()
func (*MusicQueue) QueuePrev ¶
func (q *MusicQueue) QueuePrev()
func (*MusicQueue) Remove ¶
func (q *MusicQueue) Remove(music *Music)
func (*MusicQueue) SetCurrIndex ¶
func (q *MusicQueue) SetCurrIndex(index int)
func (*MusicQueue) SetCurrrMusic ¶
func (q *MusicQueue) SetCurrrMusic(m *Music)
func (*MusicQueue) Size ¶
func (q *MusicQueue) Size() int
type Player ¶
type Player struct { Queue *MusicQueue Director *Director Tasks map[string]shared.Task Vol uint8 // contains filtered or unexported fields }
var Instance *Player
func (*Player) AddMusicFromFile ¶
func (*Player) AddMusicFromHash ¶ added in v0.0.30
func (*Player) AddMusicFromOnline ¶
the unique is the unique id of the music in the engine it can be url or id
func (*Player) AddMusicsFromDir ¶
this function is used to play music from a file that is not mp3/ it will convert it to mp3 in temp and add it to the queue
func (*Player) CheckWhatIsThis ¶
func (*Player) CleanCache ¶ added in v0.0.30
func (*Player) CreatePlayList ¶
#################### # Playlist methods # ####################
func (*Player) DetectAndAddToPlayList ¶
func (*Player) DetectAndPlay ¶
func (p *Player) DetectAndPlay(unknown string) ([]shared.SearchResult, error)
DetectAndPlay if result is empty, it means it detects and plays the music if succeed other wise it returns the search results
func (*Player) GetAvailableMusicOptions ¶
func (p *Player) GetAvailableMusicOptions(unknown string) []shared.SearchResult
func (*Player) GetCachedMusics ¶ added in v0.0.30
func (*Player) GetCurrMusicDuration ¶
func (*Player) GetCurrMusicPosition ¶
#################### # Player Info # ####################
func (*Player) GetPlayListMusicNames ¶
func (*Player) GetPlayerStatus ¶
func (*Player) Play ¶
############################ # Core Player methods # ############################
func (*Player) PlayListPlayAll ¶
func (*Player) PlayListPlayMusic ¶
func (p *Player) PlayListPlayMusic(plname string, music shared.IntOrString) error
func (*Player) PlayListsNames ¶
func (*Player) RPCCleanCache ¶ added in v0.0.30
func (*Player) RPCCreatePlayList ¶
func (*Player) RPCDetectAndAddToPlayList ¶
func (p *Player) RPCDetectAndAddToPlayList( args shared.AddToPlayListArgs, reply *[]shared.SearchResult, ) error
func (*Player) RPCDetectAndPlay ¶
func (p *Player) RPCDetectAndPlay(query string, reply *[]shared.SearchResult) error
func (*Player) RPCGetCachedMusics ¶ added in v0.0.30
func (*Player) RPCGetLogs ¶ added in v0.0.30
func (*Player) RPCGetPlayerStatus ¶
func (*Player) RPCPlayListMusics ¶
func (*Player) RPCPlayListPlayAll ¶
func (*Player) RPCPlayListPlayMusic ¶
func (p *Player) RPCPlayListPlayMusic(args shared.PlayListPlayMusicArgs, reply *int) error
func (*Player) RPCRemoveMusic ¶
func (p *Player) RPCRemoveMusic(music shared.IntOrString, reply *int) error
func (*Player) RPCRemoveMusicFromPlayList ¶
func (p *Player) RPCRemoveMusicFromPlayList( args shared.RemoveMusicFromPlayListArgs, reply *int, ) error
func (*Player) RPCRemovePlayList ¶
func (*Player) RemoveMusicFromPlayList ¶
func (p *Player) RemoveMusicFromPlayList(plname string, music shared.IntOrString) error
func (*Player) RemovePlayList ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.