1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-14 16:46:28 +01:00

Fix sync-lock behavior of time shift, don't move too many other tracks

This commit is contained in:
Paul Licameli
2020-09-21 11:28:54 -04:00
parent e3bd5cfa61
commit 3fcda6fc3c

View File

@@ -332,21 +332,27 @@ void ClipMoveState::Init(
while( change ) { while( change ) {
change = false; change = false;
// Iterate over all unfixed intervals in all shifters // Iterate over all unfixed intervals in all tracks
// that do propagation... // that do propagation and are in sync lock groups ...
for ( auto &pair : state.shifters ) { for ( auto &pair : state.shifters ) {
auto &shifter = *pair.second.get(); auto &shifter = *pair.second.get();
if (!shifter.SyncLocks()) if (!shifter.SyncLocks())
continue; continue;
auto &track = shifter.GetTrack(); auto &track = shifter.GetTrack();
auto group = TrackList::SyncLockGroup(&track);
if ( group.size() <= 1 )
continue;
auto &intervals = shifter.MovingIntervals(); auto &intervals = shifter.MovingIntervals();
for (auto &interval : intervals) { for (auto &interval : intervals) {
// ...and tell all other tracks to select that interval... // ...and tell all other tracks in the sync lock group
for ( auto &pair2 : state.shifters ) { // to select that interval...
auto &shifter2 = *pair2.second.get(); for ( auto pTrack2 : group ) {
if (&shifter2.GetTrack() == &track) if (pTrack2 == &track)
continue; continue;
auto &shifter2 = *shifters[pTrack2];
auto size = shifter2.MovingIntervals().size(); auto size = shifter2.MovingIntervals().size();
shifter2.SelectInterval( interval ); shifter2.SelectInterval( interval );
change = change || change = change ||