Fix bug 6725 regions incorrectly moved after tempo change when glued to BBT time

Playlist::_split_region copies the region and BBT_Time member is default
constructed so position is bar 1 beat 1.

The regions sample position is then initialized to the new position using the
property list.

Playlist::add_region_internal is then used to add new regions to the playlist
which calls region->set_position() but as the region position has already been
initialized it does not recompute the _bbt_time member based on the new sample
position.

Then when a tempo change occurs and Region::update_after_tempo_map_change is
called the default initialized _bbt_time member is used to incorrectly
determine the new sample position.

So the change removes the initialization of the new region position using the
property list initialization method and just lets the playlist set the position
of the region in Playlist::add_region_internal so that the region _bbt_time
member is recomputed in Region::set_position_internal.
This commit is contained in:
Tim Mayberry 2016-01-06 23:36:33 +10:00
parent ed8c88d697
commit 9a52cefd13

View File

@ -1408,7 +1408,6 @@ Playlist::duplicate_until (boost::shared_ptr<Region> region, framepos_t position
{
PropertyList plist;
plist.add (Properties::position, region->position ());
plist.add (Properties::length, before);
plist.add (Properties::name, before_name);
plist.add (Properties::left_of_split, true);
@ -1427,7 +1426,6 @@ Playlist::duplicate_until (boost::shared_ptr<Region> region, framepos_t position
{
PropertyList plist;
plist.add (Properties::position, region->position() + before);
plist.add (Properties::length, after);
plist.add (Properties::name, after_name);
plist.add (Properties::right_of_split, true);