comparison layer/SpectrumLayer.cpp @ 290:3101c68a00c1

* Restore Scale setting which had mistakenly disappeared from spectrum * Some tweaks to spectrum peaks * Make spectrum default to 4096/75%... or is that overdoing it? * Show harmonic cursor even during playback if in measure mode and mouse in relevant pane * Avoid crash when trying to measure a non-layer * Various adjustments to some icons to make them look better in white-on-black schemes
author Chris Cannam
date Fri, 13 Jul 2007 15:54:17 +0000
parents cd2492c5fe45
children c0b9eec70639
comparison
equal deleted inserted replaced
289:4ca7562dd246 290:3101c68a00c1
27 27
28 SpectrumLayer::SpectrumLayer() : 28 SpectrumLayer::SpectrumLayer() :
29 m_originModel(0), 29 m_originModel(0),
30 m_channel(-1), 30 m_channel(-1),
31 m_channelSet(false), 31 m_channelSet(false),
32 m_windowSize(1024), 32 m_windowSize(4096),
33 m_windowType(HanningWindow), 33 m_windowType(HanningWindow),
34 m_windowHopLevel(2), 34 m_windowHopLevel(3),
35 m_showPeaks(false), 35 m_showPeaks(false),
36 m_newFFTNeeded(true) 36 m_newFFTNeeded(true)
37 { 37 {
38 Preferences *prefs = Preferences::getInstance(); 38 Preferences *prefs = Preferences::getInstance();
39 connect(prefs, SIGNAL(propertyChanged(PropertyContainer::PropertyName)), 39 connect(prefs, SIGNAL(propertyChanged(PropertyContainer::PropertyName)),
656 656
657 paint.save(); 657 paint.save();
658 paint.setRenderHint(QPainter::Antialiasing, false); 658 paint.setRenderHint(QPainter::Antialiasing, false);
659 paint.setPen(QColor(160, 160, 160)); //!!! 659 paint.setPen(QColor(160, 160, 160)); //!!!
660 660
661 int peakminbin = 0;
662 int peakmaxbin = fft->getHeight() - 1;
663 float peakmaxfreq = Pitch::getFrequencyForPitch(128);
664 peakmaxbin = ((peakmaxfreq * fft->getHeight() * 2) / fft->getSampleRate());
665
661 FFTModel::PeakSet peaks = fft->getPeakFrequencies 666 FFTModel::PeakSet peaks = fft->getPeakFrequencies
662 (FFTModel::MajorPitchAdaptivePeaks, col); 667 (FFTModel::MajorPitchAdaptivePeaks, col, peakminbin, peakmaxbin);
663 668
664 ColourMapper mapper(ColourMapper::BlackOnWhite, 0, 1); 669 ColourMapper mapper(ColourMapper::BlackOnWhite, 0, 1);
665 670
666 BiasCurve curve; 671 BiasCurve curve;
667 getBiasCurve(curve); 672 getBiasCurve(curve);