private void OnPlayStateChanged(object sender, PlayStateEventArgs e) { var playing = e.Playing; var song = Spotify.Instance.GetStatus().Track; if (playing == _isPlaying) { return; } _isPlaying = playing; if (song != null) { _currentSong = new Song(song); _lastKnownSong = new Song(); } if (_isPlaying) { _sound.SetSpotifyToMute(AdPlaying); _form.UpdatePlayingTitle(SongTitle); } else { _form.UpdatePlayingTitle("Spotify"); } _form.UpdateIconSpotify(_isPlaying); }
private bool IsNewTrack(SpotifyAPI.Local.Models.Track track) { if (track == null) { return(false); } var newSong = new Song(track); if (_currentSong.Equals(newSong)) { _form.UpdateIconSpotify(_isPlaying, RecorderUpAndRunning); return(false); } _currentSong = newSong; _form.UpdatePlayingTitle(SongTitle); _sound.SetSpotifyToMute(AdPlaying); return(true); }