public TestSceneSamples() { Children = new Drawable[] { new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Size = new Vector2(0.95f), FillMode = FillMode.Fit, Children = new Drawable[] { new Box { Colour = Color4.Blue, RelativeSizeAxes = Axes.Both, }, new Grid(beats - 1, notes), samples = new AudioContainer { RelativeSizeAxes = Axes.Both, RelativeChildSize = new Vector2(beats - 1, notes), Children = new Drawable[] { new DraggableSample(0, 0), new DraggableSample(1, 2), new DraggableSample(2, 4), new DraggableSample(3, 5), new DraggableSample(4, 8), new DraggableSample(5, 11), new DraggableSample(6, 14), new DraggableSample(7, 16), tracking = new TrackingLine() } }, } }, }; AddStep("reduce volume", () => samples.VolumeTo(samples.Volume.Value - 0.5f, 1000, Easing.OutQuint)); AddStep("increase volume", () => samples.VolumeTo(samples.Volume.Value + 0.5f, 1000, Easing.OutQuint)); AddStep("reduce frequency", () => samples.FrequencyTo(samples.Frequency.Value - 0.1f, 1000, Easing.OutQuint)); AddStep("increase frequency", () => samples.FrequencyTo(samples.Frequency.Value + 0.1f, 1000, Easing.OutQuint)); AddStep("left balance", () => samples.BalanceTo(samples.Balance.Value - 1, 1000, Easing.OutQuint)); AddStep("right balance", () => samples.BalanceTo(samples.Balance.Value + 1, 1000, Easing.OutQuint)); }
/// <summary> /// Smoothly adjusts <see cref="Balance"/> over time. /// </summary> /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns> public TransformSequence <DrawableAudioWrapper> BalanceTo(double newBalance, double duration = 0, Easing easing = Easing.None) => samplesContainer.BalanceTo(newBalance, duration, easing);