diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs index 5b690be780..9ceea14802 100644 --- a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs +++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs @@ -10,13 +10,13 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon { public partial class ArgonDrumSamplePlayer : DrumSamplePlayer { - protected override DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer) => - new ArgonDrumSampleTriggerSource(hitObjectContainer); + protected override DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance) => + new ArgonDrumSampleTriggerSource(hitObjectContainer, balance); public partial class ArgonDrumSampleTriggerSource : DrumSampleTriggerSource { - public ArgonDrumSampleTriggerSource(HitObjectContainer hitObjectContainer) - : base(hitObjectContainer) + public ArgonDrumSampleTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance) + : base(hitObjectContainer, balance) { } diff --git a/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs b/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs index b60ad209ff..410072994f 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs @@ -25,14 +25,14 @@ namespace osu.Game.Rulesets.Taiko.UI InternalChildren = new Drawable[] { - leftRimSampleTriggerSource = CreateTriggerSource(hitObjectContainer), - leftCentreSampleTriggerSource = CreateTriggerSource(hitObjectContainer), - rightCentreSampleTriggerSource = CreateTriggerSource(hitObjectContainer), - rightRimSampleTriggerSource = CreateTriggerSource(hitObjectContainer), + leftRimSampleTriggerSource = CreateTriggerSource(hitObjectContainer, SampleBalance.Left), + leftCentreSampleTriggerSource = CreateTriggerSource(hitObjectContainer, SampleBalance.Left), + rightCentreSampleTriggerSource = CreateTriggerSource(hitObjectContainer, SampleBalance.Right), + rightRimSampleTriggerSource = CreateTriggerSource(hitObjectContainer, SampleBalance.Right), }; } - protected virtual DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer) + protected virtual DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance) => new DrumSampleTriggerSource(hitObjectContainer); public bool OnPressed(KeyBindingPressEvent e) diff --git a/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs b/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs index 939eba684b..50ff20f473 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs @@ -2,17 +2,35 @@ // See the LICENCE file in the repository root for full licence text. using System; +using osu.Framework.Utils; using osu.Game.Audio; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.UI; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Taiko.UI { public partial class DrumSampleTriggerSource : GameplaySampleTriggerSource { - public DrumSampleTriggerSource(HitObjectContainer hitObjectContainer) + private const double stereo_separation = 0.2; + + public DrumSampleTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance = SampleBalance.Centre) : base(hitObjectContainer) { + switch (balance) + { + case SampleBalance.Left: + AudioContainer.Balance.Value = -stereo_separation; + break; + + case SampleBalance.Centre: + AudioContainer.Balance.Value = 0; + break; + + case SampleBalance.Right: + AudioContainer.Balance.Value = stereo_separation; + break; + } } public virtual void Play(HitType hitType) @@ -39,5 +57,19 @@ namespace osu.Game.Rulesets.Taiko.UI } public override void Play() => throw new InvalidOperationException(@"Use override with HitType parameter instead"); + + protected override void ApplySampleInfo(SkinnableSound hitSound, ISampleInfo[] samples) + { + base.ApplySampleInfo(hitSound, samples); + + hitSound.Balance.Value = -0.05 + RNG.NextDouble(0.1); + } + } + + public enum SampleBalance + { + Left, + Centre, + Right } } diff --git a/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs b/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs index efbf823058..58410ea14b 100644 --- a/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs +++ b/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs @@ -142,7 +142,7 @@ namespace osu.Game.Rulesets.UI } } - private SkinnableSound getNextSample() + protected SkinnableSound GetNextSample() { SkinnableSound hitSound = hitSounds[nextHitSoundIndex];