diff layer/Colour3DPlotRenderer.cpp @ 1103:d84a0033b305 spectrogram-minor-refactor

Turn BinDisplay and BinScale into enum classes
author Chris Cannam
date Thu, 14 Jul 2016 15:13:37 +0100
parents 102f986ec032
children ea5ae9dd10ba
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.cpp	Wed Jul 13 13:44:11 2016 +0100
+++ b/layer/Colour3DPlotRenderer.cpp	Thu Jul 14 15:13:37 2016 +0100
@@ -175,7 +175,7 @@
     // well as horizontal. That's why this function didn't take any
     // y/height parameters.
 
-    if (bufferIsBinResolution && (m_params.binDisplay != PeakFrequencies)) {
+    if (bufferIsBinResolution && (m_params.binDisplay != BinDisplay::PeakFrequencies)) {
         renderToCacheBinResolution(v, x0, x1 - x0);
     } else {
         renderToCachePixelResolution(v, x0, x1 - x0, rightToLeft, timeConstrained);
@@ -281,7 +281,7 @@
 
     int attainedWidth;
 
-    if (m_params.binDisplay == PeakFrequencies) {
+    if (m_params.binDisplay == BinDisplay::PeakFrequencies) {
         attainedWidth = renderDrawBufferPeakFrequencies(v,
                                                         repaintWidth,
                                                         h,
@@ -547,7 +547,7 @@
                     column = ColumnOp::normalize(column, m_params.normalization);
 //                }
 
-                if (m_params.binDisplay == PeakBins) {
+                if (m_params.binDisplay == BinDisplay::PeakBins) {
                     column = ColumnOp::peakPick(column);
                 }
 
@@ -636,7 +636,7 @@
     double minFreq = (double(minbin) * fft->getSampleRate()) / fft->getFFTSize();
     double maxFreq = (double(maxbin) * fft->getSampleRate()) / fft->getFFTSize();
 
-    bool logarithmic = (m_params.binScale == LogBinScale);
+    bool logarithmic = (m_params.binScale == BinScale::Log);
     
     for (int x = start; x != finish; x += step) {