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 SetCompressorFxToUi() { if (_soundFx.Type != SoundFxType.Compressor) { throw new Exception("Cannot set Compressor effect details, effect is of different type"); } CompressorSoundFx effect = (CompressorSoundFx)_soundFx; SetParamDetails(1, effect.Gain); SetParamDetails(2, effect.Attack); SetParamDetails(3, effect.Release); SetParamDetails(4, effect.Threshold); SetParamDetails(5, effect.Ratio); SetParamDetails(6, effect.Predelay); WaveformPropertiesControl.Enabled = false; PhasePropertiesControl.Enabled = false; }