private async Task RunSpotifyConnect() { if (!SpotifyConnect.IsSpotifyInstalled()) { return; } if (!SpotifyConnect.IsSpotifyRunning()) { _form.WriteIntoConsole(FrmEspionSpotify.Rm.GetString($"logSpotifyConnecting")); await SpotifyConnect.Run(); } Running = true; }
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(); }