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

Expose AudioFilter.IsAttached publicly

This commit is contained in:
Dean Herbert 2024-02-26 21:15:44 +08:00
parent 09b420a083
commit 7a96cf1289
No known key found for this signature in database

View File

@ -17,12 +17,15 @@ namespace osu.Game.Audio.Effects
/// </summary>
public const int MAX_LOWPASS_CUTOFF = 22049; // nyquist - 1hz
/// <summary>
/// Whether this filter is currently attached to the audio track and thus applying an adjustment.
/// </summary>
public bool IsAttached { get; private set; }
private readonly AudioMixer mixer;
private readonly BQFParameters filter;
private readonly BQFType type;
private bool isAttached;
private readonly Cached filterApplication = new Cached();
private int cutoff;
@ -132,22 +135,22 @@ namespace osu.Game.Audio.Effects
private void ensureAttached()
{
if (isAttached)
if (IsAttached)
return;
Debug.Assert(!mixer.Effects.Contains(filter));
mixer.Effects.Add(filter);
isAttached = true;
IsAttached = true;
}
private void ensureDetached()
{
if (!isAttached)
if (!IsAttached)
return;
Debug.Assert(mixer.Effects.Contains(filter));
mixer.Effects.Remove(filter);
isAttached = false;
IsAttached = false;
}
protected override void Dispose(bool isDisposing)