... Make consistent zoom in and out limits for mouse picks and for scrollwheel
Make scrollwheel do in or out by a constant multiplier, analogously with wave
track
The Note track remembers a continuously varying key height, but rounds it off
whenever it draws
PRL mentioned a while ago that it was possible to get channels greater
than 16 via allegro files. This makes those channels correctly work with
the CHANNEL_BIT macro (which was supposed to handle them this way before).
The fields in AudioIO are simply unneeded (commented out, declared but never implemented, or otherwise unused).
mLastMidiPosition (in NoteTrack) looks like the vestiges of a far older attempt at MIDI playback; the field itself is completely unused though so it is safe to remove it.
... 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.
... 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.
... 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.
Zoom tool takes precedence;
Otherwise do special hits appropriate to the track subclass -- and only
WaveTrack here uses Tools toolbar state, and now disallows clicks on things
when they are not drawn because the view is spectrogram;
Finally, default to right button zooming in Multi tool, or to time shift in
that tool, or to selection adjustment in Multi or in Select tool.
...no actions reimplemented to them yet.
Later commits will move special cases one at a time from TrackPanel, preserving
all click and drag capabilities at each step. With a few exceptions, but those
lost abilities are restored in yet later commits. (Ctrl+Click on the Label
track being one.)
Simplify the logic of duplication of NoteTrack. Duplicates are always in
serialized state. Un-serialization can happen on demand in any of the
NoteTrack operations that require a defined sequence.
Changing the duration of the sequence after paste is needed,
as it was also needed, when I fixed Stretch at commit
90eb4ec142f7d575d0870dd9c755589bff520cbe. I don't know if this should be
considered a bug in Allegro that we are compensating.
This reintroduces the buttons to toggle display of individual midi
channels, and cleans up the code behind that feature.
This functionality has actually been present in production versions of
audacity for a while, at least for clicking. However, the buttons
themselves were not drawn, making it exteremly painful (but possible) to
use.
As requested by PRL, this is always enabled if USE_MIDI is defined.
This gets rid of the offset rectangle hack that was needed to re-use gain
sliders for note track velocities. It also removes the need for changing
the style of a single slider. Perhaps most importantly, it fixes link
errors regarding GainSlider(int).
See https://sourceforge.net/p/audacity/mailman/message/35752524/ for
details on why this change is needed and what caused it.
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.
It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change. No matter now.
"Velocity" is the technical term, and it's the term that's used everywhere.
"Gain" was probably only used because "gain" is used on wave tracks; since
note tracks aren't wave tracks (and shouldn't be treated as them) the
corresponding variables should be named velocity.
The compilation was broken in 67cec5a but fixed in ed8c7fd. However, the warnings weren't fixed. The same general sign-related changes from 67cec5a were applied, fixing several warnings.
This also changes the arguments for NoteTrack's label click handler, to match the ones found in TrackPanel. That's needed to handle some other const-related changes.
Additionally, EXPERIMENTAL_MIDI_PLAYBACK was changed to EXPERIMENTAL_MIDI_OUT in the documentation, as that is the correct name.
... for functions in final classes.
override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.
There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls. Mostly useful as documentation of design intent.
Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
Create WaveTrackCache as a utility class but don't use it anywhere yet.
The possible minor performance problem with effects is fixed by changes
in WaveTrack::GetBestBlockSize().