... in many places where the function call will later need to be between
modules (or libraries, or the executable) and the annotation will be a necessity
to keep the linkage working on Windows.
That's all that this sweeping commit does.
... Breaking dependency of ProjectFileIO on on TimeTrack, and reusing the same
functions that implement cross-document copy and paste of tracks.
Also changing behavior, so that if a TimeTrack exists but another is imported,
then the import quietly replaces the existing completely.
* Don't need TrackFactory to make LabelTrack
* Don't need TrackFactory to make NoteTrack
* Don't need TrackFactory to make TimeTrack, or ZoomInfo in the factory
* Remove some forward declarations
* Rename TrackFactory as WaveTrackFactory, move it out of Track.cpp
* 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.
... confusingly, Envelope already carried its own limiting values, but those
in the TimeTrack were not guaranteed to be the same.
I'm just preserving behavior as I break file dependencies and won't try to fix
that confusion now.
... 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.)
... 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.
... 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.
... and SelectedRegion, and not ViewInfo or zoom level as a double.
Also some leftOffset arguments.
Assumptions of uniform zoom level persist in TrackArtist::DrawClipSpectrum and
in TrackArtist::DrawClipWaveform but no longer in the rest.
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().