예제 #1
0
        /// <summary>
        /// The constructor for the Spotify class.
        /// </summary>
        public Spotify()
        {
            // Load the latest config.
            LoadConfig();

            // Initialize a connection to the Spotify Web Helper application.
            // TODO: Catch if the App is not running.
            CommunicationService = SpotifyWebHelperApi.Create();

            // Request Dashboard Scaleform Movie
            DashboardScaleform = new Scaleform("dashboard", true);


            // Update on every game tick.
            this.Tick += Update;
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Creating the communication service...");
            var communicationService = SpotifyWebHelperApi.Create();

            Sleep();

            Console.WriteLine("Retrieving client data...");
            var clientVersion = communicationService.GetClientVersion();

            Sleep();
            Console.WriteLine("Which version of Spotify are we using? {0}", clientVersion.ClientVersion);
            Sleep();

            Console.WriteLine("Retrieving the current status...");
            var status = communicationService.GetStatus();

            Sleep();

            Console.WriteLine("Are we currently playing a song? {0}", status.Playing ? "Yes" : "No");
            Sleep();

            if (status.Playing)
            {
                Console.WriteLine("Which song are we playing? {0} by {1}", status.Track.TrackResource.Name, status.Track.ArtistResource.Name);
                Sleep();

                Console.WriteLine("Meh, this song isn't that great. Let's pause it!");
                var pausedStatus = communicationService.Pause();
                Sleep();
                Console.WriteLine("Are we paused? {0}", !pausedStatus.Playing ? "Yes" : "No");
                Sleep();
            }

            Console.WriteLine("Let's start a new song. Hmm...everybody loves the movie Frozen, right?");
            Sleep();
            var playedStatus = communicationService.Play("spotify:track:600HVBpzF1WfBdaRwbEvLz");

            Console.WriteLine("That's more like it!");
            Sleep();
            Console.WriteLine("Currently playing the song {0} by {1}", playedStatus.Track.TrackResource.Name, playedStatus.Track.ArtistResource.Name);

            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
예제 #3
0
        public static void Main()
        {
            Game.Console.Print($"SpotifyRage is now starting..");

            // Initialize a connection to the Spotify Web Helper application.
            // TODO: Catch if the App is not running.
            Game.Console.Print("Connecting to the Spotify Web Helper application.");
            CommunicationService = SpotifyWebHelperApi.Create();

            // Request Dashboard Scaleform Movie
            DashboardScaleform = new Scaleform("dashboard", true);


            // Update on every game tick.
            Game.FrameRender += Update;

            while (true)
            {
                GameFiber.Yield();
            }
        }