comparison layer/WaveformLayer.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 e9549ea3f825
children 984c1975f1ff
comparison
equal deleted inserted replaced
315:c30a7cd29f4a 316:c0b9eec70639
21 #include "base/RangeMapper.h" 21 #include "base/RangeMapper.h"
22 #include "base/ColourDatabase.h" 22 #include "base/ColourDatabase.h"
23 23
24 #include <QPainter> 24 #include <QPainter>
25 #include <QPixmap> 25 #include <QPixmap>
26 #include <QTextStream>
26 27
27 #include <iostream> 28 #include <iostream>
28 #include <cmath> 29 #include <cmath>
29 30
30 //#define DEBUG_WAVEFORM_PAINT 1 31 //#define DEBUG_WAVEFORM_PAINT 1
1246 } 1247 }
1247 } 1248 }
1248 } 1249 }
1249 } 1250 }
1250 1251
1251 QString 1252 void
1252 WaveformLayer::toXmlString(QString indent, QString extraAttributes) const 1253 WaveformLayer::toXml(QTextStream &stream,
1254 QString indent, QString extraAttributes) const
1253 { 1255 {
1254 QString s; 1256 QString s;
1255 1257
1256 QString colourName, colourSpec, darkbg; 1258 QString colourName, colourSpec, darkbg;
1257 ColourDatabase::getInstance()->getStringValues 1259 ColourDatabase::getInstance()->getStringValues
1272 .arg(m_channel) 1274 .arg(m_channel)
1273 .arg(m_scale) 1275 .arg(m_scale)
1274 .arg(m_aggressive) 1276 .arg(m_aggressive)
1275 .arg(m_autoNormalize); 1277 .arg(m_autoNormalize);
1276 1278
1277 return SingleColourLayer::toXmlString(indent, extraAttributes + " " + s); 1279 SingleColourLayer::toXml(stream, indent, extraAttributes + " " + s);
1278 } 1280 }
1279 1281
1280 void 1282 void
1281 WaveformLayer::setProperties(const QXmlAttributes &attributes) 1283 WaveformLayer::setProperties(const QXmlAttributes &attributes)
1282 { 1284 {