Update of /cvsroot/audacity/audacity-src/src
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7814

Modified Files:
        Menus.cpp Project.cpp Project.h TrackPanel.cpp 
Log Message:
fix for undo history corruption due to p2 timer record fix


Index: Project.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.h,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- Project.h   30 Dec 2009 15:56:03 -0000      1.176
+++ Project.h   31 Dec 2009 02:16:59 -0000      1.177
@@ -496,6 +496,8 @@
    void SetNormalizedWindowState(wxRect pSizeAndLocation) {  
mNormalizedWindowState = pSizeAndLocation;   }
    wxRect GetNormalizedWindowState() const { return mNormalizedWindowState;   }
 
+   bool IsTimerRecordCancelled(){return mTimerRecordCanceled;}
+   void ResetTimerRecordFlag(){mTimerRecordCanceled=false;}
  private:
 
    int  mAudioIOToken;
@@ -551,6 +553,9 @@
    friend class ScreenshotCommand;
 
    wxRect mNormalizedWindowState;
+   
+   //flag for cancellation of timer record.
+   bool mTimerRecordCanceled;
 
  public:
     DECLARE_EVENT_TABLE()

Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.480
retrieving revision 1.481
diff -u -d -r1.480 -r1.481
--- Project.cpp 30 Dec 2009 15:56:03 -0000      1.480
+++ Project.cpp 31 Dec 2009 02:16:59 -0000      1.481
@@ -758,7 +758,8 @@
      mImportedDependencies(false), 
      mWantSaveCompressed(false),
      mLastEffect(NULL),
-     mLastEffectType(0)
+     mLastEffectType(0),
+     mTimerRecordCanceled(false)
 {
    int widths[] = {-1, 130};
    mStatusBar = CreateStatusBar(2);
@@ -1833,6 +1834,11 @@
             }
          }
          PushState(_("Recorded Audio"), _("Record"));
+         if(IsTimerRecordCancelled())
+         {
+            OnUndo();
+            ResetTimerRecordFlag();
+         }
       }
 
       FixScrollbars();

Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.541
retrieving revision 1.542
diff -u -d -r1.541 -r1.542
--- Menus.cpp   26 Dec 2009 23:32:52 -0000      1.541
+++ Menus.cpp   31 Dec 2009 02:16:59 -0000      1.542
@@ -5004,9 +5004,12 @@
    }
    else if(!dialog.RunWaitDialog())
    {
-      //show th e "wait for start dialog
-      //Possibly cancelled while the recording, so throw out the fresh track.
-      OnUndo();
+      //RunWaitDialog() shows the "wait for start" as well as "recording" 
dialog
+      //if it returned false it means the user cancelled while the recording, 
so throw out the fresh track.
+      //However, we can't undo it here because the PushState() is called in 
TrackPanel::OnTimer(),
+      //which is blocked by this function.
+      //so instead we mark a flag to undo it there.
+      mTimerRecordCanceled = true;
    }
 }
 

Index: TrackPanel.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.cpp,v
retrieving revision 1.482
retrieving revision 1.483
diff -u -d -r1.482 -r1.483
--- TrackPanel.cpp      4 Dec 2009 03:24:59 -0000       1.482
+++ TrackPanel.cpp      31 Dec 2009 02:16:59 -0000      1.483
@@ -931,6 +931,11 @@
             }
          }
          MakeParentPushState(_("Recorded Audio"), _("Record"));
+         if(p->IsTimerRecordCancelled())
+         {
+            p->OnUndo();
+            p->ResetTimerRecordFlag();
+         }
       }
       mRedrawAfterStop = false;
 


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to