# HG changeset patch # User Chris Cannam # Date 1568285620 -3600 # Node ID 2c7a480f93ca2cb2914ba24fd1aca4e25eb8d17d # Parent 62aad7969f8b838d1084ab383b5b5c1945fcc180 Set maximum frequency on FFT model to reduce cache size (experimental) diff -r 62aad7969f8b -r 2c7a480f93ca layer/SpectrogramLayer.cpp --- 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(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(m_fftModel)) { + fftModel->setMaximumFrequency(m_maxFrequency); + } emit layerParametersChanged();