protected override void SkinChanged(ISkinSource skin, bool allowFallback) { channels = hitSamples.Select(s => { var ch = skin.GetSample(s); if (ch == null && allowFallback) { foreach (var lookup in s.LookupNames) { if ((ch = audio.Samples.Get($"Gameplay/{lookup}")) != null) { break; } } } if (ch != null) { ch.Volume.Value = s.Volume / 100.0; } return(ch); }).Where(c => c != null).ToArray(); }
public SampleChannel GetSample(string sampleName) { SampleChannel sourceChannel; if (beatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) { return(sourceChannel); } return(fallbackSource?.GetSample(sampleName)); }
public SampleChannel GetSample(ISampleInfo sampleInfo) { SampleChannel sourceChannel; if (beatmapHitsounds.Value && (sourceChannel = skin?.GetSample(sampleInfo)) != null) { return(sourceChannel); } return(fallbackSource?.GetSample(sampleInfo)); }
public SampleChannel GetSample(ISampleInfo sampleInfo) { SampleChannel sourceChannel; if (AllowSampleLookup(sampleInfo) && (sourceChannel = skin?.GetSample(sampleInfo)) != null) { return(sourceChannel); } return(fallbackSource?.GetSample(sampleInfo)); }
public ISample GetSample(ISampleInfo sampleInfo, bool fallback) { ISample sourceChannel; if (AllowSampleLookup(sampleInfo) && (sourceChannel = skin?.GetSample(sampleInfo)) != null) { return(sourceChannel); } if (!fallback) { return(null); } return(fallbackSource?.GetSample(sampleInfo)); }
public ISample GetSample(ISampleInfo sampleInfo) => skin.GetSample(sampleInfo);
public SampleChannel GetSample(ISampleInfo sampleInfo) => skin.GetSample(sampleInfo);