* Eliminate unneeded back-pointer to project from non-wave Tracks...
... now that DirManager is gone
* Remove unused declarations
* SampleData::mProject was not used
* Correct ProjectFileIO::GetLibraryError
* Remove unnecessary #include directives
!!! THERE WILL NO DOUBT BE BUGS !!!
This is a big one and there's still several things to
complete. Just want to get this in the wild to start
receiving feedback.
One big thing right now is that it will NOT load pre-aup3
files. An importer is on the way for that.
... non-intrusively in the Track suclasses, registering functions instead.
For each abstract factory function (of two), build a table of concrete factory
functions, paralleling the hierarchy of Track subclesses. Dispatch using
runt time type information in the Track objects.
... And Track no longer inherits TrackPanelCell, so be careful to rewrite
some dynamic_casts too to check instead for TrackView. Those casts won't fail
to recompile if not rewritten.
... in anticipation of making views to tracks many-to-one, but then the rulers
should be one-to-one with the views. So go through the view to get the ruler.
The ruler is really a left-hand extension for each view.
This is now the behavior of Zoom Reset, with Max Zoom being given the previous behavior. Shift+Right-Click alternates between the two -- it zooms to all notes, unless it currently is zoomed to all notes in which case it performs a max zoom.
This fixes Bug 2093. It also fixes Bug 1815, by performing the all-notes zoom when importing a track.
This simplifies a bunch of other work -- in particular zooming so that specific notes are visible, and keeping the same notes on screen when resizing the track.
Also included is a fix to YToIPitch to make it use mPitchHeight directly -- this solves some roundoff errors, which previously caused inaccurate results on some zoom levels.
... 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.
... so that we can use Track::SharedPointer without undefined behavior even on
tracks that don't yet belong to any TrackList.
Also fix the return type of function template TrackList::Add and remove some
casts.
... Also rewrote some of the existing event handling so all events from
TrackList are of the same, custom event class, and distinguishing addition
from resizing events, though this distinction is not yet used
... 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.