Update of /cvsroot/audacity/audacity-src/src/effects
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv14276
Modified Files:
Effect.cpp
Log Message:
You can now cancel a long preview...
Index: Effect.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Effect.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- Effect.cpp 28 Mar 2007 06:41:50 -0000 1.40
+++ Effect.cpp 9 Apr 2007 04:02:01 -0000 1.41
@@ -298,7 +298,9 @@
// Effect is already inited; we call Process, End, and then Init
// again, so the state is exactly the way it was before Preview
// was called.
+ GetActiveProject()->ProgressShow(GetEffectName(), GetEffectAction());
Process();
+ GetActiveProject()->ProgressHide();
End();
Init();
@@ -311,24 +313,30 @@
if (mixRight)
playbackTracks.Add(mixRight);
+
// Start audio playing
-
+
int token =
gAudioIO->StartStream(playbackTracks, recordingTracks, NULL,
rate, t0, t1, NULL);
if (token) {
- wxBusyCursor busy;
- ::wxMilliSleep((int)((t1-t0)*1000));
+ bool previewing = true;
- while(gAudioIO->IsStreamActive(token)) {
+ GetActiveProject()->ProgressShow(GetEffectName(), _("Previewing"));
+
+ while (gAudioIO->IsStreamActive(token) && previewing) {
::wxMilliSleep(100);
+ int t = int(1000 * (gAudioIO->GetStreamTime() / t1));
+ previewing = GetActiveProject()->ProgressUpdate(t);
}
gAudioIO->StopStream();
- while(gAudioIO->IsBusy()) {
+ while (gAudioIO->IsBusy()) {
::wxMilliSleep(100);
}
+
+ GetActiveProject()->ProgressHide();
}
else {
wxMessageBox(_("Error while opening sound device. Please check the
output device settings and the project sample rate."),
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs