예제 #1
0
        public void Route(int slot, IMixerChannel route)
        {
            lock (locker)
            {
                AssertNotDisposed();

                if (AudioDevice.Capabilities.SupportsEfx)
                {
                    if (slot < 0 && slot >= AudioDevice.MaxRoutes)
                    {
                        throw new ArgumentOutOfRangeException("slot", "Slot must be between 0 and MaxRoutes.");
                    }

                    for (int i = 0; i < IDs.Count; i++)
                    {
                        if (route == null)
                        {
                            AudioDeviceInternal.Efx.BindSourceToAuxiliarySlot(IDs[i], 0, slot, 0);
                        }
                        else
                        {
                            AudioDeviceInternal.Efx.BindSourceToAuxiliarySlot(IDs[i], ((MixerChannel)route).ID, slot, 0);
                        }
                    }
                    DotGame.OpenAL.AudioDevice.CheckALError();
                }
            }
        }
예제 #2
0
 /// <inheritdoc/>
 public bool Equals(IMixerChannel other)
 {
     if (other is MixerChannel)
     {
         return(ID == ((MixerChannel)other).ID);
     }
     return(false);
 }
예제 #3
0
 public ChannelViewModel(IWaveformDisplayViewModel waveform, IMixerChannel channel)
 {
     Waveform = waveform ?? throw new ArgumentNullException(nameof(waveform));
     _channel = channel ?? throw new ArgumentNullException(nameof(channel));
     Waveform.PropertyChanged += Waveform_PropertyChanged;
 }