1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 23:59:37 +02:00

Spectral selection effects now prompt for missing frequency fields when used in time selection mode.

This commit is contained in:
james.k.crook@gmail.com 2014-10-24 20:27:04 +00:00
parent 8567775efb
commit d96bbb1f3a
6 changed files with 32 additions and 3 deletions

View File

@ -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"))

View File

@ -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

View File

@ -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"

View File

@ -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();

View File

@ -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

View File

@ -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();
}