diff --git a/src/effects/ClickRemoval.cpp b/src/effects/ClickRemoval.cpp index 0b55afffc..4efea2a9b 100644 --- a/src/effects/ClickRemoval.cpp +++ b/src/effects/ClickRemoval.cpp @@ -62,9 +62,7 @@ EffectClickRemoval::EffectClickRemoval() { windowSize = 8192; - // mThresholdLevel = 200; - // mClickWidth = 20; - sep=2049; + sep = 2049; Init(); } @@ -114,6 +112,7 @@ bool EffectClickRemoval::PromptUser() return gPrefs->Flush(); } + bool EffectClickRemoval::TransferParameters( Shuttle & shuttle ) { shuttle.TransferInt(wxT("Threshold"),mThresholdLevel,0); @@ -163,8 +162,7 @@ bool EffectClickRemoval::ProcessOne(int count, WaveTrack * track, sampleCount st wxMessageBox( wxString::Format(_("Selection must be larger than %d samples."), windowSize/2), this->GetEffectName(), - wxOK | wxICON_ERROR - ); + wxOK | wxICON_ERROR); return false; } @@ -196,18 +194,19 @@ bool EffectClickRemoval::ProcessOne(int count, WaveTrack * track, sampleCount st for(j=wcopy; jSet((samplePtr) buffer, floatSample, start + s, block); + if (bResult) // RemoveClicks() actually did something. + track->Set((samplePtr) buffer, floatSample, start + s, block); s += block; if (TrackProgress(count, s / (double) len)) { - bResult = false; + // Not necessarily a failure, as might be eProgressCancelled. // bResult = false; break; } } @@ -215,6 +214,12 @@ bool EffectClickRemoval::ProcessOne(int count, WaveTrack * track, sampleCount st delete[] buffer; delete[] datawindow; + if (!bResult) + wxMessageBox( + wxString::Format(_("Algorithm not effective on these data. Nothing changed.")), + this->GetEffectName(), + wxOK | wxICON_ERROR); + return bResult; }