On Friday 06 June 2003 05:08 am, Richard Bown wrote:
[...]
> Yeah, I think this is a great idea.  Don't think it even needs to be
> an option really.

See attached patch for implementation of this.

-- 
Levi Burton
http://www.puresimplicity.net/~ldb/
Index: rosegardengui.cpp
===================================================================
RCS file: /cvsroot/rosegarden/gui/rosegardengui.cpp,v
retrieving revision 1.566
diff -u -w -r1.566 rosegardengui.cpp
--- rosegardengui.cpp	3 Jun 2003 19:25:22 -0000	1.566
+++ rosegardengui.cpp	7 Jun 2003 02:45:13 -0000
@@ -1553,6 +1553,9 @@
     m_doc->getCommandHistory()->addCommand
         (new PasteSegmentsCommand(&m_doc->getComposition(),
                                   m_clipboard, insertionTime));
+
+    // User preference? Update song pointer position on paste
+    m_doc->setPointerPosition(m_doc->getComposition().getPosition());
 }
 
 void RosegardenGUIApp::slotSelectAll()
Index: editcommands.cpp
===================================================================
RCS file: /cvsroot/rosegarden/gui/editcommands.cpp,v
retrieving revision 1.53
diff -u -w -r1.53 editcommands.cpp
--- editcommands.cpp	6 Jun 2003 09:36:04 -0000	1.53
+++ editcommands.cpp	7 Jun 2003 02:45:14 -0000
@@ -52,6 +52,7 @@
 using Rosegarden::Indication;
 using Rosegarden::EventSelection;
 using Rosegarden::SegmentSelection;
+using Rosegarden::TrackId;
 
 using namespace Rosegarden::BaseProperties;
 
@@ -231,6 +232,7 @@
     // to that as they did before
 
     timeT earliestStartTime = 0;
+    timeT latestEndTime = 0;
     int trackOffset = 0;
 
     for (Rosegarden::Clipboard::iterator i = m_clipboard->begin();
@@ -241,6 +243,9 @@
 	    earliestStartTime = (*i)->getStartTime();
             trackOffset = (*i)->getTrack();
 	}
+
+        if ((*i)->getEndTime() > latestEndTime)
+            latestEndTime = (*i)->getEndMarkerTime();
     }
 
     timeT offset = m_pasteTime - earliestStartTime;
@@ -248,7 +253,7 @@
     for (Rosegarden::Clipboard::iterator i = m_clipboard->begin();
 	 i != m_clipboard->end(); ++i) {
 
-        int newTrackId = m_composition->getSelectedTrack() 
+        TrackId newTrackId = m_composition->getSelectedTrack() 
             + (*i)->getTrack()
             - trackOffset;
 
@@ -262,6 +267,11 @@
         m_composition->addSegment(segment);
 	m_addedSegments.push_back(segment);
     }
+
+    // User preference? Update song pointer position on paste
+    m_composition->setPosition(latestEndTime 
+                               + m_pasteTime 
+                               - earliestStartTime);
 }
 
 void

Reply via email to