mirror of
https://github.com/ppy/osu
synced 2024-12-11 01:19:26 +00:00
Update in-line with framework
This commit is contained in:
parent
7926757898
commit
19b38983df
@ -1 +1 @@
|
||||
Subproject commit 4019939ba9f0a407880e00422280ba573ffddb24
|
||||
Subproject commit 38cf96c8994ad41ae6aa86de6bfe09fd5fa9e1b6
|
@ -573,6 +573,16 @@ namespace osu.Game.Beatmaps
|
||||
}
|
||||
catch { return new TrackVirtual(); }
|
||||
}
|
||||
|
||||
protected override Waveform GetWaveform()
|
||||
{
|
||||
try
|
||||
{
|
||||
var trackData = store.GetStream(getPathForFile(Metadata.AudioFile));
|
||||
return trackData == null ? new Waveform() : new Waveform(trackData);
|
||||
}
|
||||
catch { return new Waveform(); }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -43,6 +43,7 @@ namespace osu.Game.Beatmaps
|
||||
protected abstract Beatmap GetBeatmap();
|
||||
protected abstract Texture GetBackground();
|
||||
protected abstract Track GetTrack();
|
||||
protected virtual Waveform GetWaveform() => new Waveform();
|
||||
|
||||
private Beatmap beatmap;
|
||||
private readonly object beatmapLock = new object();
|
||||
@ -96,6 +97,17 @@ namespace osu.Game.Beatmaps
|
||||
}
|
||||
}
|
||||
|
||||
private Waveform waveform;
|
||||
private readonly object waveformLock = new object();
|
||||
public Waveform Waveform
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (waveformLock)
|
||||
return waveform ?? (waveform = GetWaveform());
|
||||
}
|
||||
}
|
||||
|
||||
public bool TrackLoaded => track != null;
|
||||
|
||||
public void TransferTo(WorkingBeatmap other)
|
||||
@ -114,6 +126,8 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
background?.Dispose();
|
||||
background = null;
|
||||
|
||||
waveform?.Dispose();
|
||||
}
|
||||
|
||||
public void DisposeTrack()
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose
|
||||
public BeatmapWaveformGraph()
|
||||
{
|
||||
InternalChild = graph = new WaveformGraph { RelativeSizeAxes = Axes.Both };
|
||||
Beatmap.ValueChanged += b => graph.Track = b.Track;
|
||||
Beatmap.ValueChanged += b => graph.Waveform = b.Waveform;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user