private void BindSpotifyEventHandlers() { Spotify = new SpotifyHandler(_userSettings.SpotifyAudioSession) { ListenForEvents = true }; Spotify.OnPlayStateChange += OnPlayStateChanged; Spotify.OnTrackChange += OnTrackChanged; Spotify.OnTrackTimeChange += OnTrackTimeChanged; }
private async Task RunSpotifyConnect() { if (SpotifyConnect.IsSpotifyInstalled() && !SpotifyConnect.IsSpotifyRunning()) { _form.WriteIntoConsole(FrmEspionSpotify.Rm.GetString($"logSpotifyConnecting")); } SpotifyConnect.Run(); _userSettings.SpotifyAudioSession = new AudioSessions.SpotifyAudioSession(); await _userSettings.SpotifyAudioSession.WaitSpotifyAudioSessionToStart(); Spotify = new SpotifyHandler(_userSettings.SpotifyAudioSession) { ListenForEvents = true }; Spotify.OnPlayStateChange += OnPlayStateChanged; Spotify.OnTrackChange += OnTrackChanged; Spotify.OnTrackTimeChange += OnTrackTimeChanged; _currentTrack = Spotify.GetTrack(); }