On Thursday 05 June 2003 08:08 pm, Levi Burton wrote:
> Hello,
>
> Here is a patch that will now paste segments copied from multiple tracks
> into tracks starting from the currently selected track.  I guess to explain
> it better, say I copy segments from tracks 1, 2 and 3 - then select track 5
> and hit paste, the segments will paste to tracks 5, 6 and 7.

I never seem to get these things right the first time.  This patch is better.  
I was toodling around and stumbled onto getMinTrackId().  

Attached is the better, cleaner patch. This patch assumes the first was 
applied.

-- 
Levi Burton
http://www.puresimplicity.net/~ldb/
--- editcommands.cpp	Thu Jun  5 20:40:27 2003
+++ editcommands.cpp.new	Thu Jun  5 20:40:59 2003
@@ -231,7 +231,6 @@
     // to that as they did before
 
     timeT earliestStartTime = 0;
-    int trackOffset = 0;
 
     for (Rosegarden::Clipboard::iterator i = m_clipboard->begin();
 	 i != m_clipboard->end(); ++i) {
@@ -239,7 +238,6 @@
 	if (i == m_clipboard->begin() ||
 	    (*i)->getStartTime() < earliestStartTime) {
 	    earliestStartTime = (*i)->getStartTime();
-            trackOffset = (*i)->getTrack();
 	}
     }
 
@@ -250,8 +248,9 @@
 
 	Segment *segment = new Segment(**i);
 	segment->setStartTime(segment->getStartTime() + offset);
-        segment->setTrack
-            ((m_composition->getSelectedTrack() + segment->getTrack()) - trackOffset);
+        segment->setTrack(m_composition->getSelectedTrack() 
+                          + segment->getTrack() 
+                          - m_composition->getMinTrackId());
         m_composition->addSegment(segment);
 	m_addedSegments.push_back(segment);
     }

Reply via email to