Exemple #1
0
        public SoundFxPropertiesControl()
        {
            InitializeComponent();

            try
            {
                _chorus     = new ChorusSoundFx();;
                _compressor = new CompressorSoundFx();
                _distortion = new DistortionSoundFx();
                _echo       = new EchoSoundFx();
                _flanger    = new FlangerSoundFx();
                _gargle     = new GargleSoundFx();
                _paramEq    = new ParamEqSoundFx();
                _reverb     = new ReverbSoundFx();

                FxPropertiesControl.EffectChanged += new Delegates.SoundFxEventHandler(FxPropertiesControlEffectChanged);

                FrequencyParameterValueControl.UpdateParameter(100, 100000, "Frequency", 50000, 1);
                FrequencyParameterValueControl.ValueChangedEvent += new Delegates.ParameterValueActionEventHandler(OnFrequencyValueChangedEvent);
            }
            catch (System.Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
        private void SetFlangerFxToUi()
        {
            if (_soundFx.Type != SoundFxType.Flanger)
            {
                throw new Exception("Cannot set Flanger effect details, effect is of different type");
            }

            FlangerSoundFx effect = (FlangerSoundFx)_soundFx;

            SetParamDetails(1, effect.WetDryMix);
            SetParamDetails(2, effect.Depth);
            SetParamDetails(3, effect.Feedback);
            SetParamDetails(4, effect.Frequency);
            SetParamDetails(5, effect.Delay);
            SetParamDetails(6, null);

            WaveformPropertiesControl.Enabled  = true;
            WaveformPropertiesControl.Waveform = effect.Waveform;
            WaveformPropertiesControl.DisableType(WaveformType.Square);

            PhasePropertiesControl.Enabled = true;
            PhasePropertiesControl.Phase   = effect.Phase;
        }