Mercurial > hg > svcore
comparison data/model/TextModel.h @ 1040:a1cd5abcb38b cxx11
Introduce and use a samplerate type
| author | Chris Cannam |
|---|---|
| date | Wed, 04 Mar 2015 12:01:04 +0000 |
| parents | cc27f35aa75c |
| children | 57633d605547 |
comparison
equal
deleted
inserted
replaced
| 1039:b14064bd1f97 | 1040:a1cd5abcb38b |
|---|---|
| 49 stream << QString("%1<point frame=\"%2\" height=\"%3\" label=\"%4\" %5/>\n") | 49 stream << QString("%1<point frame=\"%2\" height=\"%3\" label=\"%4\" %5/>\n") |
| 50 .arg(indent).arg(frame).arg(height) | 50 .arg(indent).arg(frame).arg(height) |
| 51 .arg(encodeEntities(label)).arg(extraAttributes); | 51 .arg(encodeEntities(label)).arg(extraAttributes); |
| 52 } | 52 } |
| 53 | 53 |
| 54 QString toDelimitedDataString(QString delimiter, int sampleRate) const | 54 QString toDelimitedDataString(QString delimiter, sv_samplerate_t sampleRate) const |
| 55 { | 55 { |
| 56 QStringList list; | 56 QStringList list; |
| 57 list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str(); | 57 list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str(); |
| 58 list << QString("%1").arg(height); | 58 list << QString("%1").arg(height); |
| 59 if (label != "") list << label; | 59 if (label != "") list << label; |
| 83 class TextModel : public SparseModel<TextPoint> | 83 class TextModel : public SparseModel<TextPoint> |
| 84 { | 84 { |
| 85 Q_OBJECT | 85 Q_OBJECT |
| 86 | 86 |
| 87 public: | 87 public: |
| 88 TextModel(int sampleRate, int resolution, bool notifyOnAdd = true) : | 88 TextModel(sv_samplerate_t sampleRate, int resolution, bool notifyOnAdd = true) : |
| 89 SparseModel<TextPoint>(sampleRate, resolution, notifyOnAdd) | 89 SparseModel<TextPoint>(sampleRate, resolution, notifyOnAdd) |
| 90 { } | 90 { } |
| 91 | 91 |
| 92 virtual void toXml(QTextStream &out, | 92 virtual void toXml(QTextStream &out, |
| 93 QString indent = "", | 93 QString indent = "", |
