Commit Graph

33 Commits

Author SHA1 Message Date
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
James Crook
c28be778e2 Linty fixes
This commit fixes a number of warnings shown in compilation with MSVC.  No behavioral changes intended.  I did not fix signed/unsigned warnings.
2017-11-07 14:23:30 +00:00
Paul Licameli
75becb03f4 Fix auto-scrolling when dragging edge of existing selection 2017-11-05 10:40:21 -05:00
Paul Licameli
f0de38dec1 Scanned for bad naked new; found none; changed comments, used safenew 2017-07-23 09:35:01 -04:00
Paul Licameli
a9d8da62af Adjust existing sel bound: erase any snap from start position on move 2017-07-21 10:54:43 -04:00
Paul Licameli
59dab5222b Bug1697: Fix selecting with Snap To in effect 2017-07-20 22:21:29 -04:00
Paul Licameli
7f289a9ed9 Revert "Remove unused variable"
This reverts commit 0ca907a1a7.
2017-07-18 16:06:25 -04:00
Paul Licameli
0ca907a1a7 Remove unused variable 2017-07-18 16:03:18 -04:00
Paul Licameli
48889d36f0 Precaution in case a certain assertion fails (I haven't observed it) 2017-07-18 14:10:29 -04:00
Paul Licameli
4925d0a54b Fix cursor changes for selection 2017-07-18 11:10:45 -04:00
Paul Licameli
ed4300fed1 Move status bar message texts out of class ToolsToolBar 2017-07-17 11:39:32 -04:00
Paul Licameli
7a038c9e51 Remove tab key target cycling and snap escape; reimplement for Esc 2017-07-15 20:37:39 -04:00
Paul Licameli
aaed921fd3 Track panel tooltips, including TAB key hint...
... and distinguish snapping or not in Select tool.
2017-07-13 22:46:28 -04:00
Paul Licameli
0ba91ea9a5 Don't make the finger cursor when hovering over the split line...
... which was implemented at commit aa8be0c413

Preview snap lines should make that unnecessary.
2017-07-13 12:29:54 -04:00
Paul Licameli
2150bde578 Implement selection snap lines before click, and TAB to cancel them 2017-07-13 12:29:51 -04:00
Paul Licameli
33c6a77f8c SelectHandle gets snap information in hit test 2017-07-13 12:11:13 -04:00
Paul Licameli
49b04208b3 ChooseBoundary takes separate x and y arguments 2017-07-13 12:11:13 -04:00
Paul Licameli
7903e20143 Rewrite SelectHandle snapping; selection really matches snapped start 2017-07-13 12:11:13 -04:00
Paul Licameli
67282cbb61 SnapManager::Snap returns its results in a struct 2017-07-13 12:11:13 -04:00
Paul Licameli
308d89b0e6 Reuse SelectHandle object during movement, as with other handle types 2017-07-12 13:03:09 -04:00
Paul Licameli
b3d62e2ab6 Simplify by removing class HitTestResult...
... Because all hit tests returned all fields blank, or else, returned a
UIHandle object whose Preview method gives the rest of the information; so
the other fields were redundant.
2017-07-09 07:57:34 -04:00
Paul Licameli
2c1a16f593 Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)

This also fixes bug 1677 by other means and avoids similar problems.

A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.

And the objects will surely be destroyed after drag-release, or ESC key.

For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-09 07:23:28 -04:00
Paul Licameli
d2fbca83b2 All UIHandle::Preview() return same cursors, messages as HitTest...
... except TrackSelectHandle.  Cursor changes to a hand only after button-down.

HitTests give a UIHandle, whenever they also give any cursor or status, even
when it's unsafe to click and drag; Click override is reponsible for cancelling.

SelectHandle::Preview introduces much duplication, but the original in the hit
test will later be deleted.
2017-07-09 06:38:56 -04:00
Paul Licameli
3a8280c562 Distinguish TrackPanelMouseState from TrackPanelMouseEvent...
... Let cell hit tests, and handle preview, know states only, not transitions.

Cell hit tests are passed a mouse state that does not always match the current,
but anticipates the button click to come; usually left, but if the Control
[sic] key on Mac is down, then right.

Thus, pressing and releasing Mac Control in multi-tool switches in and out of
the magnifier cursor.
2017-07-09 06:38:55 -04:00
James Crook
aa8be0c413 Make it easier to start a new selection at a split line.
If you hover exactly above the split line, you now get a pointing hand icon and status message, allowing you to start a selection at the split line more easily.
2017-06-30 13:17:21 +01:00
Paul Licameli
f3e31eca8b Simplify SelectHandle ctor; make frequency snapping functions static 2017-06-28 21:44:19 -04:00
Paul Licameli
6684c7b9b0 More careful use of weak pointers to tracks in UIHandles 2017-06-28 01:46:59 -04:00
Paul Licameli
b0c6a67c33 TrackPanelMouseEvent stores shared_ptr to cell; some handles too...
... those handles that force a simulated button-up when play interrupts drag,
and can assume that pointers to tracks remain nonNULL and part of the current
project state (not the undo history).

Also pass shared_ptr to Track into more hit test routines.
2017-06-28 01:46:56 -04:00
Paul Licameli
708d84ac22 CommonTrackPanelCell::FindTrack returns shared_ptr 2017-06-27 23:09:35 -04:00
Paul Licameli
b3208ab12d Restore status message "Click and drag to select audio" 2017-06-27 22:35:19 -04:00
Paul Licameli
58fea6d520 null check uses of CommonTrackPanelCell::FindTrack 2017-06-26 16:39:14 -04:00
Paul Licameli
fa5a742e22 weak_ptr not events to avoid dangling track pointers in UIHandles 2017-06-25 13:35:15 -04:00
Paul Licameli
770b3b52ef TrackPanel no longer implements the selection tool or MIDI stretch...
This one's big!

Also restores the effect of ctrl-click on label track.

Also adds ESC key handling for the Stretch.
2017-06-15 08:54:59 -04:00