mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Add unused disc changing methods to Player
This commit is contained in:
@@ -386,6 +386,56 @@ namespace RedBookPlayer.Models.Hardware
|
|||||||
Initialized = false;
|
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>
|
/// <summary>
|
||||||
/// Move to the next playable track
|
/// Move to the next playable track
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using CSCore.SoundOut;
|
using CSCore.SoundOut;
|
||||||
using PortAudioSharp;
|
|
||||||
|
|
||||||
namespace RedBookPlayer.Models.Hardware.Windows
|
namespace RedBookPlayer.Models.Hardware.Windows
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user