mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Merge pull request #1658 from peppy/add-wait-for-restart
Wait until track has restarted before continuing operation
This commit is contained in:
commit
abf5f3b390
@ -13,6 +13,7 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Music
|
namespace osu.Game.Overlays.Music
|
||||||
{
|
{
|
||||||
@ -148,7 +149,15 @@ namespace osu.Game.Overlays.Music
|
|||||||
private void playSpecified(BeatmapInfo info)
|
private void playSpecified(BeatmapInfo info)
|
||||||
{
|
{
|
||||||
beatmapBacking.Value = beatmaps.GetWorkingBeatmap(info, beatmapBacking);
|
beatmapBacking.Value = beatmaps.GetWorkingBeatmap(info, beatmapBacking);
|
||||||
beatmapBacking.Value.Track.Restart();
|
|
||||||
|
var track = beatmapBacking.Value.Track;
|
||||||
|
|
||||||
|
track.Restart();
|
||||||
|
|
||||||
|
// this is temporary until we have blocking (async.Wait()) audio component methods.
|
||||||
|
// then we can call RestartAsync().Wait() or the blocking version above.
|
||||||
|
while (!track.IsRunning)
|
||||||
|
Thread.Sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user