mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
9690591593
This is a temporary solution for now that uses DrawableHitObject.SampleNamespace for the override. We will not want to do this going forward, and instead have the rulesets add their custom resource stores to the games', but that requires deciding where/when to apply/remove such resource stores, and is probably left to skinning.
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
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 System;
|
|
using osu.Framework.Audio.Sample;
|
|
|
|
namespace osu.Game.Audio
|
|
{
|
|
[Serializable]
|
|
public class SampleInfo
|
|
{
|
|
public const string HIT_WHISTLE = @"hitwhistle";
|
|
public const string HIT_FINISH = @"hitfinish";
|
|
public const string HIT_NORMAL = @"hitnormal";
|
|
public const string HIT_CLAP = @"hitclap";
|
|
|
|
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
|
|
{
|
|
SampleChannel channel = null;
|
|
|
|
if (!string.IsNullOrEmpty(resourceNamespace))
|
|
channel = manager.Get($"Gameplay/{resourceNamespace}/{Bank}-{Name}");
|
|
|
|
if (channel == null)
|
|
channel = manager.Get($"Gameplay/{Bank}-{Name}");
|
|
|
|
channel.Volume.Value = Volume / 100.0;
|
|
return channel;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The bank to load the sample from.
|
|
/// </summary>
|
|
public string Bank;
|
|
|
|
/// <summary>
|
|
/// The name of the sample to load.
|
|
/// </summary>
|
|
public string Name;
|
|
|
|
/// <summary>
|
|
/// The sample volume.
|
|
/// </summary>
|
|
public int Volume;
|
|
}
|
|
}
|