示例#1
0
        private void updateSample()
        {
            if (sampleInfo == null)
            {
                return;
            }

            var sample = CurrentSkin.GetSample(sampleInfo);

            if (sample == null && AllowDefaultFallback)
            {
                foreach (var lookup in sampleInfo.LookupNames)
                {
                    if ((sample = sampleStore.Get(lookup)) != null)
                    {
                        break;
                    }
                }
            }

            if (sample == null)
            {
                return;
            }

            sampleContainer.Add(Sample = new DrawableSample(sample));

            // Start playback internally for the new sample if the previous one was playing beforehand.
            if (wasPlaying && Looping)
            {
                Play();
            }
        }
示例#2
0
        private void updateSample()
        {
            if (sampleInfo == null)
            {
                return;
            }

            var sample = CurrentSkin.GetSample(sampleInfo);

            if (sample == null)
            {
                return;
            }

            sampleContainer.Add(Sample = new DrawableSample(sample));

            // Start playback internally for the new sample if the previous one was playing beforehand.
            if (wasPlaying && Looping)
            {
                Play();
            }
        }