Exemplo n.º 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 SetDistortionFxToUi()
        {
            if (_soundFx.Type != SoundFxType.Distortion)
            {
                throw new Exception("Cannot set Distortion effect details, effect is of different type");
            }

            DistortionSoundFx effect = (DistortionSoundFx)_soundFx;

            SetParamDetails(1, effect.Gain);
            SetParamDetails(2, effect.Edge);
            SetParamDetails(3, effect.PostEqCenterFreq);
            SetParamDetails(4, effect.PostEqBandwidth);
            SetParamDetails(5, effect.PreLowpassCutoff);
            SetParamDetails(6, null);

            WaveformPropertiesControl.Enabled = false;
            PhasePropertiesControl.Enabled    = false;
        }