diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 30b3cbe11..adbee9037 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -71,6 +71,9 @@ greater use in future. #include #endif +// Effect application counter +int Effect::nEffectsDone=0; + static const int kDummyID = 20000; static const int kSaveAsID = 20001; static const int kImportID = 20002; @@ -2267,6 +2270,7 @@ void Effect::ReplaceProcessedTracks(const bool bGoodResult) // The output list is no longer needed mOutputTracks.reset(); mOutputTracksType = Track::None; + nEffectsDone++; } void Effect::CountWaveTracks() diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 31e0f405b..867828d99 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -340,7 +340,6 @@ protected: bool TrackGroupProgress(int whichGroup, double frac, const wxString & = wxEmptyString); int GetNumWaveTracks() { return mNumTracks; } - int GetNumWaveGroups() { return mNumGroups; } // Calculates the start time and selection length in samples @@ -369,6 +368,9 @@ protected: void CopyInputTracks(); // trackType = Track::Wave void CopyInputTracks(int trackType); + // A global counter of all the successful Effect invocations. + static int nEffectsDone; + // For the use of analyzers, which don't need to make output wave tracks, // but may need to add label tracks. class AddedAnalysisTrack { diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 4b56b5bee..58e1754a4 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -488,6 +488,8 @@ bool NyquistEffect::CheckWhetherSkipEffect() bool NyquistEffect::Process() { bool success = true; + + int nEffectsSoFar = nEffectsDone; mProjectChanged = false; EffectManager & em = EffectManager::Get(); em.SetSkipStateFlag(false); @@ -790,7 +792,11 @@ _("Selection too long for Nyquist code.\nMaximum allowed selection is %ld sample dlog.ShowModal(); } - ReplaceProcessedTracks(success); + // Has rug been pulled from under us by some effect done within Nyquist?? + if( nEffectsSoFar == nEffectsDone ) + ReplaceProcessedTracks(success); + else + ReplaceProcessedTracks(false); // Do not use the results. if (!mProjectChanged) em.SetSkipStateFlag(true);