diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 1897e229b..d047deab7 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -26,7 +26,6 @@ greater use in future. #include #include #include -#include #include #include #include @@ -140,7 +139,8 @@ bool Effect::DoEffect(wxWindow *parent, int flags, bool skipFlag = CheckWhetherSkipEffect(); if (skipFlag == false) { mProgress = new ProgressDialog(StripAmpersand(GetEffectName()), - GetEffectAction()); + GetEffectAction(), + pdlgHideStopButton); returnVal = Process(); delete mProgress; } @@ -163,25 +163,19 @@ bool Effect::DoEffect(wxWindow *parent, int flags, bool Effect::TotalProgress(double frac) { int updateResult = mProgress->Update(frac); - if (updateResult == eProgressSuccess) - return false; - return true; + return (updateResult != eProgressSuccess); } bool Effect::TrackProgress(int whichTrack, double frac) { int updateResult = mProgress->Update(whichTrack + frac, (double) mNumTracks); - if (updateResult == eProgressSuccess) - return false; - return true; + return (updateResult != eProgressSuccess); } bool Effect::TrackGroupProgress(int whichGroup, double frac) { int updateResult = mProgress->Update(whichGroup + frac, (double) mNumGroups); - if (updateResult == eProgressSuccess) - return false; - return true; + return (updateResult != eProgressSuccess); } void Effect::GetSamples(WaveTrack *track, sampleCount *start, sampleCount *len) @@ -472,7 +466,8 @@ void Effect::Preview() // again, so the state is exactly the way it was before Preview // was called. mProgress = new ProgressDialog(StripAmpersand(GetEffectName()), - _("Preparing preview")); + _("Preparing preview"), + pdlgHideCancelButton); // Have only "Stop" button. bool bSuccess = Process(); delete mProgress; End(); diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 085e0cc07..35f931e86 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -14,7 +14,6 @@ #include -#include #include #include #include @@ -135,6 +134,10 @@ class AUDACITY_DLL_API Effect { wxString GetPreviewName(); + //ANSWER-ME: Isn't this pointless? + // None of the built-in functions has an ampersand in the result of + // GetEffectName(), the only strings on which this method is used. + // In fact, the example 'E&qualizer' does not exist in the code! // Strip ampersand ('&' char) from string. This effectively removes the // shortcut from the string ('E&qualizer' becomes 'Equalizer'). This is // important for sorting. @@ -147,11 +150,10 @@ class AUDACITY_DLL_API Effect { // do its processing. // protected: - // The constructor. Called once at the beginning of the program. + // The constructor is called once by each subclass at the beginning of the program. // Avoid allocating memory or doing time-consuming processing here. Effect(); - //The destructor. virtual ~Effect(); // Called once each time an effect is called. Perform any initialization; diff --git a/src/effects/EffectManager.cpp b/src/effects/EffectManager.cpp index 9c7ab06d1..07c1a9634 100644 --- a/src/effects/EffectManager.cpp +++ b/src/effects/EffectManager.cpp @@ -62,7 +62,7 @@ void EffectManager::RegisterEffect(Effect *f, int NewFlags) int i; for(i=0; iGetEffectName())) < 0) { - mEffects.Insert(f, i); + mEffects.Insert(f, i); break; } if (i==len) diff --git a/src/effects/Generator.cpp b/src/effects/Generator.cpp index b06eed036..8811c1d33 100644 --- a/src/effects/Generator.cpp +++ b/src/effects/Generator.cpp @@ -46,9 +46,9 @@ bool Generator::Process() //if we can't move clips, and we're generating into an empty space, //make sure there's room. if (!editClipCanMove && - track->IsEmpty(mT0, mT1+1.0/track->GetRate()) && + track->IsEmpty(mT0, mT1+1.0/track->GetRate()) && !track->IsEmpty(mT0, mT0+mDuration-(mT1-mT0)-1.0/track->GetRate())) - { + { wxMessageBox( _("There is not enough room available to generate the audio"), _("Error"), wxICON_STOP);