mirror of
https://github.com/ppy/osu
synced 2025-03-11 05:49:12 +00:00
Merge branch 'move-sample-pause-logic' into fix-editor-samples-not-pausing-screen-swap
This commit is contained in:
commit
d148bafedc
@ -21,11 +21,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
DrawableSlider slider = null;
|
DrawableSlider slider = null;
|
||||||
DrawableSample[] samples = null;
|
DrawableSample[] samples = null;
|
||||||
ISamplePlaybackDisabler gameplayClock = null;
|
ISamplePlaybackDisabler sampleDisabler = null;
|
||||||
|
|
||||||
AddStep("get variables", () =>
|
AddStep("get variables", () =>
|
||||||
{
|
{
|
||||||
gameplayClock = Player as ISamplePlaybackDisabler;
|
sampleDisabler = Player;
|
||||||
slider = Player.ChildrenOfType<DrawableSlider>().OrderBy(s => s.HitObject.StartTime).First();
|
slider = Player.ChildrenOfType<DrawableSlider>().OrderBy(s => s.HitObject.StartTime).First();
|
||||||
samples = slider.ChildrenOfType<DrawableSample>().ToArray();
|
samples = slider.ChildrenOfType<DrawableSample>().ToArray();
|
||||||
});
|
});
|
||||||
@ -42,16 +42,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("sample playback disabled", () => gameplayClock.SamplePlaybackDisabled.Value);
|
AddAssert("sample playback disabled", () => sampleDisabler.SamplePlaybackDisabled.Value);
|
||||||
|
|
||||||
// because we are in frame stable context, it's quite likely that not all samples are "played" at this point.
|
// because we are in frame stable context, it's quite likely that not all samples are "played" at this point.
|
||||||
// the important thing is that at least one started, and that sample has since stopped.
|
// the important thing is that at least one started, and that sample has since stopped.
|
||||||
AddAssert("all looping samples stopped immediately", () => allStopped(allLoopingSounds));
|
AddAssert("all looping samples stopped immediately", () => allStopped(allLoopingSounds));
|
||||||
AddUntilStep("all samples stopped eventually", () => allStopped(allSounds));
|
AddUntilStep("all samples stopped eventually", () => allStopped(allSounds));
|
||||||
|
|
||||||
AddAssert("sample playback still disabled", () => gameplayClock.SamplePlaybackDisabled.Value);
|
AddAssert("sample playback still disabled", () => sampleDisabler.SamplePlaybackDisabled.Value);
|
||||||
|
|
||||||
AddUntilStep("seek finished, sample playback enabled", () => !gameplayClock.SamplePlaybackDisabled.Value);
|
AddUntilStep("seek finished, sample playback enabled", () => !sampleDisabler.SamplePlaybackDisabled.Value);
|
||||||
AddUntilStep("any sample is playing", () => Player.ChildrenOfType<PausableSkinnableSound>().Any(s => s.IsPlaying));
|
AddUntilStep("any sample is playing", () => Player.ChildrenOfType<PausableSkinnableSound>().Any(s => s.IsPlaying));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user