... 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.
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types
(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
Rather than 'cut' (i.e. drop, not cut as in 'cut preview') channels immediately, we now only do so
if their last gain was already 0.0. Instead they micro-fade out. Later when the channels come back,
their last gain will be 0.0, so they will micro-fade in.
A comment explains that the code would be cleaner if we just computed gains, and not whether to
drop channels.
... Maybe a good feature idea, but the implementation pollutes the code in
too many places.
It's a special case of the more general idea of many-to-one associations
between screen rectangles and track objects. More generalized ways to
accommodate that should be sought.
... This even makes it possible to remove the prohibition of undo and redo
during transport, not that we want to though. Playback and recording will
continue, using track objects that might not be in the current project.
Added preferences for Zoom-Toggle and put into menus.
New helper functions for determining zoom scaling.
Optional EXPERIMENTAL_ZOOM_TOGGLE_BUTTON added, and Light theme updated.
Not enabled for 2.2.2.
1: Guard zone 8 pixels wide in VRuler to reduce risk of accidental use.
2: VerticalZooming preference, for VRuler zooming, off by default,
3: Enabled Paul's right-click menu in VRuler with some extra
presets (x2 and x0.5)
4: Rearranged some messy code with lots of ifs to use a switch.
Also, with EXPERIMENTAL_HALF_WAVE defined we now get a
'half wave' option in the VRuler menu, that shows the wave top half.
We also use it in collapsed waves (and collapsing and restoring
a WaveTrack will get you back to normal zoom.
These basics add a colour index to each clip and track, and allow for a choice of four colours to be set from the track menu drop down. The additional wave colours (red, green and black) are not currently configurable, and the colour index is not currently saved.
Fixed by giving some tolerance in how the dragged clip(s) are placed.
The tolerance is 1px, so it depends on the zoom. Therefore if zoomed in your positioning is more precise.
... 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.)
... So that even if the time is "slightly" (less than 1/2 sample interval) left
of the discontinuity, the right-hand limit is always used.
Thus this compensates for some roundoff errors when pasting one clip with
an envelope into another.
This overcomes the objections that were in a comment in Envelope::Paste
to making control points with exactly equal times.
And therefore Paste can be rewritten to do so, but that has not happened yet.
Envelope points at exactly equal time coordinates can already be made by
dragging points in the envelope editor.
Clip Left
Clip Right
If the cursor lies within a clip, the clip and the cursor is moved 1 pixel left/right.
If the cursor position is at both a clip end and a clip start, the second of these clips is moved.
The movement currently ignores the snap to setting on the selection bar, and there is no snapping to the clip boundaries of other clips.
Following the behaviour or shifting with the mouse, the distance moved is rounded to an integral number of samples, and the minimum distance moved is one sample.
... 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.
... This is done with Shift+Ctrl+wheel and pointer in the vertical ruler, and
the pointer y coordinate near the bottom of the dB scale.
If y coordinate is far from there, then Shift+Ctrl+wheel changes dB level
without change of magnification (as before this commit).
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
... 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.
... When you click in a stereo clip, move the correct partner clip with it.
When you click in the selection and it spans clips, move all clips containing
any part of the selection. (As horizontal dragging does.) Even if these are
not all within the same stereo track.
I implemented this rule: If any clip moves up (or down) by n audio tracks
(not counting the label tracks), all clips must move the same number, and
all must move from mono to mono or left to left or right to right. If that
is not possible, no move happens.
... also make WaveTrack responsible for storing and validating the bounds
... also let the bounds vary per-track even though other settings are default
... also change some code names to mention "period" not "undertone"
... Also removed one line from the track control drop-down, and changed
accelerators to more mnemonic choices.
Also the open page of View Settings... determines track view type after OK
... SpectrogramSettings does that instead, and Preferences or View Settings
are the user interface for changing it.
Handle invalidation of spectrogram pixel cache for scale type changes,
just as for other changes of settings. No more
TrackArtist::InvalidateSpectrumCache().
View type of track now switches to Spectrum when applying or OKing the
View Settings... dialog and the Spectrogram page is open (and for now
it is still the only page)
... With a careful sweep of uses of WaveTrack::GetDisplay() to remove
assumptions about the ordering of the values.
Using < and <= on enum values is mostly a bad idea.