diff --git a/osu.Framework/Audio/AudioCollectionManager.cs b/osu.Framework/Audio/AudioCollectionManager.cs index a38d7c62ba..eba3ba0629 100644 --- a/osu.Framework/Audio/AudioCollectionManager.cs +++ b/osu.Framework/Audio/AudioCollectionManager.cs @@ -60,7 +60,7 @@ protected override void UpdateState() { var item = Items[i]; - if (item.HasCompleted) + if (!item.IsAlive) { Items.RemoveAt(i--); continue; diff --git a/osu.Framework/Audio/AudioComponent.cs b/osu.Framework/Audio/AudioComponent.cs index ca8c385113..e47c660491 100644 --- a/osu.Framework/Audio/AudioComponent.cs +++ b/osu.Framework/Audio/AudioComponent.cs @@ -48,9 +48,14 @@ public void Update() } /// - /// The component has completed its task and is potentially no longer needed. + /// This component has completed playback and is now in a stopped state. /// - public virtual bool HasCompleted => IsDisposed; + public virtual bool HasCompleted => !IsAlive; + + /// + /// This component has completed all processing and is ready to be removed from its parent. + /// + public virtual bool IsAlive => !IsDisposed; public virtual bool IsLoaded => true; diff --git a/osu.Framework/Audio/Sample/SampleChannel.cs b/osu.Framework/Audio/Sample/SampleChannel.cs index 4feb7779b0..4024c484f5 100644 --- a/osu.Framework/Audio/Sample/SampleChannel.cs +++ b/osu.Framework/Audio/Sample/SampleChannel.cs @@ -53,6 +53,6 @@ protected override void UpdateState() public virtual bool Played => WasStarted && !Playing; - public override bool HasCompleted => base.HasCompleted || Played; + public override bool IsAlive => base.IsAlive && !Played; } }