Skip to content

Bug2464 - #673

Merged
JamesCrook merged 36 commits into
audacity:masterfrom
Paul-Licameli:bug2464
Sep 20, 2020
Merged

JamesCrook merged 36 commits into
audacity:masterfrom
Paul-Licameli:bug2464

Conversation

@Paul-Licameli

Copy link
Copy Markdown
Collaborator

Bug 2464 fix

one taking candidate list directly, the others delegating to it.

Some members removed, some in-class initializers.

The special constructor for TimeShift only has extra arguments.  It will go
away.
... in TimeShiftHandle.  They do nothing useful yet, but responsibilities
will shift into them.

TypeSwitch is avoided and the subclasses are defined in appropriate places
for dependency management, thanks to AttachedVirtualFunction.
... 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
... for now redundantly with the older logic.

Also shorten a function name to Init
... Also dependency of TimeShiftHandle on LabelTrack, lately added, is removed
... There is an AttachedVirtualFunction which is a factory for TrackShifter,
and subclasses of it appropriate for different kinds of tracks.

The logic to choose the intervals of tracks that move is replicated in them.
The old logic is not yet removed.

Enough logic is moved into them, so that snapping in TimeShift, and DoClipMove
in ClipMenus.cpp, make no direct special use of classes WaveTrack and WaveClip.

Not yet defining a new subclass for shifting of labels -- that will be the last
step.
... than the one clicked in; and the clip can't fit into the new track, but it
can still slide horizontally within its track.

This eliminates a redundant use of WaveClip::Offset().
... And don't move from the shared pointer argument
... for shifting of clips among tracks

But this (temporarily) breaks the behavior of dragging back to the original
clip without first releasing the mouse
... Also the clips to shift within a WaveTrack are tested all at once, more
simply
... Because LabelTrack, unlike the others, will also need a mouse y coordinate.

The extra information is present when using the time-shift tool but not when
using the items in ClipMenus.
... Implemented non-invasively just with overrides in LabelTrackShifter

Exceeding the bug description: it's also possible to drag just the subset of
labels that fall partly or wholly in the selected region.

I expect details of the new behavior may be debated.
@JamesCrook
JamesCrook merged commit c48b813 into audacity:master Sep 20, 2020
@JamesCrook

Copy link
Copy Markdown
Contributor

Thanks. This is mostly seen/reviewed before. The additional code looks fine, and works fine in preliminary testing. I'm a little wary of the additional repetition of 'OnLabelPermuted' code, but it's OK. I think there's some future work to do on redefining what 'HitTest' really is, since it is becoming more general, and we're seeing a new type switch that follows on from it.

Overall though, delighted to have this bug fixed, with care taken over details such as quantization of position and dragging to other tracks. If it has also made the code cleaner and easier to work with, that's a good outcome too. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants