1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:33:52 +08:00

Expose the latest end time of storyboard elements

Co-authored-by: Marlina Bowring <marlina@umich.edu>
This commit is contained in:
Christine Chen 2021-04-12 16:02:19 -04:00
parent 4853ac802c
commit 16d34bcc0a
4 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,8 @@ namespace osu.Game.Storyboards
double StartTime { get; }
double EndTime { get; }
Drawable CreateDrawable();
}
}

View File

@ -36,6 +36,15 @@ namespace osu.Game.Storyboards
/// </remarks>
public double? EarliestEventTime => Layers.SelectMany(l => l.Elements).OrderBy(e => e.StartTime).FirstOrDefault()?.StartTime;
/// <summary>
/// Across all layers, find the latest point in time that a storyboard element ends at.
/// Will return null if there are no elements.
/// </summary>
/// <remarks>
/// This iterates all elements and as such should be used sparingly or stored locally.
/// Videos and samples return StartTime as their EndTIme.
/// </remarks>
public double? LatestEventTime => Layers.SelectMany(l => l.Elements).OrderByDescending(e => e.EndTime).FirstOrDefault()?.EndTime;
/// <summary>
/// Depth of the currently front-most storyboard layer, excluding the overlay layer.
/// </summary>

View File

@ -15,6 +15,8 @@ namespace osu.Game.Storyboards
public double StartTime { get; }
public double EndTime => StartTime;
public int Volume { get; }
public IEnumerable<string> LookupNames => new[]

View File

@ -14,6 +14,8 @@ namespace osu.Game.Storyboards
public double StartTime { get; }
public double EndTime => StartTime;
public StoryboardVideo(string path, int offset)
{
Path = path;