1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 15:37:44 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.9 KiB
C#
Raw Normal View History

2023-06-30 15:03:11 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
2023-06-30 15:03:11 +08:00
using osu.Game.Audio;
using osu.Game.Rulesets.Taiko.Objects;
2023-06-30 15:03:11 +08:00
using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Rulesets.UI;
using osu.Game.Skinning;
2023-06-30 15:03:11 +08:00
namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
internal partial class ArgonDrumSamplePlayer : DrumSamplePlayer
2023-06-30 15:03:11 +08:00
{
private ArgonFlourishTriggerSource argonFlourishTrigger = null!;
[BackgroundDependencyLoader]
private void load(Playfield playfield, IPooledSampleProvider sampleProvider)
{
var hitObjectContainer = playfield.HitObjectContainer;
// Warm up pools for non-standard samples.
sampleProvider.GetPooledSample(new VolumeAwareHitSampleInfo(new HitSampleInfo(HitSampleInfo.HIT_NORMAL), true));
sampleProvider.GetPooledSample(new VolumeAwareHitSampleInfo(new HitSampleInfo(HitSampleInfo.HIT_CLAP), true));
sampleProvider.GetPooledSample(new VolumeAwareHitSampleInfo(new HitSampleInfo(HitSampleInfo.HIT_FLOURISH), true));
// We want to play back flourishes in an isolated source as to not have them cancelled.
AddInternal(argonFlourishTrigger = new ArgonFlourishTriggerSource(hitObjectContainer));
}
protected override DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance) =>
new ArgonDrumSampleTriggerSource(hitObjectContainer, balance);
protected override void Play(DrumSampleTriggerSource triggerSource, HitType hitType, bool strong)
{
base.Play(triggerSource, hitType, strong);
// This won't always play something, but the logic for flourish playback is contained within.
argonFlourishTrigger.Play(hitType, strong);
}
2023-06-30 15:03:11 +08:00
}
}