Пример #1
0
 public static Oscillator FrequencyModulate(this Oscillator oscillator, double frequency, short amplitude, WaveForm waveForm)
 {
     oscillator.FrequencyModulator.ModulationFrequency = frequency;
     oscillator.FrequencyModulator.Amplitude           = amplitude;
     oscillator.FrequencyModulator.WaveForm            = waveForm;
     return(oscillator);
 }
Пример #2
0
        public static Mixer SendToMixer(this Oscillator oscillator)
        {
            Mixer mixer = new Mixer();

            mixer.Inputs.Add(oscillator);
            oscillator.Output = mixer;
            return(mixer);
        }
Пример #3
0
        public static Attenuator Attenuate(this Oscillator oscillator, double attenuation)
        {
            Attenuator item = new Attenuator()
            {
                Attenuation = attenuation, Input = oscillator
            };

            oscillator.Output = item;
            return(item);
        }
Пример #4
0
        public static Oscillator SetWaveForm(this Oscillator oscillator, FrameworkElement target, DependencyProperty property)
        {
            Binding binding = new Binding();

            binding.Mode   = BindingMode.TwoWay;
            binding.Source = oscillator;
            binding.Path   = new PropertyPath("WaveFormType");
            target.SetBinding(property, binding);
            return(oscillator);
        }
Пример #5
0
        public static Panner Pan(this Oscillator oscillator, short pan)
        {
            Panner panner = new Panner()
            {
                Pan = pan, Input = oscillator
            };

            oscillator.Output = panner;
            return(panner);
        }
Пример #6
0
        public static Oscillator AmplitudeModulate(this Oscillator oscillator, FrameworkElement target, DependencyProperty property)
        {
            Binding frequencyBinding = new Binding();

            frequencyBinding.Mode   = BindingMode.TwoWay;
            frequencyBinding.Source = oscillator.AmplitudeModulator;
            frequencyBinding.Path   = new PropertyPath("ModulationFrequency");
            target.SetBinding(property, frequencyBinding);
            return(oscillator);
        }
Пример #7
0
        public static Attenuator Attenuate(this Oscillator oscillator, FrameworkElement target, DependencyProperty property)
        {
            Attenuator attenuator = new Attenuator();

            attenuator.Input  = oscillator;
            oscillator.Output = attenuator;
            Binding binding = new Binding();

            binding.Mode   = BindingMode.TwoWay;
            binding.Source = attenuator;
            binding.Path   = new PropertyPath("Attenuation");
            target.SetBinding(property, binding);
            return(attenuator);
        }
Пример #8
0
        public static Panner Pan(this Oscillator oscillator, FrameworkElement target, DependencyProperty property)
        {
            Panner panner = new Panner()
            {
                Input = oscillator
            };
            Binding binding = new Binding();

            binding.Mode   = BindingMode.TwoWay;
            binding.Source = panner;
            binding.Path   = new PropertyPath("Pan");
            target.SetBinding(property, binding);
            oscillator.Output = panner;
            return(panner);
        }
Пример #9
0
        public static Oscillator FrequencyModulate(this Oscillator oscillator, FrameworkElement frequencyTarget, DependencyProperty frequencyProperty, FrameworkElement amplitudeTarget, DependencyProperty amplitudeProperty, WaveForm waveForm)
        {
            oscillator.FrequencyModulator.WaveForm = waveForm;

            if (frequencyProperty != null && frequencyTarget != null)
            {
                Binding frequencyBinding = new Binding();
                frequencyBinding.Mode   = BindingMode.TwoWay;
                frequencyBinding.Source = oscillator.FrequencyModulator;
                frequencyBinding.Path   = new PropertyPath("ModulationFrequency");
                frequencyTarget.SetBinding(frequencyProperty, frequencyBinding);
            }

            if (amplitudeProperty != null && amplitudeTarget != null)
            {
                Binding amplitudeBinding = new Binding();
                amplitudeBinding.Mode   = BindingMode.TwoWay;
                amplitudeBinding.Source = oscillator.FrequencyModulator;
                amplitudeBinding.Path   = new PropertyPath("Amplitude");
                amplitudeTarget.SetBinding(amplitudeProperty, amplitudeBinding);
            }

            return(oscillator);
        }
Пример #10
0
 void Initialize() {
   var spss = new StereoPcmStreamSource();
   _oscillator = new Oscillator() { Frequency = 0 };
   spss.Input = _oscillator;
   _Source = spss;
 }
Пример #11
0
 public static Oscillator AmplitudeModulate(this Oscillator oscillator, double frequency)
 {
     oscillator.AmplitudeModulator.ModulationFrequency = frequency;
     return(oscillator);
 }
Пример #12
0
 public static Oscillator SetWaveForm(this Oscillator oscillator, WaveForm waveForm)
 {
     oscillator.WaveFormType = waveForm;
     return(oscillator);
 }
Пример #13
0
 public static Oscillator SetFrequencyModulationWaveForm(this Oscillator oscillator, WaveForm waveForm)
 {
     oscillator.FrequencyModulator.WaveForm = waveForm;
     return(oscillator);
 }
Пример #14
0
 public static Oscillator SetFrequency(this Oscillator oscillator, double frequency)
 {
     oscillator.Frequency = frequency;
     return(oscillator);
 }
Пример #15
0
 public static Oscillator FrequencyModulateFrequency(this Oscillator oscillator, FrameworkElement frequencyTarget, DependencyProperty frequencyProperty)
 {
     return(oscillator.FrequencyModulate(
                frequencyTarget, frequencyProperty, null, null, oscillator.FrequencyModulator.WaveForm));
 }
Пример #16
0
 public static Oscillator SendToMixer(this Oscillator oscillator, Mixer mixer)
 {
     mixer.Inputs.Add(oscillator);
     oscillator.Output = mixer;
     return(oscillator);
 }
Пример #17
0
 public static Oscillator FrequencyModulate(this Oscillator oscillator, FrameworkElement frequencyTarget, DependencyProperty frequencyProperty, FrameworkElement amplitudeTarget, DependencyProperty amplitudeProperty)
 {
     return(oscillator.FrequencyModulate(
                frequencyTarget, frequencyProperty, amplitudeTarget, amplitudeProperty, oscillator.FrequencyModulator.WaveForm));
 }