0025748: Parallel version of progress indicator
[occt.git] / src / ViewerTest / ViewerTest_ViewerCommands.cxx
index d92d51a..7082f74 100644 (file)
@@ -52,7 +52,8 @@
 #include <Image_AlienPixMap.hxx>
 #include <Image_Diff.hxx>
 #include <Image_VideoRecorder.hxx>
-#include <Message_ProgressSentry.hxx>
+#include <Message_ProgressScope.hxx>
+#include <Message_ProgressRange.hxx>
 #include <NCollection_DataMap.hxx>
 #include <NCollection_List.hxx>
 #include <NCollection_LocalArray.hxx>
@@ -8788,9 +8789,10 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
     // Manage frame-rated animation here
     Standard_Real aPts = aPlayStartTime;
     int64_t aNbFrames = 0;
-    Message_ProgressSentry aPSentry (aProgress, "Video recording, sec", 0, Max (1, Standard_Integer(aPlayDuration / aPlaySpeed)), 1);
+    Message_ProgressScope aPS(Message_ProgressIndicator::Start(aProgress),
+                              "Video recording, sec", Max(1, Standard_Integer(aPlayDuration / aPlaySpeed)));
     Standard_Integer aSecondsProgress = 0;
-    for (; aPts <= anUpperPts && aPSentry.More();)
+    for (; aPts <= anUpperPts && aPS.More();)
     {
       const Standard_Real aRecPts = aPlaySpeed * ((Standard_Real(aRecParams.FpsDen) / Standard_Real(aRecParams.FpsNum)) * Standard_Real(aNbFrames));
       aPts = aPlayStartTime + aRecPts;
@@ -8826,7 +8828,7 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
 
       while (aSecondsProgress < Standard_Integer(aRecPts / aPlaySpeed))
       {
-        aPSentry.Next();
+        aPS.Next();
         ++aSecondsProgress;
       }
     }