Revert audio changes

This commit is contained in:
Shane Woolcock 2019-01-19 14:18:49 +10:30
parent 63c61d3e27
commit f26a551e95
5 changed files with 8 additions and 12 deletions

View File

@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audioManager) private void load(AudioManager audioManager)
{ {
Beatmap.Value = new WaveformTestBeatmap(audioManager.Track); Beatmap.Value = new WaveformTestBeatmap();
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -20,7 +20,7 @@ namespace osu.Game.Tests.Visual
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audioManager) private void load(AudioManager audioManager)
{ {
Beatmap.Value = new WaveformTestBeatmap(audioManager.Track); Beatmap.Value = new WaveformTestBeatmap();
FillFlowContainer flow; FillFlowContainer flow;
Child = flow = new FillFlowContainer Child = flow = new FillFlowContainer

View File

@ -19,12 +19,10 @@ namespace osu.Game.Tests
{ {
private readonly ZipArchiveReader reader; private readonly ZipArchiveReader reader;
private readonly FileStream stream; private readonly FileStream stream;
private readonly TrackManager trackManager;
public WaveformTestBeatmap(TrackManager trackManager) public WaveformTestBeatmap()
: base(new BeatmapInfo()) : base(new BeatmapInfo())
{ {
this.trackManager = trackManager;
stream = File.OpenRead(ImportBeatmapTest.TEST_OSZ_PATH); stream = File.OpenRead(ImportBeatmapTest.TEST_OSZ_PATH);
reader = new ZipArchiveReader(stream); reader = new ZipArchiveReader(stream);
} }
@ -40,9 +38,9 @@ namespace osu.Game.Tests
protected override Texture GetBackground() => null; protected override Texture GetBackground() => null;
protected override Waveform GetWaveform() => trackManager.CreateWaveform(getAudioStream()); protected override Waveform GetWaveform() => new Waveform(getAudioStream());
protected override Track GetTrack() => trackManager.CreateTrack(getAudioStream()); protected override Track GetTrack() => new TrackBass(getAudioStream());
private Stream getAudioStream() => reader.GetStream(reader.Filenames.First(f => f.EndsWith(".mp3"))); private Stream getAudioStream() => reader.GetStream(reader.Filenames.First(f => f.EndsWith(".mp3")));
private Stream getBeatmapStream() => reader.GetStream(reader.Filenames.First(f => f.EndsWith(".osu"))); private Stream getBeatmapStream() => reader.GetStream(reader.Filenames.First(f => f.EndsWith(".osu")));

View File

@ -26,7 +26,7 @@ namespace osu.Game.Audio
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, FrameworkConfigManager config) private void load(AudioManager audio, FrameworkConfigManager config)
{ {
trackManager = new TrackManager(new OnlineStore(), audio.Callback); trackManager = new TrackManager(new OnlineStore());
this.audio = audio; this.audio = audio;
audio.AddItem(trackManager); audio.AddItem(trackManager);

View File

@ -21,7 +21,6 @@ namespace osu.Game.Beatmaps
{ {
private readonly IResourceStore<byte[]> store; private readonly IResourceStore<byte[]> store;
private readonly AudioManager audioManager; private readonly AudioManager audioManager;
private readonly TrackManager trackManager;
public BeatmapManagerWorkingBeatmap(IResourceStore<byte[]> store, TextureStore textureStore, BeatmapInfo beatmapInfo, AudioManager audioManager) public BeatmapManagerWorkingBeatmap(IResourceStore<byte[]> store, TextureStore textureStore, BeatmapInfo beatmapInfo, AudioManager audioManager)
: base(beatmapInfo) : base(beatmapInfo)
@ -29,7 +28,6 @@ namespace osu.Game.Beatmaps
this.store = store; this.store = store;
this.textureStore = textureStore; this.textureStore = textureStore;
this.audioManager = audioManager; this.audioManager = audioManager;
trackManager = audioManager.Track;
} }
protected override IBeatmap GetBeatmap() protected override IBeatmap GetBeatmap()
@ -71,7 +69,7 @@ namespace osu.Game.Beatmaps
try try
{ {
var trackData = store.GetStream(getPathForFile(Metadata.AudioFile)); var trackData = store.GetStream(getPathForFile(Metadata.AudioFile));
return trackData == null ? null : trackManager.CreateTrack(trackData); return trackData == null ? null : new TrackBass(trackData);
} }
catch catch
{ {
@ -92,7 +90,7 @@ namespace osu.Game.Beatmaps
try try
{ {
var trackData = store.GetStream(getPathForFile(Metadata.AudioFile)); var trackData = store.GetStream(getPathForFile(Metadata.AudioFile));
return trackData == null ? null : trackManager.CreateWaveform(trackData); return trackData == null ? null : new Waveform(trackData);
} }
catch catch
{ {