Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 316:c0b9eec70639
* Make XmlExportable::toXml the function that is universally overridden (and
pure virtual) instead of toXmlString. Tidies up some classes, notably the
model classes, significantly. Closes #1794561.
author | Chris Cannam |
---|---|
date | Thu, 18 Oct 2007 10:15:07 +0000 |
parents | cd2492c5fe45 |
children | 984c1975f1ff |
comparison
equal
deleted
inserted
replaced
315:c30a7cd29f4a | 316:c0b9eec70639 |
---|---|
33 #include <QRect> | 33 #include <QRect> |
34 #include <QTimer> | 34 #include <QTimer> |
35 #include <QApplication> | 35 #include <QApplication> |
36 #include <QMessageBox> | 36 #include <QMessageBox> |
37 #include <QMouseEvent> | 37 #include <QMouseEvent> |
38 #include <QTextStream> | |
38 | 39 |
39 #include <iostream> | 40 #include <iostream> |
40 | 41 |
41 #include <cassert> | 42 #include <cassert> |
42 #include <cmath> | 43 #include <cmath> |
3131 } | 3132 } |
3132 // std::cerr << "SpectrogramLayer::setMeasureRectYCoord: start " << r.startY << " <- " << y << ", end " << r.endY << " <- " << y << std::endl; | 3133 // std::cerr << "SpectrogramLayer::setMeasureRectYCoord: start " << r.startY << " <- " << y << ", end " << r.endY << " <- " << y << std::endl; |
3133 | 3134 |
3134 } | 3135 } |
3135 | 3136 |
3136 QString | 3137 void |
3137 SpectrogramLayer::toXmlString(QString indent, QString extraAttributes) const | 3138 SpectrogramLayer::toXml(QTextStream &stream, |
3139 QString indent, QString extraAttributes) const | |
3138 { | 3140 { |
3139 QString s; | 3141 QString s; |
3140 | 3142 |
3141 s += QString("channel=\"%1\" " | 3143 s += QString("channel=\"%1\" " |
3142 "windowSize=\"%2\" " | 3144 "windowSize=\"%2\" " |
3166 .arg(m_frequencyScale) | 3168 .arg(m_frequencyScale) |
3167 .arg(m_binDisplay) | 3169 .arg(m_binDisplay) |
3168 .arg(m_normalizeColumns ? "true" : "false") | 3170 .arg(m_normalizeColumns ? "true" : "false") |
3169 .arg(m_normalizeVisibleArea ? "true" : "false"); | 3171 .arg(m_normalizeVisibleArea ? "true" : "false"); |
3170 | 3172 |
3171 return Layer::toXmlString(indent, extraAttributes + " " + s); | 3173 Layer::toXml(stream, indent, extraAttributes + " " + s); |
3172 } | 3174 } |
3173 | 3175 |
3174 void | 3176 void |
3175 SpectrogramLayer::setProperties(const QXmlAttributes &attributes) | 3177 SpectrogramLayer::setProperties(const QXmlAttributes &attributes) |
3176 { | 3178 { |