Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private bool IsNewTrack(Track track)
        {
            if (track == null)
            {
                return(false);
            }

            if (_currentTrack.Equals(track))
            {
                _form.UpdateIconSpotify(_isPlaying, RecorderUpAndRunning);
                return(false);
            }

            _isPlaying    = track.Playing;
            _currentTrack = track;

            _form.UpdatePlayingTitle(SongTitle);

            MutesSpotifyAds(AdPlaying);

            return(true);
        }