public void TestStoryboardSamplesPlaybackWithTimeRampMods(Type expectedMod, double initialRate, double finalRate)
        {
            AddStep("setup mod", () =>
            {
                ModTimeRamp testedMod       = (ModTimeRamp)Activator.CreateInstance(expectedMod).AsNonNull();
                testedMod.InitialRate.Value = initialRate;
                testedMod.FinalRate.Value   = finalRate;
                storyboardMods = new[] { testedMod };
            });

            createPlayerTest();
            skipIntro();

            ModTimeRamp gameplayMod = null;

            AddUntilStep("mod speed change updated", () =>
            {
                gameplayMod = Player.GameplayState.Mods.OfType <ModTimeRamp>().Single();
                return(gameplayMod.SpeedChange.Value != initialRate);
            });

            AddAssert("sample playback rate matches mod rates", () => allStoryboardSamples.All(sound =>
                                                                                               sound.ChildrenOfType <DrawableSample>().First().AggregateFrequency.Value == gameplayMod.SpeedChange.Value));
        }
Beispiel #2
0
 private void seekTrackAndUpdateMod(ModTimeRamp mod, double time)
 {
     track.Seek(time);
     playfield.Clock.ProcessFrame();
     mod.Update(playfield);
 }