Commit Graph

28 Commits

Author SHA1 Message Date
Paul Licameli
14ab93a01f static TrackList::Get()...
... not member function of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli
906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
5ab2faceea MixerBoard listens to TrackList for insert, delete, permute...
... Which is also sufficient to detect undo/redo/rollback

And detects more often than undo state changes, so that if you drag a track
in TrackPanel, the same permutation is seen at once in MixerBoard, even before
button-up
2018-10-27 18:00:52 -04:00
Paul Licameli
fb8b5029e5 Select and Clip Menus 2018-10-24 12:16:33 -04:00
Paul Licameli
ce9f2e2538 Include Menus.h directly, only where needed, not via Project.h 2018-10-16 16:45:26 -04:00
Paul Licameli
5c6fd64a0e TrackList::GetPrev and ::GetNext are private 2018-10-01 10:44:58 -04:00
Paul Licameli
9481587fa8 Move menu handling functions out of class AudacityProject 2018-09-29 12:10:27 -04:00
Paul Licameli
0ec42f3dd2 Fix some English grammar biases...
... Avoid small out-of-context words and phrases in translation catalog that
are then substituted into larger translated phrases with blanks.

(What if my language has declensions?  How do I know the right form to use
for the phrases?)

Instead, give the translators larger in-context phrases to work with, even if
that requires replications of phrases with small variations.
2018-01-02 22:15:33 -05:00
Paul Licameli
7fd78183d2 Remove needless uses of wxString::c_str() in wxString::Format...
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
2018-01-01 20:34:33 -05:00
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
Paul Licameli
8eb64f5f71 Bug1676: correct repaint of rearranged tracks on Linux...
... This little one-line fix is the right thing to do.  I do not understand
deeply enough how Linux repainting events are sequenced differently from
Windows or Mac, but I understand the code history enough to know where the
bug was introduced.

Problem was that full Refresh of TrackPanel used to be done earlier, in our
handlers of custom events emitted by TrackList; but now that handling is
delayed, for good reasons, so it is correct that the UIHandle object
should request the early full refresh explicitly, not relying on TrackList
event handling.

See explanations here http://bugzilla.audacityteam.org/show_bug.cgi?id=1676#c6
2017-08-07 13:57:19 -04:00
Paul Licameli
a9a6f01214 Stop showing the tooltip for track rearrange after button down 2017-07-17 17:34:18 -04:00
Paul Licameli
f3574c6238 build fix 2017-07-17 02:59:11 -04:00
Paul Licameli
77d5a4cfa8 Tooltip for click and drag on TCP 2017-07-17 02:26:41 -04:00
Paul Licameli
fa96dcffb9 Cursor was meant to change to hand only after click on TCP 2017-07-16 22:56:12 -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
d903845a6b Bug 1677 - Residual. Handle ESC during track rearrangement. 2017-07-04 21:21:24 +01:00
James Crook
9ab40113b7 Bug 1677 - Swap two tracks leads to crash on exit. 2017-07-04 11:56:06 +01: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
58fea6d520 null check uses of CommonTrackPanelCell::FindTrack 2017-06-26 16:39:14 -04:00
Paul Licameli
35ce499ce1 Manage TrackControls and TrackVRulerControls by shared_ptr; ...
... they are not singletons; and the back-pointers to their Tracks are weak.
2017-06-26 16:34:10 -04:00
Paul Licameli
703abe87bc TrackPanel no longer implements track selection click or rearrange drag...
... also implement ESC key for the drag
2017-06-15 08:54:57 -04:00