public MainForm() { InitializeComponent(); //Query.ConnectQueryAsync(); config = new SpotifyLocalAPIConfig { ProxyConfig = new ProxyConfig() }; spotify = new SpotifyLocalAPI(config); Task.Run(() => WebApi.RunAuthentication()); //Creates files needed SetFileLocation(false); CreatePlaylistFile(); //Sets the listners spotify.OnTrackTimeChange += OnTrackTimeChange; spotify.OnTrackChange += OnTrackChange; spotify.OnPlayStateChange += OnStateChange; Playlist.CreateBackgroundPlaylist(); UpdateSongInfo(); }
public SpotifyHelper() { var config = new SpotifyLocalAPIConfig { ProxyConfig = new ProxyConfig() }; _spotify = new SpotifyLocalAPI(config); Connect(); }
public void AuthSpotify() { _config = new SpotifyLocalAPIConfig { ProxyConfig = new ProxyConfig() }; _spotify = new SpotifyLocalAPI(_config); _spotify.ListenForEvents = true; }
public SpotifyService() { m_proxyConfig = new ProxyConfig(); m_localProxyConfig = new SpotifyLocalAPIConfig { ProxyConfig = new ProxyConfig() { Port = 80, } }; }
private void DisposeLocalAPI() { if (this.localAPI != null) { this.localAPI.ListenForEvents = false; this.localAPI.OnTrackChange -= this.SpotifyLocalAPI_OnTrackChange; this.localAPI.OnPlayStateChange -= this.SpotifyLocalAPI_OnPlayStateChange; this.localAPI.OnTrackTimeChange -= this.SpotifyLocalAPI_OnTrackTimeChange; this.localAPI.OnVolumeChange -= this.SpotifyLocalAPI_OnVolumeChange; this.localAPI.Dispose(); this.localAPI = null; } this.localAPIConfig = null; }
public void InitLocalAPI() { this.DisposeLocalAPI(); this.localAPIConfig = new SpotifyLocalAPIConfig { TimerInterval = 500, ProxyConfig = App.ProxyConfig.ProxyConfig }; this.localAPI = new SpotifyLocalAPI(this.localAPIConfig); this.localAPI.OnTrackChange += this.SpotifyLocalAPI_OnTrackChange; this.localAPI.OnPlayStateChange += this.SpotifyLocalAPI_OnPlayStateChange; this.localAPI.OnTrackTimeChange += this.SpotifyLocalAPI_OnTrackTimeChange; this.localAPI.OnVolumeChange += this.SpotifyLocalAPI_OnVolumeChange; this.localAPI.ListenForEvents = true; }
public LocalControl() { InitializeComponent(); _config = new SpotifyLocalAPIConfig { ProxyConfig = new ProxyConfig() }; _spotify = new SpotifyLocalAPI(_config); _spotify.OnPlayStateChange += _spotify_OnPlayStateChange; _spotify.OnTrackChange += _spotify_OnTrackChange; _spotify.OnTrackTimeChange += _spotify_OnTrackTimeChange; _spotify.OnVolumeChange += _spotify_OnVolumeChange; //_spotify.SynchronizingObject = this; artistLinkLabel.Click += (sender, args) => Process.Start(artistLinkLabel.Tag.ToString()); albumLinkLabel.Click += (sender, args) => Process.Start(albumLinkLabel.Tag.ToString()); titleLinkLabel.Click += (sender, args) => Process.Start(titleLinkLabel.Tag.ToString()); }