comparison data/model/NoteModel.h @ 314:70a232b1f12a

* 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 7b96b3bd4bae
children 7a4bd2c8585c
comparison
equal deleted inserted replaced
313:29485aa03da4 314:70a232b1f12a
41 long frame; 41 long frame;
42 float value; 42 float value;
43 size_t duration; 43 size_t duration;
44 QString label; 44 QString label;
45 45
46 QString toXmlString(QString indent = "", 46 void toXml(QTextStream &stream,
47 QString extraAttributes = "") const 47 QString indent = "",
48 QString extraAttributes = "") const
48 { 49 {
49 return QString("%1<point frame=\"%2\" value=\"%3\" duration=\"%4\" label=\"%5\" %6/>\n") 50 stream <<
51 QString("%1<point frame=\"%2\" value=\"%3\" duration=\"%4\" label=\"%5\" %6/>\n")
50 .arg(indent).arg(frame).arg(value).arg(duration).arg(label).arg(extraAttributes); 52 .arg(indent).arg(frame).arg(value).arg(duration).arg(label).arg(extraAttributes);
51 } 53 }
52 54
53 QString toDelimitedDataString(QString delimiter, size_t sampleRate) const 55 QString toDelimitedDataString(QString delimiter, size_t sampleRate) const
54 { 56 {
122 124
123 virtual void toXml(QTextStream &out, 125 virtual void toXml(QTextStream &out,
124 QString indent = "", 126 QString indent = "",
125 QString extraAttributes = "") const 127 QString extraAttributes = "") const
126 { 128 {
127 return SparseValueModel<Note>::toXml 129 SparseValueModel<Note>::toXml
128 (out, 130 (out,
129 indent, 131 indent,
130 QString("%1 valueQuantization=\"%2\"") 132 QString("%1 valueQuantization=\"%2\"")
131 .arg(extraAttributes).arg(m_valueQuantization)); 133 .arg(extraAttributes).arg(m_valueQuantization));
132 } 134 }