Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        public SampleChannel GetSample(string sampleName)
        {
            SampleChannel sourceChannel;

            if (beatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null)
            {
                return(sourceChannel);
            }
            return(fallbackSource?.GetSample(sampleName));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 5
0
        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);
Esempio n. 7
0
 public SampleChannel GetSample(ISampleInfo sampleInfo) => skin.GetSample(sampleInfo);