Code cleanup Effect TrackProgress

In SVN HEAD srceffectsEffect.h at or near line number 249:

bool TrackProgress(int whichTrack, double frac, wxString = wxT(""));

Note that the third parameter (wxString) has no name; while currently permissible in C++ I expect this is probably an inadvertent typo. I think it should be:

bool TrackProgress(int whichTrack, double frac, const wxString & msg = wxEmptyString);

to conform with the source code in Effect.cpp:

bool Effect::TrackProgress(int whichTrack, double frac, wxString msg)

which should probably be:

bool Effect::TrackProgress(int whichTrack, double frac, const wxString & msg)

because the the message should be passed as a constant reference not cloned.

Additionally, if you look at Effect.h at or near line number 189:

bool Effect::TrackGroupProgress(int whichGroup, double frac)

You will see that the almost identical progress indicator for groups is lacking the third “message” parameter; obviously none of the current versions of this function are being passed a message but having the ability in the future to do so might make sense. Clearly it is prepared to do so:

bool Effect::TrackProgress(int whichTrack, double frac, wxString msg)
{
   int updateResult = mProgress->Update(whichTrack + frac, (double) mNumTracks, msg);
   return (updateResult != eProgressSuccess);
}

bool Effect::TrackGroupProgress(int whichGroup, double frac)
{
   int updateResult = mProgress->Update(whichGroup + frac, (double) mNumGroups);
   return (updateResult != eProgressSuccess);
}

as you can see, both pieces of code use the exact same function (mProgress->Update) regardless of whether it is doing single or group:

int Update(double current, double total, const wxString & message = wxEmptyString);

(and you can see the proper use of “& message = wxEmptyString” - 3 things: pass by constant reference, rich variable name (message not msg) and the use of wxEmptyString not wxT(“”).

So, in the header file:

   bool TrackProgress(int whichTrack, double fraction, const wxString & message = wxEmptyString);
 
   // Pass a fraction between 0.0 and 1.0, for the current track group
   // (when doing stereo groups at a time)
   bool TrackGroupProgress(int whichGroup, double fraction, const wxString & message = wxEmptyString);

The source file:

bool Effect::TrackProgress(int whichTrack, double fraction, const wxString & message)
{
   int updateResult = mProgress->Update(whichTrack + fraction, (double) mNumTracks, message);
   return (updateResult != eProgressSuccess);
}

bool Effect::TrackGroupProgress(int whichGroup, double fraction, const wxString & message)
{
   int updateResult = mProgress->Update(whichGroup + fraction, (double) mNumGroups, message);
   return (updateResult != eProgressSuccess);
}