func main() { infrastructure.ProcessSconsifyrc() fmt.Println("Sconsify - your awesome Spotify music service in a text-mode interface.") events := sconsify.InitialiseEvents() go mock.Initialise(events) go testSequence() ui := ui.InitialiseConsoleUserInterface(events) sconsify.StartMainLoop(events, ui, false) println(output.String()) }
func main() { infrastructure.ProcessSconsifyrc() providedUsername := flag.String("username", "", "Spotify username.") providedWebApi := flag.Bool("web-api", false, "Use Spotify WEB API for more features. It requires web authorization.") providedUi := flag.Bool("ui", true, "Run Sconsify with Console User Interface. If false then no User Interface will be presented and it'll shuffle tracks.") providedPlaylists := flag.String("playlists", "", "Select just some Playlists to play. Comma separated list.") providedPreferredBitrate := flag.String("preferred-bitrate", "320k", "Preferred bitrate: 96k, 160k, 320k (default).") providedNoUiSilent := flag.Bool("noui-silent", false, "Silent mode when no UI is used.") providedNoUiRepeatOn := flag.Bool("noui-repeat-on", true, "Play your playlist and repeat it after the last track.") providedNoUiShuffle := flag.Bool("noui-shuffle", true, "Shuffle tracks or follow playlist order.") providedDebug := flag.Bool("debug", false, "Enable debug mode.") askingVersion := flag.Bool("version", false, "Print version.") flag.Parse() if *askingVersion { fmt.Println("Version: " + version) fmt.Println("Git commit: " + commit) fmt.Println("Build date: " + buildDate) os.Exit(0) } if *providedDebug { infrastructure.InitialiseLogger() defer infrastructure.CloseLogger() } fmt.Println("Sconsify - your awesome Spotify music service in a text-mode interface.") username, pass := credentials(providedUsername) events := sconsify.InitialiseEvents() var client *webspotify.Client if *providedWebApi { client = webapi.Auth(spotifyClientId, authRedirectUrl) } go spotify.Initialise(client, username, pass, events, providedPlaylists, providedPreferredBitrate) if *providedUi { ui := ui.InitialiseConsoleUserInterface(events, true) sconsify.StartMainLoop(events, ui, false) } else { var output ui.Printer if *providedNoUiSilent { output = new(ui.SilentPrinter) } ui := ui.InitialiseNoUserInterface(events, output, providedNoUiRepeatOn, providedNoUiShuffle) sconsify.StartMainLoop(events, ui, true) } }
func main() { runTest := flag.Bool("run-test", false, "Run the test sequence.") flag.Parse() fmt.Println("Sconsify - your awesome Spotify music service in a text-mode interface.") events := sconsify.InitialiseEvents() infrastructure.InitialiseLogger() defer infrastructure.CloseLogger() go mock.Initialise(events) if *runTest { go runTests() } ui := ui.InitialiseConsoleUserInterface(events, false) sconsify.StartMainLoop(events, ui, false) println(output.String()) sleep() // otherwise gocui eventually fails to quit properly }