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 @@ protected override Track GetTrack()
}
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 @@ private void applyRateAdjustments()
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 @@ public Track Track
}
}
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 @@ public virtual void Dispose()
{
background?.Dispose();
background = null;
waveform?.Dispose();
}
public void DisposeTrack()

View File

@ -18,7 +18,7 @@ public class BeatmapWaveformGraph : CompositeDrawable
public BeatmapWaveformGraph()
{
InternalChild = graph = new WaveformGraph { RelativeSizeAxes = Axes.Both };
Beatmap.ValueChanged += b => graph.Track = b.Track;
Beatmap.ValueChanged += b => graph.Waveform = b.Waveform;
}
/// <summary>