mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 18:32:56 +08:00
Apply simple PR reviews
This commit is contained in:
parent
4bbeb9ebd4
commit
afb8eb636d
@ -6,8 +6,16 @@ using osu.Game.Audio;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public interface IPooledSampleProvider
|
||||
/// <summary>
|
||||
/// Provides pooled samples to be used by <see cref="SkinnableSound"/>s.
|
||||
/// </summary>
|
||||
internal interface IPooledSampleProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves a <see cref="PoolableSkinnableSample"/> from a pool.
|
||||
/// </summary>
|
||||
/// <param name="sampleInfo">The <see cref="SampleInfo"/> describing the sample to retrieve..</param>
|
||||
/// <returns>The <see cref="PoolableSkinnableSample"/>.</returns>
|
||||
[CanBeNull]
|
||||
PoolableSkinnableSample GetPooledSample(ISampleInfo sampleInfo);
|
||||
}
|
||||
|
@ -138,6 +138,8 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
#region Re-expose AudioContainer
|
||||
|
||||
public BindableNumber<double> Volume => sampleContainer.Volume;
|
||||
|
||||
public BindableNumber<double> Balance => sampleContainer.Balance;
|
||||
@ -159,5 +161,7 @@ namespace osu.Game.Skinning
|
||||
public IBindable<double> AggregateFrequency => sampleContainer.AggregateFrequency;
|
||||
|
||||
public IBindable<double> AggregateTempo => sampleContainer.AggregateTempo;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Skinning
|
||||
private ISampleStore sampleStore { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private IPooledSampleProvider pooledProvider { get; set; }
|
||||
private IPooledSampleProvider samplePool { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="SkinnableSound"/>.
|
||||
@ -145,7 +145,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
foreach (var s in samples)
|
||||
{
|
||||
var sample = pooledProvider?.GetPooledSample(s) ?? new PoolableSkinnableSample(s);
|
||||
var sample = samplePool?.GetPooledSample(s) ?? new PoolableSkinnableSample(s);
|
||||
sample.Looping = Looping;
|
||||
sample.Volume.Value = s.Volume / 100.0;
|
||||
|
||||
@ -176,7 +176,7 @@ namespace osu.Game.Skinning
|
||||
=> SamplesContainer.RemoveAllAdjustments(type);
|
||||
|
||||
/// <summary>
|
||||
/// Whether any samples currently playing.
|
||||
/// Whether any samples are currently playing.
|
||||
/// </summary>
|
||||
public bool IsPlaying => SamplesContainer.Any(s => s.Playing);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user