Update in-line with framework

This commit is contained in:
smoogipoo 2017-10-09 17:18:11 +09:00
parent 7926757898
commit 19b38983df
4 changed files with 26 additions and 2 deletions

@ -1 +1 @@
Subproject commit 4019939ba9f0a407880e00422280ba573ffddb24
Subproject commit 38cf96c8994ad41ae6aa86de6bfe09fd5fa9e1b6

View File

@ -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>

View File

@ -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()

View File

@ -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>