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

Modified Files:
        Benchmark.cpp WaveTrack.cpp 
Log Message:
Avoid splitting a clip on simple paste when EditClipOnMove is on

Index: WaveTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- WaveTrack.cpp       2 Jul 2007 16:21:09 -0000       1.103
+++ WaveTrack.cpp       3 Jul 2007 08:40:38 -0000       1.104
@@ -417,7 +417,7 @@
 
 bool WaveTrack::Paste(double t0, Track *src)
 {
-   bool editClipCanMove = false;
+   bool editClipCanMove = true;
    gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
    
    //printf("paste: entering WaveTrack::Paste\n");
@@ -462,10 +462,24 @@
    // 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) {
-      Track *tmp = NULL;
-      Cut(t0, GetEndTime()+1.0/mRate, &tmp);
-      Paste(t0 + insertDuration, tmp);
-      delete tmp;
+      if (other->GetNumClips() > 1) {
+         // We need to insert multiple clips, so split the current clip and
+         // move everything to the right, then try to paste again
+         Track *tmp = NULL;
+         Cut(t0, GetEndTime()+1.0/mRate, &tmp);
+         Paste(t0 + insertDuration, tmp);
+         delete tmp;
+      } else
+      {
+         // We only need to insert one single clip, so just move all clips
+         // to the right of the paste point out of the way
+         for (it=GetClipIterator(); it; it=it->GetNext())
+         {
+            WaveClip* clip = it->GetData();
+            if (clip->GetStartTime() > t0-(1.0/mRate))
+               clip->Offset(insertDuration);
+         }
+      }
    }
 
    if (other->GetNumClips() == 1)
@@ -584,7 +598,7 @@
    if (t1 < t0)
       return false;
 
-   bool editClipCanMove = false;
+   bool editClipCanMove = true;
    gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
 
    WaveClipList::Node* it;
@@ -1577,7 +1591,7 @@
 bool WaveTrack::ExpandCutLine(double cutLinePosition, double* cutlineStart,
                               double* cutlineEnd)
 {
-   bool editClipCanMove = false;
+   bool editClipCanMove = true;
    gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
 
    // Find clip which contains this cut line   

Index: Benchmark.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Benchmark.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Benchmark.cpp       2 Jul 2007 16:21:09 -0000       1.25
+++ Benchmark.cpp       3 Jul 2007 08:40:38 -0000       1.26
@@ -331,7 +331,7 @@
       return;
    }
 
-   bool editClipCanMove = false;
+   bool editClipCanMove = true;
    gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
    gPrefs->Write(wxT("/GUI/EditClipCanMove"), false);
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to