mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-10-31 14:13:50 +01:00 
			
		
		
		
	Spectral selection effects now prompt for missing frequency fields when used in time selection mode.
This commit is contained in:
		| @@ -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")) | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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" | ||||
|   | ||||
| @@ -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(); | ||||
|  | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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(); | ||||
|       } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user