Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 1399:ba1f0234efa7
Fixes to spectrum axis calculations, + default to starting at bin 1
author | Chris Cannam |
---|---|
date | Wed, 14 Nov 2018 15:47:21 +0000 |
parents | 2df1af7ac752 |
children | 10e768adaee5 |
comparison
equal
deleted
inserted
replaced
1398:f228bee4981c | 1399:ba1f0234efa7 |
---|---|
696 if (name == "Window Type") { | 696 if (name == "Window Type") { |
697 setWindowType(Preferences::getInstance()->getWindowType()); | 697 setWindowType(Preferences::getInstance()->getWindowType()); |
698 return; | 698 return; |
699 } | 699 } |
700 if (name == "Spectrogram Y Smoothing") { | 700 if (name == "Spectrogram Y Smoothing") { |
701 setWindowSize(m_windowSize); | |
702 invalidateRenderers(); | 701 invalidateRenderers(); |
703 invalidateMagnitudes(); | 702 invalidateMagnitudes(); |
704 emit layerParametersChanged(); | 703 emit layerParametersChanged(); |
705 } | 704 } |
706 if (name == "Spectrogram X Smoothing") { | 705 if (name == "Spectrogram X Smoothing") { |
781 | 780 |
782 int | 781 int |
783 SpectrogramLayer::getOversampling() const | 782 SpectrogramLayer::getOversampling() const |
784 { | 783 { |
785 return m_oversampling; | 784 return m_oversampling; |
786 /*!!! | |
787 if (m_binDisplay != BinDisplay::AllBins) { | |
788 return 1; | |
789 } | |
790 | |
791 Preferences::SpectrogramSmoothing smoothing = | |
792 Preferences::getInstance()->getSpectrogramSmoothing(); | |
793 | |
794 if (smoothing == Preferences::NoSpectrogramSmoothing || | |
795 smoothing == Preferences::SpectrogramInterpolated) { | |
796 return 1; | |
797 } | |
798 | |
799 return 4; | |
800 */ | |
801 } | 785 } |
802 | 786 |
803 void | 787 void |
804 SpectrogramLayer::setWindowType(WindowType w) | 788 SpectrogramLayer::setWindowType(WindowType w) |
805 { | 789 { |
1554 } | 1538 } |
1555 | 1539 |
1556 Preferences::SpectrogramSmoothing smoothing = | 1540 Preferences::SpectrogramSmoothing smoothing = |
1557 Preferences::getInstance()->getSpectrogramSmoothing(); | 1541 Preferences::getInstance()->getSpectrogramSmoothing(); |
1558 params.interpolate = | 1542 params.interpolate = |
1559 (smoothing == Preferences::SpectrogramInterpolated || | 1543 (smoothing != Preferences::NoSpectrogramSmoothing); |
1560 smoothing == Preferences::SpectrogramZeroPaddedAndInterpolated); | |
1561 | 1544 |
1562 m_renderers[viewId] = new Colour3DPlotRenderer(sources, params); | 1545 m_renderers[viewId] = new Colour3DPlotRenderer(sources, params); |
1563 | 1546 |
1564 m_crosshairColour = | 1547 m_crosshairColour = |
1565 ColourMapper(m_colourMap, m_colourInverted, 1.f, 255.f) | 1548 ColourMapper(m_colourMap, m_colourInverted, 1.f, 255.f) |