2014-01-07 15:26:03 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using SpotifyAPIv1;
|
|
|
|
|
using System.Threading;
|
2014-01-08 22:22:54 +00:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Drawing;
|
2014-01-07 15:26:03 +00:00
|
|
|
|
|
|
|
|
|
namespace DebugExample
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
2014-01-08 22:22:54 +00:00
|
|
|
|
static SpotifyAPI test;
|
2014-01-07 15:26:03 +00:00
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2014-01-08 22:22:54 +00:00
|
|
|
|
test = new SpotifyAPI();
|
2014-01-07 15:26:03 +00:00
|
|
|
|
test.Connect();
|
2014-01-08 22:22:54 +00:00
|
|
|
|
Console.WriteLine("Connected...");
|
|
|
|
|
test.Update();
|
|
|
|
|
Console.WriteLine("Updating first time...");
|
|
|
|
|
test.GetEventHandler().OnTrackNameChange += new SpotifyAPIv1.EventHandler.NameChangeEventHandler(namechange);
|
|
|
|
|
test.GetEventHandler().OnPlayStateChange += new SpotifyAPIv1.EventHandler.PlayStateEventHandler(playstate);
|
|
|
|
|
test.GetEventHandler().OnVolumeChange += new SpotifyAPIv1.EventHandler.VolumeChangeEventHandler(volumechange);
|
|
|
|
|
test.GetEventHandler().ListenForEvents(true);
|
|
|
|
|
Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
public static void namechange(NameChangeEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Old Name: " + e.old_track.GetName());
|
|
|
|
|
Console.WriteLine("New Name: " + e.new_track.GetName());
|
|
|
|
|
//API.API_AddChatMessage(0xFFFFFF, "{2ecc71}" + e.new_track.GetName() + " {FFFFFF}[by]{2ecc71} " + e.new_track.GetArtist() + " {8e44ad}[" + e.new_track.GetAlbum() + "]");
|
|
|
|
|
}
|
|
|
|
|
public static void playstate(PlayStateEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("PlayState: " + e.playing);
|
|
|
|
|
}
|
|
|
|
|
public static void volumechange(VolumeChangeEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("New Volume: " + e.new_volume);
|
2014-01-07 15:26:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|