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().
This commit is contained in:
Tobias Doerffel
2010-07-25 00:58:31 +02:00
parent 7b0b932441
commit c16e04c0dd

View File

@@ -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