... miscellaneous direct uses of ZoomInfo::zoom to test and set zoom level.
This includes all the remaining assignments to it.
But moving TrackInfo::PositionToTime and TrackInfo::TimeToPosition into
ZoomInfo and using them is needed to eliminate many more uses.
Also #if'd out the unused AudacityProject::OnZoomToggle().
... 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.
... Verified that this works for presses on tool buttons, and keys A, D, F1,
..., F6.
Also fix conditional compilation with EXPERIMENTAL_SCRUBBING_BASIC not defined.
Don't read "/Spectrum/" preferences anywhere but in SpectrumPrefs.cpp.
Don't store global values in TrackArtist.
Possibly some day, there will be other instances of SpectrogramSettings so we
can have independent per-track settings.
... And it resumes if Audacity regains focus.
Actually this fix causes pausing and resuming depending on whether Track Panel
has focus, so clicks in other parts of the Audacity window may also pause the
scrubbing. I hope that is acceptable.
Also has this effect: Generate sound, scroll left, then delete the (sole)
track. Create new track from menu. Formerly, the track did not align 0
to left edge. Now it does.
This removes the TrackInfo's slider "cache".
Originally, the cache would build to the maximum number of tracks you
had created in an Audacity session. So, if you created 128 tracks
and then reduced that to 1, you'd still have 256 sliders, 1 gain and
1 pan per track.
But, the only real thing the cache did was prevent continuous allocations
of sliders since the allocated sliders position and values wer still
being updated nearly with ever interaction since they were redrawn each
time.
In April 2010, the slider cache was changed to reduce its size by
creating a sort of ring buffer based on how many tracks were displayed
and how many tracks were in the project (I guess). Unfortunately, it
didn't really handle large number of tracks and this bug was born.
While trying to find the proper fix for this, I realized that the
cache really wasn't saving anything. Maybe a little when dragging
the thumb, but during normal track redraws and interaction, it really
didn't serve a purpose, other than use additional memory.
So, I've removed the cache and have allocated a single gain and a
single pan slider. As before, their position and value are changed
as needed when drawn and manipulated.
When it is enabled, the project can scroll up to one-half of a screenful
beyond time zero or the maximum track time. I was careful to disable selection
of negative times.
This is motivated by the smooth scrolling scrub. It behaves more sensibly at
the extremes. It can still keep the play indicator centered.
Also removed an unused member of ViewInfo.
Bug 961 - Play cursor broken after double-click scrub play
Bug 962 - Scrubbing gesture during recording places Audacity in scrubbing mode
when recording stops
Bug 937 was a consequence of mouse capture for drag, which no longer happens.
Scrubbing starts with ctrl- (or cmd-) left- (double-) click, after which mouse
movement and shift key and scroll wheel (undepressed) govern scrubbing. No
buttons need be held. Another ctrl/cmd-left click can stop scrubbing, and so
can SPACE or Stop button or other commands that stop normal playback.