1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Clip Left/Right general enough for note tracks: one less TypeSwitch!

This commit is contained in:
Paul Licameli 2020-09-13 23:06:46 -04:00
parent 958cb1b4fd
commit 2b06115b32

View File

@ -633,8 +633,7 @@ double DoClipMove
{ {
auto &selectedRegion = viewInfo.selectedRegion; auto &selectedRegion = viewInfo.selectedRegion;
// just dealing with clips in wave tracks for the moment. Note tracks?? if (track) {
if (track) return track->TypeSwitch<double>( [&]( WaveTrack *wt ) {
ClipMoveState state; ClipMoveState state;
auto t0 = selectedRegion.t0(); auto t0 = selectedRegion.t0();
@ -642,8 +641,8 @@ double DoClipMove
std::unique_ptr<TrackShifter> uShifter; std::unique_ptr<TrackShifter> uShifter;
// Find the first channel that has a clip at time t0 // Find the first channel that has a clip at time t0
for (auto channel : TrackList::Channels(wt) ) { for (auto channel : TrackList::Channels(track) ) {
uShifter = MakeTrackShifter::Call( *wt ); uShifter = MakeTrackShifter::Call( *track );
if( uShifter->HitTest( t0 ) == TrackShifter::HitTestResult::Miss ) if( uShifter->HitTest( t0 ) == TrackShifter::HitTestResult::Miss )
uShifter.reset(); uShifter.reset();
else else
@ -680,7 +679,7 @@ double DoClipMove
} }
return hSlideAmount; return hSlideAmount;
} ); };
return 0.0; return 0.0;
} }