Documentation ¶
Index ¶
- Constants
- func Release()
- type Music
- type Player
- func (p *Player) AttachFile(file string)
- func (p *Player) AttachFileWeb(url string)
- func (p *Player) EmptyPlayList()
- func (p *Player) FreeStream(handle uint) uint32
- func (p *Player) GetCurrentIndex() int
- func (p *Player) GetLastIndex() int
- func (p *Player) GetNextIndex() int
- func (p *Player) GetRandomIndex() int
- func (p *Player) GetVolume() uint
- func (p *Player) Last()
- func (p *Player) Next()
- func (p *Player) Pause()
- func (p *Player) Play()
- func (p *Player) RefreshPlayURL()
- func (p *Player) RemoveFile(index int)
- func (p *Player) SetCurrentIndex(index int)
- func (p *Player) SetPlayFeature(fea int)
- func (p *Player) SetPlayMode(mode int)
- func (p *Player) SetVolume(value uint) uint
- func (p *Player) Stop()
Constants ¶
View Source
const ( NoStatus = -1 StatusPlaying = 0 StatusPaused = 1 StatusStopped = 2 StatusOther = 3 )
Play Status
View Source
const ( ModeListLoop = 0 ModeSingleLoop = 1 ModeRandom = 2 ModeSingleStop = 3 )
Play Modes
View Source
const ( SourceFile = 0 SourceWeb = 1 )
Play Source Type
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Music ¶
type Music struct { ID int Name string Author string Album string Cover string Length int FilePath string Handle uint PlaySourceType int }
Music 歌曲
type Player ¶
type Player struct { Status uint PlayFeature int PlayMode int LastSecond int CurrentLength int Playlist []Music NowPlayingIndex int LastIndex int NowPlayingSheetID int LastHandle uint Login *account.Login LyricSwitch bool Volume uint IsShowProgress bool }
Player 音乐播放器
func (*Player) AttachFileWeb ¶
AttachFileWeb 添加一个网络文件到播放器播放列表
func (*Player) FreeStream ¶
FreeStream 释放handle占用的资源
func (*Player) GetCurrentIndex ¶
GetCurrentIndex 获取播放列表当前播放序号
func (*Player) GetRandomIndex ¶
GetRandomIndex 获取随机的播放序号,用于随机模式。
func (*Player) RefreshPlayURL ¶
func (p *Player) RefreshPlayURL()
RefreshPlayURL 刷新歌曲的URL,建议每次播放前执行一次,防止链接实效。
func (*Player) SetCurrentIndex ¶
SetCurrentIndex 设置播放列表当前播放序号
func (*Player) SetPlayFeature ¶
SetPlayFeature 设置播放特点 [我喜欢的|FM|日推等]
func (*Player) SetPlayMode ¶
SetPlayMode 设置播放模式 [列表循环|单曲循环|随即|单曲结束等]
Click to show internal directories.
Click to hide internal directories.