Skip to content

Commit 282c1da

Browse files
committed
Remove ISample.Length
This has not been populated for a while and is not used osu! side. Rather than having an incorrectly zero value, let's remove it for now.
1 parent 451f8b2 commit 282c1da

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

osu.Framework/Audio/Sample/ISample.cs

-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ public interface ISample : IAdjustableAudioComponent
1515
/// </summary>
1616
string Name { get; }
1717

18-
/// <summary>
19-
/// The length in milliseconds of this <see cref="ISample"/>.
20-
/// </summary>
21-
double Length { get; }
22-
2318
/// <summary>
2419
/// The number of times this sample (as identified by name) can be played back concurrently.
2520
/// </summary>

osu.Framework/Audio/Sample/Sample.cs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ protected Sample(string name)
1919
Name = name;
2020
}
2121

22-
public double Length { get; protected set; }
2322
public Bindable<int> PlaybackConcurrency { get; } = new Bindable<int>(DEFAULT_CONCURRENCY);
2423

2524
internal Action<Sample> OnPlay;

osu.Framework/Audio/Sample/SampleChannelBass.cs

+7
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,15 @@ private void ensureChannel() => EnqueueAction(() =>
212212
if (!hasChannel)
213213
return;
214214

215+
Logging.Logger.Log($"SampleChannelBass got created {++createCount} times so far");
216+
215217
setLoopFlag(Looping);
216218

217219
relativeFrequencyHandler.SetChannel(channel);
218220
});
219221

222+
private static int createCount = 0;
223+
220224
#region Mixing
221225

222226
private BassAudioMixer bassMixer => (BassAudioMixer)Mixer.AsNonNull();
@@ -231,13 +235,16 @@ private void ensureChannel() => EnqueueAction(() =>
231235

232236
#endregion
233237

238+
private static int disposeCount = 0;
239+
234240
protected override void Dispose(bool disposing)
235241
{
236242
if (IsDisposed)
237243
return;
238244

239245
if (hasChannel)
240246
{
247+
Logging.Logger.Log($"SampleChannelBass got disposed {++disposeCount} times so far");
241248
bassMixer.StreamFree(this);
242249
channel = 0;
243250
}

osu.Framework/Graphics/Audio/DrawableSample.cs

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public SampleChannel GetChannel()
5151

5252
string ISample.Name => sample.Name;
5353

54-
public double Length => sample.Length;
55-
5654
public Bindable<int> PlaybackConcurrency { get; } = new Bindable<int>(Sample.DEFAULT_CONCURRENCY);
5755

5856
private IAudioMixer? mixer;

0 commit comments

Comments
 (0)