diff --git a/RedBookPlayer/Player.cs b/RedBookPlayer/Player.cs index ff67ac6..db0c40c 100644 --- a/RedBookPlayer/Player.cs +++ b/RedBookPlayer/Player.cs @@ -39,6 +39,13 @@ namespace RedBookPlayer if(Image == null) return; + // If the value is the same, don't do anything + if(value == _currentTrack) + return; + + // Check if we're incrementing or decrementing the track + bool increment = value > _currentTrack; + // Ensure that the value is valid, wrapping around if necessary if(value >= Image.Tracks.Count) _currentTrack = 0; @@ -76,7 +83,12 @@ namespace RedBookPlayer // If we're not playing data tracks, skip if(!App.Settings.PlayDataTracks && TrackType == TrackTypeValue.Data) - NextTrack(); + { + if(increment) + NextTrack(); + else + PreviousTrack(); + } } } @@ -92,6 +104,10 @@ namespace RedBookPlayer if(Image == null) return; + // If the value is the same, don't do anything + if(value == _currentIndex) + return; + // Cache the current track for easy access Track track = Image.Tracks[CurrentTrack]; @@ -121,6 +137,10 @@ namespace RedBookPlayer if(Image == null) return; + // If the value is the same, don't do anything + if(value == _currentSector) + return; + // Cache the current track for easy access Track track = Image.Tracks[CurrentTrack];