diff --git a/plug-ins/SpectralEditMulti.ny b/plug-ins/SpectralEditMulti.ny index ef928c893..63b40a621 100644 --- a/plug-ins/SpectralEditMulti.ny +++ b/plug-ins/SpectralEditMulti.ny @@ -4,6 +4,9 @@ ;name "Spectral edit multi tool" ;action "Calculating..." +;control control-f0 "Low Frequency" real "" 4000 0 20000 +;control control-f1 "High Frequency" real "" 4000 0 20000 + (defun wet (sig) (cond ((not (or *f0* *f1*)) (throw 'error-message "Please select frequencies")) diff --git a/plug-ins/SpectralEditParametricEQ.ny b/plug-ins/SpectralEditParametricEQ.ny index 3a0faad0f..ff1a6bce3 100644 --- a/plug-ins/SpectralEditParametricEQ.ny +++ b/plug-ins/SpectralEditParametricEQ.ny @@ -5,7 +5,8 @@ ;action "Calculating..." ;control control-gain "Gain (dB)" real "" 0 -24 24 - +;control control-f0 "Low Frequency" real "" 4000 0 20000 +;control control-f1 "High Frequency" real "" 4000 0 20000 (defun wet (sig gain) (cond diff --git a/plug-ins/SpectralEditShelves.ny b/plug-ins/SpectralEditShelves.ny index d6bbda5cc..ec855c429 100644 --- a/plug-ins/SpectralEditShelves.ny +++ b/plug-ins/SpectralEditShelves.ny @@ -5,6 +5,8 @@ ;action "Calculating..." ;control control-gain "Gain (dB)" real "" 0 -24 24 +;control control-f0 "Low Frequency" real "" 4000 0 20000 +;control control-f1 "High Frequency" real "" 4000 0 20000 (defun mid-shelf (sig lf hf gain) "Combines high shelf and low shelf filters" diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index d0a1fe40d..9b330e86e 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -107,6 +107,13 @@ bool Effect::DoEffect(wxWindow *parent, int flags, #ifdef EXPERIMENTAL_SPECTRAL_EDITING mF0 = selectedRegion->f0(); mF1 = selectedRegion->f1(); + wxArrayString Names; + if( mF0 != SelectedRegion::UndefinedFrequency ) + Names.Add(wxT("control-f0")); + if( mF1 != SelectedRegion::UndefinedFrequency ) + Names.Add(wxT("control-f1")); + SetPresetParameters( &Names, NULL ); + #endif CountWaveTracks(); diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 739f2db41..4684c034e 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -121,6 +121,11 @@ class AUDACITY_DLL_API Effect { return true; } + void SetPresetParameters( const wxArrayString * Names, const wxArrayString * Values ){ + if( Names ) mPresetNames = *Names; + if( Values ) mPresetValues = *Values; + } + void SetEffectFlags( int NewFlags ) { mFlags = NewFlags; @@ -221,6 +226,9 @@ class AUDACITY_DLL_API Effect { double mF1; #endif TimeWarper *mWarper; + wxArrayString mPresetNames; + wxArrayString mPresetValues; + // // protected methods diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 2874c7235..2f7436040 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -334,7 +334,10 @@ void EffectNyquist::Parse(wxString line) ctrl.val = UNINITIALIZED_CONTROL; - mControls.Add(ctrl); + if( mPresetNames.Index( ctrl.var ) == wxNOT_FOUND ) + { + mControls.Add(ctrl); + } } if (len >= 2 && tokens[0] == wxT("categories")) { @@ -580,7 +583,12 @@ bool EffectNyquist::PromptUser() } if (!mExternal) { - if (mFileName.GetModificationTime().IsLaterThan(mFileModified)) { + //TODO: re-instate the caching of the lisp parsing so it is only done once. + //small efficiency gain. + //Disabled for now in order to allow number of controls to be varied easily + //depending on whether time or time-and-frequency were selected. + //if (mFileName.GetModificationTime().IsLaterThan(mFileModified)) + { ParseFile(); mFileModified = mFileName.GetModificationTime(); }