changeset 1503:2c7a480f93ca

Set maximum frequency on FFT model to reduce cache size (experimental)
author Chris Cannam
date Thu, 12 Sep 2019 11:53:40 +0100
parents 62aad7969f8b
children 150d4e561b07
files layer/SpectrogramLayer.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Thu Sep 12 11:53:17 2019 +0100
+++ b/layer/SpectrogramLayer.cpp	Thu Sep 12 11:53:40 2019 +0100
@@ -872,6 +872,10 @@
     invalidateMagnitudes();
     
     m_maxFrequency = mf;
+
+    if (auto fftModel = ModelById::getAs<FFTModel>(m_fftModel)) {
+        fftModel->setMaximumFrequency(m_maxFrequency);
+    }
     
     emit layerParametersChanged();
 }
@@ -1420,6 +1424,8 @@
         return;
     }
 
+    newFFTModel->setMaximumFrequency(getMaxFrequency());
+    
     m_fftModel = ModelById::add(newFFTModel);
 
     bool createWholeCache = false;
@@ -1793,6 +1799,10 @@
 
     m_minFrequency = minf;
     m_maxFrequency = maxf;
+
+    if (auto fftModel = ModelById::getAs<FFTModel>(m_fftModel)) {
+        fftModel->setMaximumFrequency(m_maxFrequency);
+    }
     
     emit layerParametersChanged();