From 52bc3fa8f72bb2ea92647a534c31ca3d7bbd42ea Mon Sep 17 00:00:00 2001 From: martynshaw99 Date: Thu, 3 May 2012 22:28:58 +0000 Subject: [PATCH] Improving Progress bar messages to reflect what's actually happening --- src/effects/Effect.cpp | 4 ++-- src/effects/Effect.h | 2 +- src/effects/Normalize.cpp | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 15ea54e00..372207a3f 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -166,9 +166,9 @@ bool Effect::TotalProgress(double frac) return (updateResult != eProgressSuccess); } -bool Effect::TrackProgress(int whichTrack, double frac) +bool Effect::TrackProgress(int whichTrack, double frac, wxString msg) { - int updateResult = mProgress->Update(whichTrack + frac, (double) mNumTracks); + int updateResult = mProgress->Update(whichTrack + frac, (double) mNumTracks, msg); return (updateResult != eProgressSuccess); } diff --git a/src/effects/Effect.h b/src/effects/Effect.h index 2d71f8c2c..6394833b0 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -220,7 +220,7 @@ class AUDACITY_DLL_API Effect { // Pass a fraction between 0.0 and 1.0, for the current track // (when doing one track at a time) - bool TrackProgress(int whichTrack, double frac); + bool TrackProgress(int whichTrack, double frac, wxString = wxT("")); // Pass a fraction between 0.0 and 1.0, for the current track group // (when doing stereo groups at a time) diff --git a/src/effects/Normalize.cpp b/src/effects/Normalize.cpp index fdc482f6a..1ed7865fd 100644 --- a/src/effects/Normalize.cpp +++ b/src/effects/Normalize.cpp @@ -294,7 +294,7 @@ bool EffectNormalize::AnalyseDC(WaveTrack * track) //Update the Progress meter if (TrackProgress(mCurTrackNum, - ((double)(s - start) / (len*2)))) { + ((double)(s - start) / (len*2)), wxT("Analysing DC offset..."))) { rc = false; //lda .. break, not return, so that buffer is deleted break; } @@ -317,6 +317,17 @@ bool EffectNormalize::ProcessOne(WaveTrack * track) bool rc = true; sampleCount s; + wxString msg; + if(mDC & mGain) + msg = _("Removing offset and Normalizing..."); + else if(mDC & !mGain) + msg = _("Removing offset..."); + else if(!mDC & mGain) + msg = _("Normalizing without removing offset..."); + else if(!mDC & !mGain) + msg = wxT("Not doing anything)..."); // shouldn't get here + + //Transform the marker timepoints to samples sampleCount start = track->TimeToLongSamples(mCurT0); sampleCount end = track->TimeToLongSamples(mCurT1); @@ -355,7 +366,7 @@ bool EffectNormalize::ProcessOne(WaveTrack * track) //Update the Progress meter if (TrackProgress(mCurTrackNum, - ((double)(s - start) / (len*2)))) { + ((double)(s - start) / (len*2)), msg)) { rc = false; //lda .. break, not return, so that buffer is deleted break; }