- There are two new commands: Scrub Backwards and Scrub Forwards.
- These commands appear on the Transport sub menu of the Extra menu.
- The commands have default shortcuts U and I, and are in the standard default set.
- After pressing one of the two keys, playback continues until the key is released. (Note that this means that the command on the Extra > Transport menu can't actually be used for scrubbing as it executes a KeyDown immediately followed by a KeyUp, but the menu items are needed so that the current keystrokes can be seen and changed.)
- Playback starts from the cursor position, or the start of a time selection if there is one.
- The speed of playback is determined by the zoom level. If the zoom level is normal, then the playback speed is one quarter of the normal playback speed. Zooming in (Ctrl + 1), halves the playback speed, and zooming out (Ctrl + 3) doubles the playback speed. There are minimum and maximum playback speeds of one sixteenth, and four respectively.
- You can scrub to the end of the audio, even if there is an initial selection. In other words, scrubbing forwards does not automatically stop at the end of the selection.
- Normally, when one of the keys is released, the position of the cursor is set to the time when the key was released.
- If during the time one of the keys is pressed the left bracket and or right bracket keys are pressed to set the start and/or end of the selection, then when the scrubbing key is released, the change to the selection made by pressing the bracket keys is preserved - the position of the cursor is not set to the time when the key was released.
This implementation is affected by two existing bugs:
1. Bug 1954 - Clicks may occur starting/pausing play-at-speed or Scrub. (See comment 19 and attached image).
2. Bug 1956 - Windows: MME and WDS playback cursor is buffer length ahead of actual audio playing. This means that on Windows, WASAPI is preferable if scrubbing is being used for the accurate positioning of the cursor.
... in cases of "TranslatableString" that are not really translated.
This makes it easier to scan the code for such unusual constructions of
TranslatableString, distinct from mere mentions of the TranslatableString type.
... and deduce whether to exclude from macros inside NewIdentifier, simplifying
argument lists further
Also fix the localization of "..." added to names by PluginMenus.cpp
... include it in the msgid intead, to get appropriate translations. For
instance some locales use the same character but prefer to insert a space
before it.
Bug began at 0750f62e88
Track::SetSelected is virtual, after all, but then LabelTrack informs
LabelTrackView of selection changes by events, so that LabelTrack remains
independent of LabelTrackView.
This might make much of the rest of the guily commit unnecessary (the resetting
of selected index to -1 only lazily), but it is harmless.
Steps to reproduce:
1. create a new project in Audacity
2. add several tracks.
3. turn on Sync-Lock (Tracks, Sync-Lock Tracks checked)
4. Click on the Time Shift Tool.
5. Attempt to move tracks to the right (for example), clicking in the bottom track
6. It crashes.
In the function: void TimeShiftHandle::CreateListOfCapturedClips(), the problem was the first occurrence of the line:
auto &trackClip = state.capturedClipArray[i];
The subsequent call to AddClipsToCaptured(), can reallocate the array and so invalidate the reference.
Fix: Don't use a reference. (TrackClip is not a large object.)
... and much generality for the future in reporting the sub-view division to
TrackPanel.
SetDisplay will have the effect of making one of possibly multiple views take
up all the height. Where we need to save and restore or otherwise copy the
sub-views, there is more information now than just one enum value.
... use an AttachedVirtualFunction to compute the default view height from
the controls.
This frees LabelTrackControls from cycles.
Also made Track::DoSetHeight non-virtual
... 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
... which was redundant with what happens in the yield to idle events in
ProjectAudioManager::Stop.
This removes direct dependency of ProjectAudioManager on ControlToolBar.
And remove another #include we don't need
... in places that need the TrackPanel but only to invoke common wxWindow
methods on it.
This eliminates direct use of TrackPanel by Scrubbing and ProjectWindow
ControlToolBar, after we make a system to register functions that calculate
necessary minimum widths for status bar fields.
Also let Scrubbing.cpp register its own strings.
Also be sure to size the status field sufficiently for "Playing at Speed".
... Let the window respond to an undo manager event instead, whenever there
is a push or modify
Maybe this makes a few unnecessary redraws that did not happen before. If
that is important, then we should figure out how to put the logic for eliding
the redraw into ProjectWindow, and the extra information needed for the
decision into the events, but not make intrusions in other code all over the
place.
... so most calls to ControlToolBar::SetPlay are removed. One remains in
TransportMenus, which will not be problematic for untangling dependencies,
and one remains where the toolbar remakes its own buttons.
But the routines that start and stop the streams, importantly, don't use it.
... Move that into ProjectAudioManager instead, and update the button, only to
reflect it, in idle time.
However, AudioIO also has its mPaused member variable, and it is not obvious
that it was always kept the same as the button state. No attempt was made
here to identify and fix any bugs, but only to preserve behavior.
... TrackPanelAx now sends an event to the project when track focus changes,
and TrackPanel listens for it.
TrackPanel also initializes TrackPanelAx with a callback to do the details of
rectangle calculation.
... not the best thing for the long term, but hidden dependencies on
TransportMenus.cpp are eliminated
Tying CommonCommandFlags again into the big component, which is now 26
... though in a small cycle with each other, by moving RealtimeEffectManager to
new files, which remain in the big component.
Net loss of 1, the big component now has 27 files
... Breaking up an s.c.c. of 6 into 3 components:
ODManager, ODTask, ODWaveTrackTaskQueue
UndoManager
WaveClip, WaveTrack
Rewrite the OD tasks and queues to hold weak pointers to tracks, so the
track destructor need not notify them.
... It is const, renamed CopyTo, and invokes the create-on-demand factory in
the destination track; this means Track.cpp doesn't need to do that, and so
does not need TrackView.h
... because we undo the move,
"Demote vertical zooming code into WaveTrack.cpp ..." done at 1f4bf26
That was done so that WaveTrack would not depend on WaveTrackVZoomHandle, but
made it instead depend on ProjectHistory, which is undesirable.
But since then, commit 3797a52 moved the special minimizing code for WaveTrack
into WaveTrackView.
... 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 LabelTrack listens to its own events, to update certain state.
This is roundabout for now, but that state is view-related and will move into
another class.
... which will simplify later rewrites that associate selection state with
the track group, not the track.
Since LabelTrack isn't notified immediately of selection changes, instead it
always tests whether it is selected, before using the stored selected label
index.
... eliminating some duplication in tables for Wave and Note track controls,
and freeing PlayableTrackButtonHandles from the big s.c.c, though in a cycle
yet with PlayableTrackControls
... and updating of them is accomplished privately in implementation files,
reducing intrusions into TrackPanel and ProjectWindow
This removes #include-s from TrackInfo.cpp, leaving dependency cycles better
than previously
... and eliminate some unnecessary calls to SubstitutePendingChangedTrack,
because the track and the substitute store Y and height in their shared
TrackView object.
Also make GetMinimizedHeight() virtual to avoid inclusion of TrackPanel.h in
TrackView.cpp.
... 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.
... but it does nothing yet.
This will be important to preserve undo/redo behavior of view changes, when
view state is moved out of the proper Track objects.
... 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.
... and use std::enable_shared_from_this
Temporarily putting TrackControls.cpp back into the big s.c.c, now 59 files
Future rewriting might even eliminate all mention of those classes in
the definition of the Track classes.
... Mostly into CommonCommandFlags.cpp, but some elsewhere, to avoid giving
that new file problematic dependencies on LabelTrack, ControlToolBar, and
EffectManager.
Note that CutCopyAvailableFlag is critically ordered, for message purposes,
only with AudioIONotAvailableFlag, the only flag with a message that it combines
with in menu item definitions.
The dependency on LabelTrack.cpp might not be a bad one later, if the track and
its view can be separated, and that would allow CutCopyAvailableFlag to be
put with the others. But much other work on LabelTrack must happen first.
... to break some dependency cycles. Install a callback at initialization time.
This frees CommonTrackPanelCell from cycles, which is important because it is
a base class of Track
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).
AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.
It won't include StartStream. It will contain functions to query the
present state of streams, and device capabilities.
... that is, a factory function, open, close, import, undo/redo/rollback.
Also the callbacks from AudioIO, which need to invoke undo history push when
recording stops.
It is meant as a high-level class using several of the other things attached
to the project, while AudacityProject will be a low level class acting mostly
as just the container of the attached structures.
... as a preparation for splitting up class AudacityProject.
Use ProjectWindow as an alias for AudacityProject, and fetch it from the
project with a static member function, where certain of its services are used;
pretending they are not the same class.
Use global accessor functions to get wxFrame from the project where only
wxFrame's member functions are needed, so there will be less dependency on
ProjectWindow when it becomes a distinct class.
... not member functions of AudacityProject.
AdornedRulerPanel is not (yet) made similarly independent of its overlay
code.
Two .cpp files implementing overlays escape dependency cycles to higher levels.
... Unnecessary because transitively included.
But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
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 doesn't need to trigger an autosave (which is what passing true would do), but the state should still be modified.
Unfortunately this doesn't seem to enable saving -- probably because no undo state is being pushed. That's something to consider for the future.
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.