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


Golang Events.NewPlaylist方法代碼示例

本文整理匯總了Golang中github.com/fabiofalci/sconsify/sconsify.Events.NewPlaylist方法的典型用法代碼示例。如果您正苦於以下問題:Golang Events.NewPlaylist方法的具體用法?Golang Events.NewPlaylist怎麽用?Golang Events.NewPlaylist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/fabiofalci/sconsify/sconsify.Events的用法示例。


在下文中一共展示了Events.NewPlaylist方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Initialise

func Initialise(events *sconsify.Events) {
	playlists := sconsify.InitPlaylists()

	tracks := make([]*sconsify.Track, 2)
	tracks[0] = sconsify.InitTrack("bobmarley0", bobMarley, "Waiting in vain", "2m3s")
	tracks[1] = sconsify.InitTrack("bobmarley1", bobMarley, "Testing", "5m3s")
	playlists.AddPlaylist(sconsify.InitPlaylist("bobmarleyplaylist0", "Bob Marley", tracks))

	folderPlaylists := make([]*sconsify.Playlist, 2)

	tracks = make([]*sconsify.Track, 2)
	tracks[0] = sconsify.InitTrack("bobmarley2", bobMarley, "Waiting in vain", "2m3s")
	tracks[1] = sconsify.InitTrack("bobmarley3", bobMarley, "Testing", "5m3s")
	folderPlaylists[0] = sconsify.InitPlaylist("bobmarleyplaylist1", " Bob Marley and The Wailers", tracks)

	tracks = make([]*sconsify.Track, 3)
	tracks[0] = sconsify.InitTrack("ramones0", theRamones, "Ramones", "2m3s")
	tracks[1] = sconsify.InitTrack("ramones1", theRamones, "Ramones...", "3m21s")
	tracks[2] = sconsify.InitTrack("ramones2", theRamones, "The Ramones", "1m9s")
	folderPlaylists[1] = sconsify.InitPlaylist("ramonesplaylist0", " The Ramones", tracks)

	playlists.AddPlaylist(sconsify.InitFolder("folder", "My folder", folderPlaylists))

	tracks = make([]*sconsify.Track, 3)
	tracks[0] = sconsify.InitTrack("ramones3", theRamones, "I wanna be sedated", "2m3s")
	tracks[1] = sconsify.InitTrack("ramones4", theRamones, "Pet semetary", "3m21s")
	tracks[2] = sconsify.InitTrack("ramones5", theRamones, "Judy is a punk", "1m9s")
	playlists.AddPlaylist(sconsify.InitPlaylist("ramonesplaylist1", "Ramones", tracks))

	events.NewPlaylist(playlists)
	waitForMockEvents(events)
}
開發者ID:KoehlerClem,項目名稱:sconsify,代碼行數:32,代碼來源:spotify_mock.go

示例2: waitForMockEvents

func waitForMockEvents(events *sconsify.Events) {
	for {
		select {
		case <-events.PlayUpdates():
		case <-events.PauseUpdates():
		case <-events.ReplayUpdates():
		case <-events.ShutdownSpotifyUpdates():
			events.ShutdownEngine()
		case <-events.SearchUpdates():
			events.NewPlaylist(getSearchedPlaylist())
		}
	}
}
開發者ID:KoehlerClem,項目名稱:sconsify,代碼行數:13,代碼來源:spotify_mock.go

示例3: sendNewPlaylist

func sendNewPlaylist(events *sconsify.Events) {
	playlists := sconsify.InitPlaylists()
	playlists.AddPlaylist(createDummyPlaylist())
	events.NewPlaylist(playlists)
}
開發者ID:KoehlerClem,項目名稱:sconsify,代碼行數:5,代碼來源:noui_test.go


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