Skip to content

Commit

Permalink
Remove ISample.Length
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
peppy committed Oct 25, 2024
1 parent 451f8b2 commit 282c1da
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 0 additions & 5 deletions osu.Framework/Audio/Sample/ISample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public interface ISample : IAdjustableAudioComponent
/// </summary>
string Name { get; }

/// <summary>
/// The length in milliseconds of this <see cref="ISample"/>.
/// </summary>
double Length { get; }

/// <summary>
/// The number of times this sample (as identified by name) can be played back concurrently.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion osu.Framework/Audio/Sample/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ protected Sample(string name)
Name = name;
}

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

internal Action<Sample> OnPlay;
Expand Down
7 changes: 7 additions & 0 deletions osu.Framework/Audio/Sample/SampleChannelBass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,15 @@ private void ensureChannel() => EnqueueAction(() =>
if (!hasChannel)
return;

Logging.Logger.Log($"SampleChannelBass got created {++createCount} times so far");

setLoopFlag(Looping);

relativeFrequencyHandler.SetChannel(channel);
});

private static int createCount = 0;

Check failure on line 222 in osu.Framework/Audio/Sample/SampleChannelBass.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Initializing field by default value is redundant in osu.Framework\Audio\Sample\SampleChannelBass.cs on line 222

#region Mixing

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

#endregion

private static int disposeCount = 0;

Check failure on line 238 in osu.Framework/Audio/Sample/SampleChannelBass.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Initializing field by default value is redundant in osu.Framework\Audio\Sample\SampleChannelBass.cs on line 238

protected override void Dispose(bool disposing)
{
if (IsDisposed)
return;

if (hasChannel)
{
Logging.Logger.Log($"SampleChannelBass got disposed {++disposeCount} times so far");
bassMixer.StreamFree(this);
channel = 0;
}
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework/Graphics/Audio/DrawableSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public SampleChannel GetChannel()

string ISample.Name => sample.Name;

public double Length => sample.Length;

public Bindable<int> PlaybackConcurrency { get; } = new Bindable<int>(Sample.DEFAULT_CONCURRENCY);

private IAudioMixer? mixer;
Expand Down

0 comments on commit 282c1da

Please sign in to comment.