Пример #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();
            }
        }
Пример #3
0
 private void transferTo(AudioContainer target)
 {
     lastContainer?.Remove(Sample);
     target.Add(Sample);
     lastContainer = target;
 }