mirror of
https://codeberg.org/tenacityteam/tenacity
synced 2025-09-26 16:26:25 +02:00
remove vestigal fisheye code
Signed-off-by: Hailey Somerville <hailey@hails.org>
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user