mirror of
https://github.com/ppy/osu
synced 2025-02-03 03:42:15 +00:00
Expose AudioFilter.IsAttached
publicly
This commit is contained in:
parent
09b420a083
commit
7a96cf1289
@ -17,12 +17,15 @@ namespace osu.Game.Audio.Effects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const int MAX_LOWPASS_CUTOFF = 22049; // nyquist - 1hz
|
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 AudioMixer mixer;
|
||||||
private readonly BQFParameters filter;
|
private readonly BQFParameters filter;
|
||||||
private readonly BQFType type;
|
private readonly BQFType type;
|
||||||
|
|
||||||
private bool isAttached;
|
|
||||||
|
|
||||||
private readonly Cached filterApplication = new Cached();
|
private readonly Cached filterApplication = new Cached();
|
||||||
|
|
||||||
private int cutoff;
|
private int cutoff;
|
||||||
@ -132,22 +135,22 @@ namespace osu.Game.Audio.Effects
|
|||||||
|
|
||||||
private void ensureAttached()
|
private void ensureAttached()
|
||||||
{
|
{
|
||||||
if (isAttached)
|
if (IsAttached)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Debug.Assert(!mixer.Effects.Contains(filter));
|
Debug.Assert(!mixer.Effects.Contains(filter));
|
||||||
mixer.Effects.Add(filter);
|
mixer.Effects.Add(filter);
|
||||||
isAttached = true;
|
IsAttached = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ensureDetached()
|
private void ensureDetached()
|
||||||
{
|
{
|
||||||
if (!isAttached)
|
if (!IsAttached)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Debug.Assert(mixer.Effects.Contains(filter));
|
Debug.Assert(mixer.Effects.Contains(filter));
|
||||||
mixer.Effects.Remove(filter);
|
mixer.Effects.Remove(filter);
|
||||||
isAttached = false;
|
IsAttached = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Loading…
Reference in New Issue
Block a user