Skip to content

Commit

Permalink
Satisfy InspectCode
Browse files Browse the repository at this point in the history
  • Loading branch information
hwsmm committed Aug 8, 2024
1 parent fbcbd5f commit 509b075
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Audio/BassTestComponents.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.IO;
using ManagedBass;
using osu.Framework.Audio.Mixing;
Expand All @@ -16,7 +15,7 @@ namespace osu.Framework.Tests.Audio
/// <summary>
/// Provides a BASS audio pipeline to be used for testing audio components.
/// </summary>
public class BassTestComponents : AudioTestComponents, IDisposable
public class BassTestComponents : AudioTestComponents
{
public BassTestComponents(bool init = true)
: base(init)
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework.Tests/Audio/SDL3AudioTestComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace osu.Framework.Tests.Audio
/// <summary>
/// Provides a SDL3 audio pipeline to be used for testing audio components.
/// </summary>
public class SDL3AudioTestComponents : AudioTestComponents, IDisposable
public class SDL3AudioTestComponents : AudioTestComponents
{
private SDL3BaseAudioManager baseManager = null!;

Expand Down
2 changes: 1 addition & 1 deletion osu.Framework.Tests/Audio/SampleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void TestPlayingUpdatedAfterInlineStop(AudioTestComponents.Type id)
{
setupBackend(id);

var channel = sample.Play();
channel = sample.Play();
audio.Update();

audio.RunOnAudioThread(() => channel.Stop());
Expand Down
4 changes: 2 additions & 2 deletions osu.Framework/Audio/SDL3AudioDecoderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ internal static SDL3AudioDecoder CreateDecoder(Stream stream, SDL_AudioSpec audi
return decoder;
}

private bool bassInit;
private readonly bool bassInit;

/// <summary>
/// Starts a decoder thread.
Expand Down Expand Up @@ -267,7 +267,7 @@ public int Bitrate
private double length;

/// <summary>
/// Audio length in miliseconds. Decoder may fill this in after the first call of <see cref="LoadFromStream(out byte[])"/>.
/// Audio length in milliseconds. Decoder may fill this in after the first call of <see cref="LoadFromStream(out byte[])"/>.
/// </summary>
public double Length
{
Expand Down
4 changes: 2 additions & 2 deletions osu.Framework/Audio/SDL3AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ internal void OnNewDeviceEvent(SDL_AudioDeviceID addedDeviceIndex)
{
AudioScheduler.Add(() =>
{
// the index is only vaild until next SDL_GetNumAudioDevices call, so get the name first.
// the index is only valid until next SDL_GetNumAudioDevices call, so get the name first.
string name = SDL_GetAudioDeviceName(addedDeviceIndex);
syncAudioDevices();
Expand Down Expand Up @@ -189,7 +189,6 @@ protected override void Dispose(bool disposing)
}
}


/// <summary>
/// To share basic playback logic with audio tests.
/// </summary>
Expand Down Expand Up @@ -251,6 +250,7 @@ internal bool SetAudioDevice(SDL_AudioDeviceID targetId)
SDL_AudioSpec spec = AudioSpec;

SDL_AudioStream* deviceStream = SDL_OpenAudioDeviceStream(targetId, &spec, &audioCallback, objectHandle.Handle);

if (deviceStream != null)
{
SDL_DestroyAudioStream(DeviceStream);
Expand Down
1 change: 0 additions & 1 deletion osu.Framework/Audio/Sample/SampleSDL3Factory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.IO;
using System.Threading;
using osu.Framework.Audio.Mixing.SDL3;
using osu.Framework.Bindables;
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework/Audio/Track/TrackSDL3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using NAudio.Dsp;
Expand Down Expand Up @@ -174,7 +173,7 @@ protected override void UpdateState()
player.FillRequiredSamples();
}

// Not sure if I need to split this up to another class since this featrue is only exclusive to Track
// Not sure if I need to split this up to another class since this feature is only exclusive to Track
if (amplitudeRequested && isRunning && Math.Abs(currentTime - lastTime) > 1000.0 / 60.0)
{
lastTime = currentTime;
Expand Down

0 comments on commit 509b075

Please sign in to comment.