1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-26 00:58:37 +02:00

Improving Progress bar messages to reflect what's actually happening

This commit is contained in:
martynshaw99 2012-05-03 22:28:58 +00:00
parent ebf54adaab
commit 52bc3fa8f7
3 changed files with 16 additions and 5 deletions

View File

@ -166,9 +166,9 @@ bool Effect::TotalProgress(double frac)
return (updateResult != eProgressSuccess); 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); return (updateResult != eProgressSuccess);
} }

View File

@ -220,7 +220,7 @@ class AUDACITY_DLL_API Effect {
// Pass a fraction between 0.0 and 1.0, for the current track // Pass a fraction between 0.0 and 1.0, for the current track
// (when doing one track at a time) // (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 // Pass a fraction between 0.0 and 1.0, for the current track group
// (when doing stereo groups at a time) // (when doing stereo groups at a time)

View File

@ -294,7 +294,7 @@ bool EffectNormalize::AnalyseDC(WaveTrack * track)
//Update the Progress meter //Update the Progress meter
if (TrackProgress(mCurTrackNum, 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 rc = false; //lda .. break, not return, so that buffer is deleted
break; break;
} }
@ -317,6 +317,17 @@ bool EffectNormalize::ProcessOne(WaveTrack * track)
bool rc = true; bool rc = true;
sampleCount s; 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 //Transform the marker timepoints to samples
sampleCount start = track->TimeToLongSamples(mCurT0); sampleCount start = track->TimeToLongSamples(mCurT0);
sampleCount end = track->TimeToLongSamples(mCurT1); sampleCount end = track->TimeToLongSamples(mCurT1);
@ -355,7 +366,7 @@ bool EffectNormalize::ProcessOne(WaveTrack * track)
//Update the Progress meter //Update the Progress meter
if (TrackProgress(mCurTrackNum, 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 rc = false; //lda .. break, not return, so that buffer is deleted
break; break;
} }