Example #1
0
 private void _spotify_OnTrackTimeChange(object sender, TrackTimeChangeEventArgs e)
 {
     timeLabel.Text = $"{FormatTime(e.TrackTime)}/{FormatTime(_currentTrack.Length)}";
     timeProgressBar.Value = (int)e.TrackTime;
 }
 private void _spotify_OnTrackTimeChange(TrackTimeChangeEventArgs e)
 {
     timeLabel.Text = FormatTime(e.TrackTime) + "/" + FormatTime(_currentTrack.Length);
     timeProgressBar.Value = (int)e.TrackTime;
 }
Example #3
0
 private void spotify_OnTrackTimeChange(object sender, TrackTimeChangeEventArgs e)
 {
     lblCurrentTime.Text = formatTime(e.TrackTime);
     trackPlaytime.Value = Convert.ToInt32(e.TrackTime * 100);
 }
Example #4
0
 private void OnLocalTrackTimeChange(object sender, SpotifyAPI.Local.TrackTimeChangeEventArgs e)
 {
     OnTrackTimeChange?.Invoke(sender, new TrackTimeChangeEventArgs(TimeSpan.FromSeconds(e.TrackTime)));
 }
 private void _spotify_OnTrackTimeChange(object sender, TrackTimeChangeEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new Action(() => _spotify_OnTrackTimeChange(sender, e)));
         return;
     }
     timeLabel.Text = $@"{FormatTime(e.TrackTime)}/{FormatTime(_currentTrack.Length)}";
     if(e.TrackTime < _currentTrack.Length)
         timeProgressBar.Value = (int)e.TrackTime;
 }
Example #6
0
 private void UpdateSpotifyTrackTime(object sender, TrackTimeChangeEventArgs e)
 {
     var dataModel = (WindowsProfileDataModel) DataModel;
     if (dataModel.Spotify.SongLength > 0)
         dataModel.Spotify.SongPercentCompleted = (int) (e.TrackTime/dataModel.Spotify.SongLength*100.0);
 }