... use an AttachedVirtualFunction to compute the default view height from
the controls.
This frees LabelTrackControls from cycles.
Also made Track::DoSetHeight non-virtual
... Different classes for the views, vertical rulers, and dragging handles in
the rulers.
Track panel subdivision finds the delegate sub-view of the appropriate kind to
display and interact with, with the help of a new virtual function in TrackView.
Some anticipation of split views of wave tracks too, not implemented yet.
This adds some files, splitting up existing files that collected too much
unrelated functionality, because waveform and spectrogram drawing and
interaction in fact have very little in common.
It was not done to break up old dependency cycles. In fact it leaves the
new SpectrumView and WaveformView in cycles with WaveTrackView. Something
might be done to fix that later.
... by a redefined area subdivision policy in TrackPanel
So the SpectrumView, WaveformView, and associated ruler and handle classes
find real use, while WaveTrackView is really used only for its height and to
supply the delegate, and WaveTrackVRulerControls and WaveTrackVZoomHandle
are not used
There is also some anticipation of multiple track views
Problem:
Currently KeyboardCapture::Capture(this) is called in TrackPanel::OnTrackFocusChange().
So the keyboard handler is not automatically set when the track panel becomes the focus.
Example of a symptom:
A project contains a label track, and is the focus, and type to create a label is enabled.
Move to focus to another window, and then back to the Audacity window.
Type a character. A label is not created.
Fix:
Move the call KeyboardCapture::Capture(this) to TrackPanel::SetFocusedCell(), so that it gets called when the TrackPanel becomes the focus.
My previous fix for this bug, commit 4b437b8, did not work on Mac.
This bug was introduced by my commit b62ed73. This commit was to ensure that when the keyview was the focus, there was always one item selected. This ensures that the focus is indicated visually, and that the Narrator screen reader reads the keyview.
The failed fix, selected an item if necessary when the keyview became the focus.
The current fix reverts b62ed73 and 4b437b8, and ensures that an item is selected each time the items are updated.
... Six files now are in five strongly connected components:
TrackPanel uses
AdornedRulerPanel which uses
ProjectWindow which uses
ProjectAudioManager and Scrubbing (in a small cycle we will leave alone),
and also, ControlToolBar uses ProjectWindow.
This introduces new files for ScrubUI and ProjectStatus and did much cutting
and pasting of code across files. The separation of ControlToolBar
from ProjectAudioManager is especially important.
... this is a remnant of the abandoned experiment that put other buttons in
the ruler besides the pinned play head
See commit 6a3613e8e97da5164da881a179f1b64ac098d472