From b9b022d87f70a173e3c77183288fadfc0ab3ebf9 Mon Sep 17 00:00:00 2001 From: Hailey Somerville Date: Sun, 29 Jun 2025 20:16:16 +1000 Subject: [PATCH] remove vestigal fisheye code Signed-off-by: Hailey Somerville --- libraries/lib-screen-geometry/ZoomInfo.h | 22 ---------- .../wavetrack/ui/SpectrumView.cpp | 44 +------------------ 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/libraries/lib-screen-geometry/ZoomInfo.h b/libraries/lib-screen-geometry/ZoomInfo.h index 03615aaca..be346eb8d 100644 --- a/libraries/lib-screen-geometry/ZoomInfo.h +++ b/libraries/lib-screen-geometry/ZoomInfo.h @@ -152,28 +152,6 @@ public: // @param origin specifies the pixel position corresponding to time ViewInfo::h. Intervals FindIntervals(int64 width, int64 origin = 0) const; - enum FisheyeState { - HIDDEN, - PINNED, - - NUM_STATES, - }; - FisheyeState GetFisheyeState() const - { return HIDDEN; } // stub - - // Return true if the mouse position is anywhere in the fisheye - // origin specifies the pixel corresponding to time h - bool InFisheye(int64 /*position*/, int64 = 0) const - {return false;} // stub - - // These accessors ignore the fisheye hiding state. - // Inclusive: - int64 GetFisheyeLeftBoundary(int64 = 0) const - {return 0;} // stub - // Exclusive: - int64 GetFisheyeRightBoundary(int64 = 0) const - {return 0;} // stub - int mWidth{ 0 }; int mVRulerWidth{ 36 }; }; diff --git a/src/tracks/playabletrack/wavetrack/ui/SpectrumView.cpp b/src/tracks/playabletrack/wavetrack/ui/SpectrumView.cpp index 65537a21e..30c8ed7de 100644 --- a/src/tracks/playabletrack/wavetrack/ui/SpectrumView.cpp +++ b/src/tracks/playabletrack/wavetrack/ui/SpectrumView.cpp @@ -664,39 +664,11 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context, : settings.findBin( sqrt(freqLo * freqHi), binUnit ); const bool isSpectral = settings.SpectralSelectionEnabled(); - const bool hidden = (ZoomInfo::HIDDEN == zoomInfo.GetFisheyeState()); - const int begin = hidden - ? 0 - : std::max(0, (int)(zoomInfo.GetFisheyeLeftBoundary(-leftOffset))); - const int end = hidden - ? 0 - : std::min(mid.width, (int)(zoomInfo.GetFisheyeRightBoundary(-leftOffset))); - const size_t numPixels = std::max(0, end - begin); - - SpecCache specCache; - - // need explicit resize since specCache.where[] accessed before Populate() - specCache.Resize(numPixels, settings, -1, t0); - - if (numPixels > 0) { - for (int ii = begin; ii < end; ++ii) { - const double time = zoomInfo.PositionToTime(ii, -leftOffset) - playStartTime; - specCache.where[ii - begin] = - sampleCount(0.5 + sampleRate / stretchRatio * time); - } - specCache.Populate( - settings, clip, 0, 0, numPixels, - 0 // FIXME: PRL -- make reassignment work with fisheye - ); - } // build color gradient tables (not thread safe) if (!AColor::gradient_inited) AColor::PreComputeGradient(); - // left pixel column of the fisheye - int fisheyeLeft = zoomInfo.GetFisheyeLeftBoundary(-leftOffset); - // Bug 2389 - always draw at least one pixel of selection. int selectedX = zoomInfo.TimeToPosition(selectedRegion.t0(), -leftOffset); @@ -738,18 +710,6 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context, for (int xx = 0; xx < mid.width; ++xx) { int correctedX = xx + leftOffset - hiddenLeftOffset; - // in fisheye mode the time scale has changed, so the row values aren't cached - // in the loop above, and must be fetched from fft cache - float* uncached; - if (!zoomInfo.InFisheye(xx, -leftOffset)) { - uncached = 0; - } - else { - int specIndex = (xx - fisheyeLeft) * nBins; - wxASSERT(specIndex >= 0 && specIndex < (int)specCache.freq.size()); - uncached = &specCache.freq[specIndex]; - } - // zoomInfo must be queried for each column since with fisheye enabled // time between columns is variable const auto w0 = sampleCount( @@ -815,9 +775,7 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context, selected = AColor::ColorGradientTimeAndFrequencySelected; } - const float value = uncached - ? findValue(uncached, bin, nextBin, nBins, autocorrelation, gain, range) - : specPxCache->values[correctedX * hiddenMid.height + yy]; + const float value = specPxCache->values[correctedX * hiddenMid.height + yy]; unsigned char rv, gv, bv; GetColorGradient(value, selected, colorScheme, &rv, &gv, &bv);