mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-02 06:08:44 +01:00
Choose track or clip shifting behavior without a TypeSwitch...
... Preserving existing behavior, but maybe these cases should be reconsidered and made more uniform. (e.g. should hit test on NoteTrack sometimes miss, as with WaveTrack?) Also made details of WaveTrack hit testing consistent with what ClipMenus does
This commit is contained in:
@@ -1312,6 +1312,23 @@ public:
|
||||
~WaveTrackShifter() override {}
|
||||
Track &GetTrack() const override { return *mpTrack; }
|
||||
|
||||
HitTestResult HitTest( double time ) override
|
||||
{
|
||||
auto pClip = mpTrack->GetClipAtTime( time );
|
||||
|
||||
if (!pClip)
|
||||
return HitTestResult::Miss;
|
||||
|
||||
// Make a side-effect on our intervals
|
||||
UnfixIntervals( [&](const auto &interval){
|
||||
return
|
||||
static_cast<WaveTrack::IntervalData*>(interval.Extra())
|
||||
->GetClip().get() == pClip;
|
||||
} );
|
||||
|
||||
return HitTestResult::Intervals;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<WaveTrack> mpTrack;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user