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

Modified Files:
        WaveTrack.cpp 
Log Message:
Fixed pasting multiple clips into the middle of an existing clip

Index: WaveTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- WaveTrack.cpp       26 Jan 2007 11:06:14 -0000      1.95
+++ WaveTrack.cpp       21 Feb 2007 08:10:28 -0000      1.96
@@ -454,17 +454,10 @@
    // Make room for the pasted data, unless the space being pasted in is empty 
of
    // any clips
    if (!IsEmpty(t0, t0+insertDuration-1.0/mRate) && editClipCanMove) {
-
-      for (it=GetClipIterator(); it; it=it->GetNext())
-      {
-         WaveClip* clip = it->GetData();
-
-         //printf("paste: offsetting already existing clip %i by %f seconds\n",
-         //(int)clip, insertDuration);
-
-         if (clip->GetStartTime() > t0-(1.0/mRate))
-            clip->Offset(insertDuration);
-      }
+      Track *tmp = NULL;
+      Cut(t0, GetEndTime()+1.0/mRate, &tmp);
+      Paste(t0 + insertDuration, tmp);
+      delete tmp;
    }
 
    if (other->GetNumClips() == 1)
@@ -534,7 +527,7 @@
 
    // Insert new clips
    //printf("paste: multi clip mode!\n");
-   
+
    if (!editClipCanMove && !IsEmpty(t0, t0+insertDuration-1.0/mRate))
    {
       wxMessageBox(
@@ -542,7 +535,7 @@
          _("Error"), wxICON_STOP);
       return false;
    }
-   
+
    for (it=other->GetClipIterator(); it; it=it->GetNext())
    {
       WaveClip* clip = it->GetData();


-------------------------------------------------------------------------
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

Reply via email to