comparison base/Event.h @ 1789:baafe1bb7e51 time-frequency-boxes

Fixes to export of time-frequency box model
author Chris Cannam
date Fri, 20 Sep 2019 14:18:38 +0100
parents 9ab3be243397
children 8c34ecba70df
comparison
equal deleted inserted replaced
1787:9ab3be243397 1789:baafe1bb7e51
257 } 257 }
258 258
259 struct ExportNameOptions { 259 struct ExportNameOptions {
260 260
261 ExportNameOptions() : 261 ExportNameOptions() :
262 valueAtttributeName("value"), 262 valueAttributeName("value"),
263 levelAttributeName("level"),
263 uriAttributeName("uri") { } 264 uriAttributeName("uri") { }
264 265
265 QString valueAtttributeName; 266 QString valueAttributeName;
267 QString levelAttributeName;
266 QString uriAttributeName; 268 QString uriAttributeName;
267 }; 269 };
268 270
269 void toXml(QTextStream &stream, 271 void toXml(QTextStream &stream,
270 QString indent = "", 272 QString indent = "",
273 275
274 // For I/O purposes these are points, not events 276 // For I/O purposes these are points, not events
275 stream << indent << QString("<point frame=\"%1\" ").arg(m_frame); 277 stream << indent << QString("<point frame=\"%1\" ").arg(m_frame);
276 if (m_haveValue) { 278 if (m_haveValue) {
277 stream << QString("%1=\"%2\" ") 279 stream << QString("%1=\"%2\" ")
278 .arg(opts.valueAtttributeName).arg(m_value); 280 .arg(opts.valueAttributeName).arg(m_value);
279 } 281 }
280 if (m_haveDuration) { 282 if (m_haveDuration) {
281 stream << QString("duration=\"%1\" ").arg(m_duration); 283 stream << QString("duration=\"%1\" ").arg(m_duration);
282 } 284 }
283 if (m_haveLevel) { 285 if (m_haveLevel) {
284 stream << QString("level=\"%1\" ").arg(m_level); 286 stream << QString("%1=\"%2\" ")
287 .arg(opts.levelAttributeName)
288 .arg(m_level);
285 } 289 }
286 if (m_haveReferenceFrame) { 290 if (m_haveReferenceFrame) {
287 stream << QString("referenceFrame=\"%1\" ") 291 stream << QString("referenceFrame=\"%1\" ")
288 .arg(m_referenceFrame); 292 .arg(m_referenceFrame);
289 } 293 }