Пример #1
0
        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));
        }
Пример #2
0
 /// <summary>
 /// Smoothly adjusts <see cref="Frequency"/> over time.
 /// </summary>
 /// <returns>A <see cref="TransformSequence{T}"/> to which further transforms can be added.</returns>
 public TransformSequence <DrawableAudioWrapper> FrequencyTo(double newFrequency, double duration = 0, Easing easing = Easing.None) =>
 samplesContainer.FrequencyTo(newFrequency, duration, easing);