本文整理匯總了Golang中github.com/fabiofalci/sconsify/sconsify.Track類的典型用法代碼示例。如果您正苦於以下問題:Golang Track類的具體用法?Golang Track怎麽用?Golang Track使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Track類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: addToQueue
func addToQueue(track *sconsify.Track) bool {
if queue.Add(track) == nil {
return false
}
fmt.Fprintf(gui.queueView, "%v\n", track.GetTitle())
return true
}
示例2: play
func (spotify *Spotify) play(trackUri *sconsify.Track) {
link, err := spotify.session.ParseLink(trackUri.Uri)
if err != nil {
return
}
track, err := link.Track()
if err != nil {
return
}
if trackUri.IsPartial() {
trackUri = sconsify.ToSconsifyTrack(track)
}
if !spotify.isTrackAvailable(track) {
spotify.events.TrackNotAvailable(trackUri)
return
}
player := spotify.session.Player()
if err := player.Load(track); err != nil {
return
}
player.Play()
spotify.events.TrackPlaying(trackUri)
spotify.currentTrack = trackUri
}
示例3: play
func (spotify *Spotify) play(trackUri *sconsify.Track) {
link, err := spotify.session.ParseLink(trackUri.URI)
if err != nil {
return
}
track, err := link.Track()
if err != nil {
return
}
if trackUri.IsPartial() {
trackUri = sconsify.ToSconsifyTrack(track)
}
if !spotify.isTrackAvailable(track) {
if trackUri.IsFromWebApi() {
retry := trackUri.RetryLoading()
if retry < 4 {
go func() {
time.Sleep(100 * time.Millisecond)
spotify.events.Play(trackUri)
}()
return
}
}
spotify.events.TrackNotAvailable(trackUri)
return
}
player := spotify.session.Player()
if err := player.Load(track); err != nil {
return
}
player.Play()
spotify.events.TrackPlaying(trackUri)
spotify.currentTrack = trackUri
spotify.paused = false
return
}
示例4: TrackPlaying
func (noui *NoUi) TrackPlaying(track *sconsify.Track) {
noui.output.Print(fmt.Sprintf("Playing: %v\n", track.GetFullTitle()))
}
示例5: TrackNotAvailable
func (cui *ConsoleUserInterface) TrackNotAvailable(track *sconsify.Track) {
gui.flash("Not available: " + track.GetTitle())
}
示例6: TrackPlaying
func (cui *ConsoleUserInterface) TrackPlaying(track *sconsify.Track) {
gui.PlayingTrack = track
gui.setStatus("Playing: " + track.GetFullTitle())
}
示例7: TrackPaused
func (cui *ConsoleUserInterface) TrackPaused(track *sconsify.Track) {
gui.setStatus("Paused: " + track.GetFullTitle())
}