예제 #1
0
 public void Add(IAudioChannel channel)
 {
     if (LoadState < LoadState.Ready)
     {
         Schedule(() => mixer.Add(channel));
     }
     else
     {
         Debug.Assert(mixer != null);
         mixer.Add(channel);
     }
 }
예제 #2
0
        public Track Get(string name)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException($"Cannot retrieve items for an already disposed {nameof(TrackStore)}");
            }

            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }

            var dataStream = store.GetStream(name);

            if (dataStream == null)
            {
                return(null);
            }

            TrackBass trackBass = new TrackBass(dataStream);

            mixer.Add(trackBass);
            AddItem(trackBass);

            return(trackBass);
        }
예제 #3
0
            public Track Get(string name)
            {
                if (IsDisposed)
                {
                    throw new ObjectDisposedException($"Cannot retrieve items for an already disposed {nameof(PreviewTrackStore)}");
                }

                if (string.IsNullOrEmpty(name))
                {
                    return(null);
                }

                var dataStream = store.GetStream(name);

                if (dataStream == null)
                {
                    return(null);
                }

                // Todo: This is quite unsafe. TrackBass shouldn't be exposed as public.
                Track track = new TrackBass(dataStream);

                defaultMixer.Add(track);
                AddItem(track);

                return(track);
            }