mirror of
https://github.com/osukey/osukey.git
synced 2025-05-24 06:57:36 +09:00
33 lines
848 B
C#
33 lines
848 B
C#
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Audio;
|
|
using osu.Framework.Audio.Track;
|
|
using osu.Framework.Graphics;
|
|
|
|
namespace osu.Game.Audio
|
|
{
|
|
public class AudioLoadWrapper : Drawable
|
|
{
|
|
private readonly string preview;
|
|
|
|
public Track Preview;
|
|
|
|
public AudioLoadWrapper(string preview)
|
|
{
|
|
this.preview = preview;
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(AudioManager audio)
|
|
{
|
|
if (!string.IsNullOrEmpty(preview))
|
|
{
|
|
Preview = audio.Track.Get(preview);
|
|
Preview.Volume.Value = 0.5;
|
|
}
|
|
}
|
|
}
|
|
}
|