2019-01-24 17:43:03 +09:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2019-08-23 14:54:39 +03:00
|
|
|
|
using System.Collections.Generic;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using osu.Framework.Graphics;
|
2019-08-23 14:54:39 +03:00
|
|
|
|
using osu.Game.Audio;
|
2018-06-28 13:43:56 +09:00
|
|
|
|
using osu.Game.Storyboards.Drawables;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Storyboards
|
|
|
|
|
{
|
2019-08-23 14:54:39 +03:00
|
|
|
|
public class StoryboardSampleInfo : IStoryboardElement, ISampleInfo
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2019-08-23 14:54:39 +03:00
|
|
|
|
public string Path { get; }
|
2018-06-28 13:43:56 +09:00
|
|
|
|
public bool IsDrawable => true;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2019-03-26 16:16:28 +09:00
|
|
|
|
public double StartTime { get; }
|
|
|
|
|
|
2019-08-23 14:54:39 +03:00
|
|
|
|
public int Volume { get; }
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2019-08-23 14:55:06 +03:00
|
|
|
|
public IEnumerable<string> LookupNames => new[]
|
|
|
|
|
{
|
|
|
|
|
// Try first with the full name, then attempt with no path
|
|
|
|
|
Path,
|
|
|
|
|
System.IO.Path.ChangeExtension(Path, null),
|
|
|
|
|
};
|
|
|
|
|
|
2019-08-23 14:54:39 +03:00
|
|
|
|
public StoryboardSampleInfo(string path, double time, int volume)
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
|
|
|
|
Path = path;
|
2019-03-26 16:16:28 +09:00
|
|
|
|
StartTime = time;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
Volume = volume;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-28 13:43:56 +09:00
|
|
|
|
public Drawable CreateDrawable() => new DrawableStoryboardSample(this);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
}
|