Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv7163

Modified Files:
        Project.cpp 
Log Message:
Fixing Undo/Redo bug.  Fixed some comments too.


Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.371
retrieving revision 1.372
diff -u -d -r1.371 -r1.372
--- Project.cpp 16 Jul 2008 21:02:46 -0000      1.371
+++ Project.cpp 25 Jul 2008 15:21:13 -0000      1.372
@@ -2007,6 +2007,8 @@
 
 #ifdef EXPERIMENTAL_ONDEMAND
       //check the ODManager to see if we should add the tracks to the 
ODManager.
+      //this flag would have been set in the HandleXML calls from above, if 
there were
+      //OD***Blocks.
       if(ODManager::HasLoadedODFlag())
       {
          Track *tr;
@@ -2833,14 +2835,43 @@
    mTracks->Clear(true);
    TrackListIterator iter(l);
    Track *t = iter.First();
+   bool odUsed = false;
+   ODComputeSummaryTask* computeTask;
+   Track* copyTrack;
+
    while (t) {
       //    printf("Popping track with %d samples\n",
       //           ((WaveTrack *)t)->numSamples);
       //  ((WaveTrack *)t)->Debug();
-      mTracks->Add(t->Duplicate());
+      copyTrack=t->Duplicate();
+      mTracks->Add(copyTrack);
+     
+
+#ifdef EXPERIMENTAL_ONDEMAND
+      //add the track to OD if the manager exists.  later we might do a more 
rigorous check...
+      if (copyTrack->GetKind() == Track::Wave)
+      {
+         //if the ODManager hasn't been initialized, there's no chance this 
track has OD blocks since this
+         //is a "Redo" operation.
+         if(ODManager::IsInstanceCreated())
+         {
+            if(!odUsed)
+            {
+               computeTask=new ODComputeSummaryTask;
+               odUsed=true;
+            }
+            computeTask->AddWaveTrack((WaveTrack*)copyTrack);
+         }
+      }
+#endif
+      
       t = iter.Next();
    }
 
+   //add the task.
+   if(odUsed)
+      ODManager::Instance()->AddNewTask(computeTask);
+
    HandleResize();
 
    UpdateMenus();


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to