mirror of
https://github.com/osukey/osukey.git
synced 2025-05-15 18:47:33 +09:00
Add methods to MusicController to play or pause, select next or previous track
This commit is contained in:
parent
70372dd03d
commit
b5bd863dd0
@ -529,6 +529,35 @@ namespace osu.Game.Overlays
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Play the next random or playlist track.
|
/// Play the next random or playlist track.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void NextTrack() => next();
|
/// <returns>Returns whether the track could be changed or not</returns>
|
||||||
|
public bool NextTrack()
|
||||||
|
{
|
||||||
|
if (beatmap.Disabled) return false;
|
||||||
|
|
||||||
|
next();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Play the previous random or playlist track.
|
||||||
|
/// </summary>
|
||||||
|
public bool PreviousTrack()
|
||||||
|
{
|
||||||
|
if (beatmap.Disabled) return false;
|
||||||
|
|
||||||
|
prev();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Play or pause the current beatmap track.
|
||||||
|
/// <returns>Returns whether the current track could be played / paused or not</returns>
|
||||||
|
public bool PlayTrack()
|
||||||
|
{
|
||||||
|
if (beatmap.Disabled) return false;
|
||||||
|
|
||||||
|
play();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user