mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-08 06:03:49 +01:00
Use enum class ProgressResult, don't interconvert with int or bool
This commit is contained in:
@@ -1977,26 +1977,26 @@ void Effect::IncludeNotSelectedPreviewTracks(bool includeNotSelected)
|
||||
|
||||
bool Effect::TotalProgress(double frac)
|
||||
{
|
||||
int updateResult = (mProgress ?
|
||||
auto updateResult = (mProgress ?
|
||||
mProgress->Update(frac) :
|
||||
eProgressSuccess);
|
||||
return (updateResult != eProgressSuccess);
|
||||
ProgressResult::Success);
|
||||
return (updateResult != ProgressResult::Success);
|
||||
}
|
||||
|
||||
bool Effect::TrackProgress(int whichTrack, double frac, const wxString &msg)
|
||||
{
|
||||
int updateResult = (mProgress ?
|
||||
auto updateResult = (mProgress ?
|
||||
mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) :
|
||||
eProgressSuccess);
|
||||
return (updateResult != eProgressSuccess);
|
||||
ProgressResult::Success);
|
||||
return (updateResult != ProgressResult::Success);
|
||||
}
|
||||
|
||||
bool Effect::TrackGroupProgress(int whichGroup, double frac, const wxString &msg)
|
||||
{
|
||||
int updateResult = (mProgress ?
|
||||
auto updateResult = (mProgress ?
|
||||
mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) :
|
||||
eProgressSuccess);
|
||||
return (updateResult != eProgressSuccess);
|
||||
ProgressResult::Success);
|
||||
return (updateResult != ProgressResult::Success);
|
||||
}
|
||||
|
||||
void Effect::GetSamples(
|
||||
@@ -2614,7 +2614,7 @@ void Effect::Preview(bool dryOnly)
|
||||
mT0, t1, options);
|
||||
|
||||
if (token) {
|
||||
int previewing = eProgressSuccess;
|
||||
auto previewing = ProgressResult::Success;
|
||||
// The progress dialog must be deleted before stopping the stream
|
||||
// to allow events to flow to the app during StopStream processing.
|
||||
// The progress dialog blocks these events.
|
||||
@@ -2622,7 +2622,7 @@ void Effect::Preview(bool dryOnly)
|
||||
ProgressDialog progress
|
||||
(GetName(), _("Previewing"), pdlgHideCancelButton);
|
||||
|
||||
while (gAudioIO->IsStreamActive(token) && previewing == eProgressSuccess) {
|
||||
while (gAudioIO->IsStreamActive(token) && previewing == ProgressResult::Success) {
|
||||
::wxMilliSleep(100);
|
||||
previewing = progress.Update(gAudioIO->GetStreamTime() - mT0, t1 - mT0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user