Exemplo n.º 1
0
        private void UpdateInterfaceTrackInfo(CurrentTrackResponse trackResp)
        {
            this.IsAutoTrackChangeEnabled = this.CheckBoxAutoSend.IsChecked;

            this.CurrentKeyBind          = this.TextBoxKeyBind.CurrentText;
            this.LabelWithButton.Content = this.TextBoxKeyBind.CurrentText;

            if (trackResp == null)
            {
                this.LabelArtist.Content    = "NowPlaying";
                this.LabelFormatted.Content = "Nothing is playing!";
                this.PlayingTrackName       = null;
                return;
            }

            if (trackResp.Id != this.PlayingTrackId ||
                trackResp.Name != this.PlayingTrackName) //локал треки не имеют айди и проходят мимо предыдущих условий
            {
                this.PlayingTrackId   = trackResp.Id;
                this.PlayingTrackName = trackResp.Name;

                AnimateLabel(trackResp.FormattedArtists, true, LabelArtist, new Thickness(0, 0, 0, 0));
                AnimateLabel(trackResp.Name, false, LabelFormatted, new Thickness(70, 344, 70, 0));

                this.ProgressBarSong.Value   = 0;
                this.ProgressBarSong.Maximum = trackResp.Duration / 1000;
            }

            if (trackResp.IsLocalFile)
            {
                this.LabelLocalFilesWarning.Visibility = Visibility.Visible;
            }
            else
            {
                this.LabelLocalFilesWarning.Visibility = Visibility.Collapsed;
            }

            this.LabelCurrentTime.Content   = $"{trackResp.ProgressMinutes.ToString()}:{trackResp.ProgressSeconds:00}";
            this.LabelEstimatedTime.Content = $"{trackResp.DurationMinutes.ToString()}:{trackResp.DurationSeconds:00}";
            LabelWindowHandle.Content       = AppInfo.State.WindowName;
            ProgressBarSong.Value           = trackResp.Progress / 1000;
        }
Exemplo n.º 2
0
        public void RewriteKeyBinding(CurrentTrackResponse currentTrack)
        {
            string strForWriting = string.Format(this.WriteConfigText, currentTrack.FullName);

            this.RewriteKeyBinding(strForWriting);
        }