mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Don't change anything if it's the same
This commit is contained in:
@@ -761,6 +761,10 @@ namespace RedBookPlayer.Models.Hardware
|
||||
/// <param name="discNumber">Disc number to attempt to load</param>
|
||||
public void SelectDisc(int discNumber)
|
||||
{
|
||||
// If the disc didn't change, don't do anything
|
||||
if(_currentDisc == discNumber)
|
||||
return;
|
||||
|
||||
PlayerState wasPlaying = PlayerState;
|
||||
if (wasPlaying == PlayerState.Playing)
|
||||
Stop();
|
||||
@@ -802,6 +806,13 @@ namespace RedBookPlayer.Models.Hardware
|
||||
/// <param name="changeTrack">True if index changes can trigger a track change, false otherwise</param>
|
||||
public void SelectIndex(ushort index, bool changeTrack)
|
||||
{
|
||||
if(_opticalDiscs[CurrentDisc] == null || !_opticalDiscs[CurrentDisc].Initialized)
|
||||
return;
|
||||
|
||||
// If the index didn't change, don't do anything
|
||||
if(_currentTrackIndex == index)
|
||||
return;
|
||||
|
||||
PlayerState wasPlaying = PlayerState;
|
||||
if (wasPlaying == PlayerState.Playing)
|
||||
Pause();
|
||||
@@ -876,6 +887,10 @@ namespace RedBookPlayer.Models.Hardware
|
||||
if(_opticalDiscs[CurrentDisc] == null || !_opticalDiscs[CurrentDisc].Initialized)
|
||||
return false;
|
||||
|
||||
// If the disc didn't change, don't do anything
|
||||
if(_currentTrackNumber == trackNumber)
|
||||
return false;
|
||||
|
||||
PlayerState wasPlaying = PlayerState;
|
||||
if(wasPlaying == PlayerState.Playing)
|
||||
Pause();
|
||||
|
||||
Reference in New Issue
Block a user