Add looping field and fix build

This commit is contained in:
iiSaLMaN 2019-08-15 05:35:47 +03:00
parent 07e7e1187c
commit cfa569b226
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Audio;
@ -35,6 +36,8 @@ private void load(AudioManager audio)
this.audio = audio;
}
public bool Looping;
public void Play() => channels?.ForEach(c => c.Play());
public void AddAdjustment(AdjustableProperty type, BindableDouble adjustBindable) => channels?.ForEach(c => c.AddAdjustment(type, adjustBindable));
@ -60,6 +63,7 @@ private SampleChannel loadChannel(ISampleInfo info, Func<string, SampleChannel>
if (ch == null)
continue;
ch.Looping = Looping;
ch.Volume.Value = info.Volume / 100.0;
return ch;
}