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

Modified Files:
        Equalization.cpp 
Log Message:
Fix for extra clip lines being inserted


Index: Equalization.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Equalization.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- Equalization.cpp    30 Sep 2009 21:48:52 -0000      1.106
+++ Equalization.cpp    13 Nov 2009 03:17:36 -0000      1.107
@@ -611,6 +611,7 @@
       
       //Find the bits of clips that need replacing
       std::vector<std::pair<double, double> > clipStartEndTimes;
+      std::vector<std::pair<double, double> > clipRealStartEndTimes; //the 
above may be truncated due to a clip being partially selected
       for (WaveClipList::compatibility_iterator it=t->GetClipIterator(); it; 
it=it->GetNext())
       {
          WaveClip *clip;
@@ -624,6 +625,10 @@
             continue;   // clip is not within selection
          if( clipStartT >= startT + lenT )
             continue;   // clip is not within selection
+            
+         //save the actual clip start/end so that we can rejoin them after we 
paste.
+         
clipRealStartEndTimes.push_back(std::pair<double,double>(clipStartT,clipEndT)); 
           
+            
          if( clipStartT < startT )  // does selection cover the whole clip?
             clipStartT = startT; // don't copy all the new clip
          if( clipEndT > startT + lenT )  // does selection cover the whole 
clip?
@@ -643,6 +648,13 @@
          {
             //put the processed audio in
             t->Paste(clipStartEndTimes[i].first,toClipOutput);
+            //if the clip was only partially selected, the Paste will have 
created a split line.  Join is needed to take care of this
+            //This is not true when the selection is fully contained within 
one clip (second half of conditional)
+            if( (clipRealStartEndTimes[i].first  != clipStartEndTimes[i].first 
|| 
+                 clipRealStartEndTimes[i].second != 
clipStartEndTimes[i].second) &&
+                 !(clipRealStartEndTimes[i].first <= startT &&  
+                 clipRealStartEndTimes[i].second >= startT+lenT) )
+               
t->Join(clipRealStartEndTimes[i].first,clipRealStartEndTimes[i].second);
             delete toClipOutput;
          }
       }


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to