mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 21:07:59 +09:00
Add adjustments on channel creation if there is
This commit is contained in:
parent
3d62003382
commit
ec6a40af33
@ -15,6 +15,9 @@ namespace osu.Game.Skinning
|
|||||||
public class SkinnableSound : SkinReloadableDrawable
|
public class SkinnableSound : SkinReloadableDrawable
|
||||||
{
|
{
|
||||||
private readonly ISampleInfo[] hitSamples;
|
private readonly ISampleInfo[] hitSamples;
|
||||||
|
|
||||||
|
private readonly List<(AdjustableProperty, BindableDouble)> adjustments = new List<(AdjustableProperty, BindableDouble)>();
|
||||||
|
|
||||||
private SampleChannel[] channels;
|
private SampleChannel[] channels;
|
||||||
|
|
||||||
private AudioManager audio;
|
private AudioManager audio;
|
||||||
@ -51,8 +54,17 @@ namespace osu.Game.Skinning
|
|||||||
public void Play() => channels?.ForEach(c => c.Play());
|
public void Play() => channels?.ForEach(c => c.Play());
|
||||||
public void Stop() => channels?.ForEach(c => c.Stop());
|
public void Stop() => channels?.ForEach(c => c.Stop());
|
||||||
|
|
||||||
public void AddAdjustment(AdjustableProperty type, BindableDouble adjustBindable) => channels?.ForEach(c => c.AddAdjustment(type, adjustBindable));
|
public void AddAdjustment(AdjustableProperty type, BindableDouble adjustBindable)
|
||||||
public void RemoveAdjustment(AdjustableProperty type, BindableDouble adjustBindable) => channels?.ForEach(c => c.RemoveAdjustment(type, adjustBindable));
|
{
|
||||||
|
adjustments.Add((type, adjustBindable));
|
||||||
|
channels?.ForEach(c => c.AddAdjustment(type, adjustBindable));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveAdjustment(AdjustableProperty type, BindableDouble adjustBindable)
|
||||||
|
{
|
||||||
|
adjustments.Remove((type, adjustBindable));
|
||||||
|
channels?.ForEach(c => c.RemoveAdjustment(type, adjustBindable));
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsPresent => Scheduler.HasPendingTasks;
|
public override bool IsPresent => Scheduler.HasPendingTasks;
|
||||||
|
|
||||||
@ -71,6 +83,9 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
ch.Looping = looping;
|
ch.Looping = looping;
|
||||||
ch.Volume.Value = s.Volume / 100.0;
|
ch.Volume.Value = s.Volume / 100.0;
|
||||||
|
|
||||||
|
foreach (var adjustment in adjustments)
|
||||||
|
ch.AddAdjustment(adjust.Item1, adjust.Item2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ch;
|
return ch;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user