func assertNoNextTrack(events *sconsify.Events, finished chan bool) { events.NextPlay() // playing spotify shutdown here <-events.ShutdownSpotifyUpdates() events.ShutdownEngine() <-finished }
func assertShutdown(t *testing.T, ui sconsify.UserInterface, events *sconsify.Events, finished chan bool) { go ui.Shutdown() // playing spotify shutdown here <-events.ShutdownSpotifyUpdates() events.ShutdownEngine() if !<-finished { t.Errorf("Not properly finished") } }
func waitForMockEvents(events *sconsify.Events) { for { select { case <-events.PlayUpdates(): case <-events.PauseUpdates(): case <-events.ReplayUpdates(): case <-events.ShutdownSpotifyUpdates(): events.ShutdownEngine() case <-events.SearchUpdates(): } } }
func Initialise(webApiAuth bool, username string, pass []byte, events *sconsify.Events, playlistFilter *string, preferredBitrate *string) { if err := initialiseSpotify(webApiAuth, username, pass, events, playlistFilter, preferredBitrate); err != nil { fmt.Printf("Error: %v\n", err) events.ShutdownEngine() } }
func Initialise(initConf *SpotifyInitConf, username string, pass []byte, events *sconsify.Events) { if err := initialiseSpotify(initConf, username, pass, events); err != nil { fmt.Printf("Error: %v\n", err) events.ShutdownEngine() } }
func Initialise(username string, pass []byte, events *sconsify.Events, playlistFilter *string) { if err := initialiseSpotify(username, pass, events, playlistFilter); err != nil { fmt.Printf("Error: %v\n", err) events.ShutdownEngine() } }