Mercurial > hg > svgui
comparison layer/SpectrumLayer.cpp @ 456:035d62c4cddf
* Permit viewing (though not editing) colour 3d plot layer data in
the spreadsheet data viewer dialog
* Add somewhat simplistic RDF export for layers
* Fix display of peak frequencies in spectrum layer
* Fix (I hope) sizing of plugin parameter dialog
author | Chris Cannam |
---|---|
date | Tue, 02 Dec 2008 17:17:25 +0000 |
parents | e1a9e478b7f2 |
children | bd4db63b085e |
comparison
equal
deleted
inserted
replaced
455:747a58d45d56 | 456:035d62c4cddf |
---|---|
679 paint.save(); | 679 paint.save(); |
680 | 680 |
681 if (fft && m_showPeaks) { | 681 if (fft && m_showPeaks) { |
682 | 682 |
683 // draw peak lines | 683 // draw peak lines |
684 | |
685 // std::cerr << "Showing peaks..." << std::endl; | |
684 | 686 |
685 size_t col = v->getCentreFrame() / fft->getResolution(); | 687 size_t col = v->getCentreFrame() / fft->getResolution(); |
686 | 688 |
687 paint.save(); | 689 paint.save(); |
688 paint.setRenderHint(QPainter::Antialiasing, false); | 690 paint.setRenderHint(QPainter::Antialiasing, false); |
830 void | 832 void |
831 SpectrumLayer::toXml(QTextStream &stream, | 833 SpectrumLayer::toXml(QTextStream &stream, |
832 QString indent, QString extraAttributes) const | 834 QString indent, QString extraAttributes) const |
833 { | 835 { |
834 QString s = QString("windowSize=\"%1\" " | 836 QString s = QString("windowSize=\"%1\" " |
835 "windowHopLevel=\"%2\"") | 837 "windowHopLevel=\"%2\" " |
838 "showPeaks=\"%3\" ") | |
836 .arg(m_windowSize) | 839 .arg(m_windowSize) |
837 .arg(m_windowHopLevel); | 840 .arg(m_windowHopLevel) |
841 .arg(m_showPeaks ? "true" : "false"); | |
838 | 842 |
839 SliceLayer::toXml(stream, indent, extraAttributes + " " + s); | 843 SliceLayer::toXml(stream, indent, extraAttributes + " " + s); |
840 } | 844 } |
841 | 845 |
842 void | 846 void |
849 size_t windowSize = attributes.value("windowSize").toUInt(&ok); | 853 size_t windowSize = attributes.value("windowSize").toUInt(&ok); |
850 if (ok) setWindowSize(windowSize); | 854 if (ok) setWindowSize(windowSize); |
851 | 855 |
852 size_t windowHopLevel = attributes.value("windowHopLevel").toUInt(&ok); | 856 size_t windowHopLevel = attributes.value("windowHopLevel").toUInt(&ok); |
853 if (ok) setWindowHopLevel(windowHopLevel); | 857 if (ok) setWindowHopLevel(windowHopLevel); |
854 } | 858 |
855 | 859 bool showPeaks = (attributes.value("showPeaks").trimmed() == "true"); |
856 | 860 setShowPeaks(showPeaks); |
861 } | |
862 | |
863 |