Update of /cvsroot/audacity/audacity-src/src/widgets
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15510

Modified Files:
        ProgressDialog.cpp ProgressDialog.h 
Log Message:
fix bug in TimerProgressDialog not updating prog bars (wxGauge)

Index: ProgressDialog.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/ProgressDialog.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ProgressDialog.cpp  8 Jun 2009 08:01:25 -0000       1.18
+++ ProgressDialog.cpp  15 Jul 2009 23:29:29 -0000      1.19
@@ -1414,6 +1414,14 @@
       Show(true);
    }
 
+   int nGaugeValue = (1000 * elapsed) / mDuration; // range = [0,1000]
+   wxASSERT((nGaugeValue >= 0) && (nGaugeValue <= 1000));
+   if (nGaugeValue != mLastValue)
+   {
+      mGauge->SetValue(nGaugeValue);
+      mLastValue = nGaugeValue;
+   }
+
    // Only update if a full second has passed.
    if (now - mLastUpdate > 1000)
    {

Index: ProgressDialog.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/ProgressDialog.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ProgressDialog.h    8 Jun 2009 08:01:25 -0000       1.11
+++ ProgressDialog.h    15 Jul 2009 23:29:29 -0000      1.12
@@ -72,21 +72,19 @@
  protected:
    wxStaticText *mElapsed;
    wxStaticText *mRemaining;
+   wxGauge *mGauge;
 
    wxLongLong_t mStartTime;
    wxLongLong_t mLastUpdate;
+   int mLastValue; // gauge value, range = [0,1000]
 
    bool mCancel;
    bool mStop;
 
  private:
    wxWindow *mHadFocus;
-   wxGauge *mGauge;
    wxStaticText *mMessage;
    wxWindowDisabler *mDisable;
-
-   int mLastValue;
-
    
    DECLARE_EVENT_TABLE();
 };


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to