Skip to content

Commit

Permalink
Fix test build errors from audio component refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hwsmm committed Sep 23, 2023
1 parent 4133ad2 commit 9d150b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion osu.Framework.Tests/Audio/AudioManagerWithDeviceLoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace osu.Framework.Tests.Audio
/// <see cref="AudioManager"/> that can simulate the loss of a device.
/// This will NOT work without a physical audio device!
/// </summary>
internal class AudioManagerWithDeviceLoss : AudioManager
internal class AudioManagerWithDeviceLoss : BassAudioManager
{
public AudioManagerWithDeviceLoss(AudioThread audioThread, ResourceStore<byte[]> trackStore, ResourceStore<byte[]> sampleStore)
: base(audioThread, trackStore, sampleStore)
Expand Down
10 changes: 8 additions & 2 deletions osu.Framework.Tests/Audio/BassTestComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.IO;
using System.Threading;
using ManagedBass;
using osu.Framework.Audio;
Expand Down Expand Up @@ -36,12 +37,17 @@ public BassTestComponents(bool init = true)

Mixer = CreateMixer();
Resources = new DllResourceStore(typeof(TrackBassTest).Assembly);
TrackStore = new TrackStore(Resources, Mixer);
SampleStore = new SampleStore(Resources, Mixer);
TrackStore = new TrackStore(Resources, Mixer, getNewTrack);
SampleStore = new SampleStore(Resources, Mixer, getSampleFactory);

Add(TrackStore, SampleStore);
}

private Track getNewTrack(Stream data, string name) => new TrackBass(data, name);

private SampleFactory getSampleFactory(byte[] data, string name, int playback_concurrency)
=> new SampleBassFactory(data, name, Mixer, playback_concurrency);

public void Init()
{
AudioThread.PreloadBass();
Expand Down

0 comments on commit 9d150b0

Please sign in to comment.