From c16e04c0dd8cf84342808150386cfce236b42232 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 25 Jul 2010 00:58:31 +0200 Subject: [PATCH] Fixed cloning of BB tracks Not sure when it broke but cloning BB tracks erroneously cloned positions of TCOs as well which made the source BB track have two TCOs one upon the other while the destination BB did not have any TCOs at all. The fix is to save the position of the destination TCO before and restore it manually after paste(). --- src/tracks/bb_track.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 96e920efa..c0f6cf05d 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -456,11 +456,21 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) engine::getBBTrackContainer()->createTCOsForBB( dst ); trackContainer::trackList tl = engine::getBBTrackContainer()->tracks(); + // copy TCOs of all tracks from source BB (at bar "src") to destination + // TCOs (which are created if they do not exist yet) for( trackContainer::trackList::iterator it = tl.begin(); it != tl.end(); ++it ) { ( *it )->getTCO( src )->copy(); - ( *it )->getTCO( dst )->paste(); + + trackContentObject * d = ( *it )->getTCO( dst ); + // important: remember position of destination TCO as pasting + // settings from source TCO will also restore the position of + // source TCO + const midiTime pos = d->startPosition(); + d->paste(); + // and move back to where it belongs! + d->movePosition( pos ); } } else