1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Warm up pool with argon-specific drum samples

This commit is contained in:
Dean Herbert 2023-07-03 14:05:40 +09:00
parent f086908831
commit 759cd5aec7
2 changed files with 11 additions and 5 deletions

View File

@ -14,6 +14,15 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{ {
internal partial class ArgonDrumSamplePlayer : DrumSamplePlayer internal partial class ArgonDrumSamplePlayer : DrumSamplePlayer
{ {
[BackgroundDependencyLoader]
private void load(IPooledSampleProvider sampleProvider)
{
// Warm up pools for non-standard samples.
sampleProvider.GetPooledSample(new ArgonDrumSampleTriggerSource.VolumeAwareHitSampleInfo(new HitSampleInfo(HitSampleInfo.HIT_NORMAL), true));
sampleProvider.GetPooledSample(new ArgonDrumSampleTriggerSource.VolumeAwareHitSampleInfo(new HitSampleInfo(HitSampleInfo.HIT_CLAP), true));
sampleProvider.GetPooledSample(new ArgonDrumSampleTriggerSource.VolumeAwareHitSampleInfo(new HitSampleInfo(HitSampleInfo.HIT_FLOURISH), true));
}
protected override DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance) => protected override DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer, SampleBalance balance) =>
new ArgonDrumSampleTriggerSource(hitObjectContainer, balance); new ArgonDrumSampleTriggerSource(hitObjectContainer, balance);
@ -33,7 +42,6 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
: base(hitObjectContainer, balance) : base(hitObjectContainer, balance)
{ {
this.hitObjectContainer = hitObjectContainer; this.hitObjectContainer = hitObjectContainer;
// TODO: pool flourish sample
} }
public override void Play(HitType hitType, bool strong) public override void Play(HitType hitType, bool strong)
@ -65,8 +73,6 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{ {
double? lastFlourish = null; double? lastFlourish = null;
// TODO: check on nested strong hits. we're not accounting for them here yet.
var hitObjects = hitObjectContainer.AliveObjects var hitObjects = hitObjectContainer.AliveObjects
.Reverse() .Reverse()
.Select(d => d.HitObject) .Select(d => d.HitObject)
@ -90,7 +96,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
return false; return false;
} }
private class VolumeAwareHitSampleInfo : HitSampleInfo public class VolumeAwareHitSampleInfo : HitSampleInfo
{ {
public const int SAMPLE_VOLUME_THRESHOLD_HARD = 90; public const int SAMPLE_VOLUME_THRESHOLD_HARD = 90;
public const int SAMPLE_VOLUME_THRESHOLD_MEDIUM = 60; public const int SAMPLE_VOLUME_THRESHOLD_MEDIUM = 60;

View File

@ -8,7 +8,7 @@ namespace osu.Game.Skinning
/// <summary> /// <summary>
/// Provides pooled samples to be used by <see cref="SkinnableSound"/>s. /// Provides pooled samples to be used by <see cref="SkinnableSound"/>s.
/// </summary> /// </summary>
internal interface IPooledSampleProvider public interface IPooledSampleProvider
{ {
/// <summary> /// <summary>
/// Retrieves a <see cref="PoolableSkinnableSample"/> from a pool. /// Retrieves a <see cref="PoolableSkinnableSample"/> from a pool.