當前位置: 首頁>>代碼示例>>Golang>>正文


Golang sconsify.Track類代碼示例

本文整理匯總了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
}
開發者ID:rdbrdd,項目名稱:sconsify,代碼行數:7,代碼來源:cui.go

示例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
}
開發者ID:simonwoerpel,項目名稱:sconsify,代碼行數:28,代碼來源:spotify_actions.go

示例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
}
開發者ID:ialbors,項目名稱:sconsify,代碼行數:40,代碼來源:spotify_actions.go

示例4: TrackPlaying

func (noui *NoUi) TrackPlaying(track *sconsify.Track) {
	noui.output.Print(fmt.Sprintf("Playing: %v\n", track.GetFullTitle()))
}
開發者ID:ialbors,項目名稱:sconsify,代碼行數:3,代碼來源:noui.go

示例5: TrackNotAvailable

func (cui *ConsoleUserInterface) TrackNotAvailable(track *sconsify.Track) {
	gui.flash("Not available: " + track.GetTitle())
}
開發者ID:rdbrdd,項目名稱:sconsify,代碼行數:3,代碼來源:cui.go

示例6: TrackPlaying

func (cui *ConsoleUserInterface) TrackPlaying(track *sconsify.Track) {
	gui.PlayingTrack = track
	gui.setStatus("Playing: " + track.GetFullTitle())
}
開發者ID:rdbrdd,項目名稱:sconsify,代碼行數:4,代碼來源:cui.go

示例7: TrackPaused

func (cui *ConsoleUserInterface) TrackPaused(track *sconsify.Track) {
	gui.setStatus("Paused: " + track.GetFullTitle())
}
開發者ID:rdbrdd,項目名稱:sconsify,代碼行數:3,代碼來源:cui.go


注:本文中的github.com/fabiofalci/sconsify/sconsify.Track類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。