... 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.
... instead use the utility make_iterator_range and its index() or contains()
method. This generic utility works with any container defining begin() and
end().
This further lessens dependency on wxWidgets container idioms.
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes
for wxString,
IsEmpty => empty
Clear => clear
Alloc => reserve
for wxArrayString,
Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
It combines the old IdentInterface with the ParamsInterface, providing an identifier and parameters (if needed).
The main purpose of the change is to make the class hierarchy (as viewed via doxygen) much easier to follow.
... This forces a better placement of state variables in the appropriate
classes.
In future perhaps, MenuManager should be splintered into several classes, one
for each of the main toolbar menus.
... A double-height bar can now insert left of two stacked single-height bars.
For instance you can un-dock the Tools toolbar from the default setup, then
drag it back, and now get the same result as you started with.
This revised fix:
- No longer attempts to drive "Default sample rate" from the selection toolbar.
- No longer drives 'Project rate' direct from prefs. It's usual it comes from the project.
- Instead 'Project rate' in the project might change if 'Default sample rate' pref is updated, but ONLY if the project has no tracks.
- When 'Project rate' in the project is updated, that is now always signaled to the selection toolbar. Previously it wasn't.
The Project Rate in the Selection Toolbar and in the Preferences dialog are now the same thing. They ALMOST were before, causing confusion, and this bug.
This means that the fancy mechanism to set 'other' rates in Preferences is moot, since the Selection Toolbar bar does not have that option. 49000 will be overridden by 48000 for example.
... This was motivated by punch and roll recording: it appears most convenient
to pin the head for recording purposes, and drag it near the right, but when
stopping and finding the splice point for the correction, it is better to
scrub unpinned.
... Bug happened only when append-recording by pressing the toolbar button, not
by using a shortcut key; and the blank track did get drawn if you moused over
it or hid and showed the window.
Turns out TrackPanel::ProcessUIHandleResult did the needed update, which was
lacking otherwise. Now TrackList::UpdatePendingTracks is called in another
place.
... All updates of position are done in DoGetRectangle(). Ruler need only
expose one function, DrawOverlays().
Don't redraw indicators twice when dragging (hiding and showing again), making
some flicker. Just do one update.