mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-20 17:41:13 +02:00
Spectral selection effects now prompt for missing frequency fields when used in time selection mode.
This commit is contained in:
@@ -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