Add unused disc changing methods to Player

This commit is contained in:
Matt Nadareski
2021-10-04 22:46:46 -07:00
parent 34b7fbd790
commit 765d2f21c1
2 changed files with 50 additions and 1 deletions

View File

@@ -386,6 +386,56 @@ namespace RedBookPlayer.Models.Hardware
Initialized = false;
}
/// <summary>
/// Move to the next loaded disc
/// </summary>
public void NextDisc()
{
PlayerState wasPlaying = PlayerState;
if (wasPlaying == PlayerState.Playing)
Stop();
int lastdisc = CurrentDisc++;
while (CurrentDisc != lastdisc)
{
if (_opticalDiscs[CurrentDisc] != null && _opticalDiscs[CurrentDisc].Initialized)
break;
CurrentDisc++;
}
OpticalDiscStateChanged(this, null);
SoundOutputStateChanged(this, null);
if(wasPlaying == PlayerState.Playing)
Play();
}
/// <summary>
/// Move to the previous loaded disc
/// </summary>
public void PreviousDisc()
{
PlayerState wasPlaying = PlayerState;
if (wasPlaying == PlayerState.Playing)
Stop();
int lastdisc = CurrentDisc--;
while (CurrentDisc != lastdisc)
{
if (_opticalDiscs[CurrentDisc] != null && _opticalDiscs[CurrentDisc].Initialized)
break;
CurrentDisc--;
}
OpticalDiscStateChanged(this, null);
SoundOutputStateChanged(this, null);
if(wasPlaying == PlayerState.Playing)
Play();
}
/// <summary>
/// Move to the next playable track
/// </summary>

View File

@@ -1,5 +1,4 @@
using CSCore.SoundOut;
using PortAudioSharp;
namespace RedBookPlayer.Models.Hardware.Windows
{