1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

Fix for bug #869

This commit is contained in:
Leland Lucius 2015-05-27 08:50:00 -05:00
parent 0d62be7776
commit 19acf89d2a

View File

@ -2522,21 +2522,24 @@ void Effect::Preview(bool dryOnly)
if (token) { if (token) {
int previewing = eProgressSuccess; int previewing = eProgressSuccess;
mProgress = new ProgressDialog(GetName(), // The progress dialog must be deleted before stopping the stream
_("Previewing"), pdlgHideCancelButton); // to allow events to flow to the app during StopStream processing.
// The progress dialog blocks these events.
ProgressDialog *progress =
new ProgressDialog(GetName(), _("Previewing"), pdlgHideCancelButton);
while (gAudioIO->IsStreamActive(token) && previewing == eProgressSuccess) { while (gAudioIO->IsStreamActive(token) && previewing == eProgressSuccess) {
::wxMilliSleep(100); ::wxMilliSleep(100);
previewing = mProgress->Update(gAudioIO->GetStreamTime() - mT0, mT1); previewing = progress->Update(gAudioIO->GetStreamTime() - mT0, mT1);
} }
delete progress;
gAudioIO->StopStream(); gAudioIO->StopStream();
while (gAudioIO->IsBusy()) { while (gAudioIO->IsBusy()) {
::wxMilliSleep(100); ::wxMilliSleep(100);
} }
delete mProgress;
mProgress = NULL;
} }
else { else {
wxMessageBox(_("Error while opening sound device. Please check the playback device settings and the project sample rate."), wxMessageBox(_("Error while opening sound device. Please check the playback device settings and the project sample rate."),