private void load(OsuConfigManager config) { config.BindWith(OsuSetting.PositionalHitSounds, userPositionalHitSounds); // Explicit non-virtual function call. base.AddInternal(Samples = new PausableSkinnableSound()); }
private void load() { Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; AddRangeInternal(new Drawable[] { spmCalculator = new SpinnerSpmCalculator { Result = { BindTarget = SpinsPerMinute }, }, ticks = new Container <DrawableSpinnerTick>(), new AspectContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Children = new Drawable[] { Body = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinner()), RotationTracker = new SpinnerRotationTracker(this) } }, spinningSample = new PausableSkinnableSound { Volume = { Value = 0 }, Looping = true, Frequency = { Value = spinning_sample_initial_frequency } } }); PositionBindable.BindValueChanged(pos => Position = pos.NewValue); }
/// <param name="firstHitTime">Start time of the first hit object, used for providing a count down.</param> public Metronome(double firstHitTime) { this.firstHitTime = firstHitTime; AllowMistimedEventFiring = false; Divisor = 1; InternalChild = sample = new PausableSkinnableSound(new SampleInfo("Gameplay/catch-banana")); }
private void load(OsuConfigManager config, ISkinSource skinSource) { config.BindWith(OsuSetting.PositionalHitSounds, userPositionalHitSounds); // Explicit non-virtual function call. base.AddInternal(Samples = new PausableSkinnableSound()); CurrentSkin = skinSource; CurrentSkin.SourceChanged += skinSourceChanged; }
private PausableSkinnableSound addSound(HitSampleInfo hitSampleInfo, double lifetimeStart, double lifetimeEnd) { var drawable = new PausableSkinnableSound(hitSampleInfo) { LifetimeStart = lifetimeStart, LifetimeEnd = lifetimeEnd }; AddInternal(drawable); return(drawable); }
public void SetUpSteps() { AddStep("setup hierarchy", () => { Child = skinSource = new TestSkinSourceContainer { RelativeSizeAxes = Axes.Both, }; // has to be added after the hierarchy above else the `ISkinSource` dependency won't be cached. skinSource.Add(skinnableSound = new PausableSkinnableSound(new SampleInfo("Gameplay/normal-sliderslide"))); }); }
public void SetUpSteps() { AddStep("setup hierarchy", () => { Children = new Drawable[] { skinSource = new TestSkinSourceContainer { RelativeSizeAxes = Axes.Both, Child = skinnableSound = new PausableSkinnableSound(new SampleInfo("Gameplay/normal-sliderslide")) }, }; }); }
public void SetUp() => Schedule(() => { gameplayClock.IsPaused.Value = false; Children = new Drawable[] { skinSource = new TestSkinSourceContainer { Clock = gameplayClock, RelativeSizeAxes = Axes.Both, Child = skinnableSound = new PausableSkinnableSound(new SampleInfo("normal-sliderslide")) }, }; });
private void load(OsuColour colours) { Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { ticks = new Container <DrawableSpinnerTick>(), new AspectContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Children = new Drawable[] { new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinnerDisc()), RotationTracker = new SpinnerRotationTracker(this) } }, SpmCounter = new SpinnerSpmCounter { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = 120, Alpha = 0 }, bonusDisplay = new SpinnerBonusDisplay { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = -120, }, spinningSample = new PausableSkinnableSound { Volume = { Value = 0 }, Looping = true, Frequency = { Value = spinning_sample_initial_frequency } } }; PositionBindable.BindValueChanged(pos => Position = pos.NewValue); }
/// <summary> /// Invoked by the base <see cref="DrawableHitObject"/> to populate samples, once on initial load and potentially again on any change to the samples collection. /// </summary> protected virtual void LoadSamples() { samplesContainer.Clear(); Samples = null; var samples = GetSamples().ToArray(); if (samples.Length <= 0) { return; } if (HitObject.SampleControlPoint == null) { throw new InvalidOperationException($"{nameof(HitObject)}s must always have an attached {nameof(HitObject.SampleControlPoint)}." + $" This is an indication that {nameof(HitObject.ApplyDefaults)} has not been invoked on {this}."); } samplesContainer.Add(Samples = new PausableSkinnableSound(samples.Select(s => HitObject.SampleControlPoint.ApplyTo(s)))); }
protected override void LoadSamples() { base.LoadSamples(); slidingSample?.Expire(); slidingSample = null; var firstSample = HitObject.Samples.FirstOrDefault(); if (firstSample != null) { var clone = HitObject.SampleControlPoint.ApplyTo(firstSample); clone.Name = "sliderslide"; AddInternal(slidingSample = new PausableSkinnableSound(clone) { Looping = true }); } }
protected override void LoadSamples() { base.LoadSamples(); spinningSample?.Expire(); spinningSample = null; var firstSample = HitObject.Samples.FirstOrDefault(); if (firstSample != null) { var clone = HitObject.SampleControlPoint.ApplyTo(firstSample); clone.Name = "spinnerspin"; AddInternal(spinningSample = new PausableSkinnableSound(clone) { Volume = { Value = 0 }, Looping = true, Frequency = { Value = spinning_sample_initial_frequency } }); } }
public DrawableSlider(TauHitObject obj) : base(obj) { Size = new Vector2(768); Anchor = Anchor.Centre; Origin = Anchor.Centre; AddRangeInternal(new Drawable[] { maskingContainer = new CircularContainer { Masking = true, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, AlwaysPresent = true }, path = new SmoothPath { Anchor = Anchor.Centre, Origin = Anchor.Centre, PathRadius = 5, AutoSizeAxes = Axes.None, Size = TauPlayfield.BASE_SIZE }, headContainer = new Container <DrawableSliderHead> { RelativeSizeAxes = Axes.Both }, slidingSample = new PausableSkinnableSound { Looping = true } } }, }); }