comparison data/model/RegionModel.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
58 QString("%1<point frame=\"%2\" value=\"%3\" duration=\"%4\" label=\"%5\" %6/>\n") 58 QString("%1<point frame=\"%2\" value=\"%3\" duration=\"%4\" label=\"%5\" %6/>\n")
59 .arg(indent).arg(frame).arg(value).arg(duration) 59 .arg(indent).arg(frame).arg(value).arg(duration)
60 .arg(XmlExportable::encodeEntities(label)).arg(extraAttributes); 60 .arg(XmlExportable::encodeEntities(label)).arg(extraAttributes);
61 } 61 }
62 62
63 QString toDelimitedDataString(QString delimiter, int sampleRate) const 63 QString toDelimitedDataString(QString delimiter, sv_samplerate_t sampleRate) const
64 { 64 {
65 QStringList list; 65 QStringList list;
66 list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str(); 66 list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str();
67 list << QString("%1").arg(value); 67 list << QString("%1").arg(value);
68 list << RealTime::frame2RealTime(duration, sampleRate).toString().c_str(); 68 list << RealTime::frame2RealTime(duration, sampleRate).toString().c_str();
92 class RegionModel : public IntervalModel<RegionRec> 92 class RegionModel : public IntervalModel<RegionRec>
93 { 93 {
94 Q_OBJECT 94 Q_OBJECT
95 95
96 public: 96 public:
97 RegionModel(int sampleRate, int resolution, 97 RegionModel(sv_samplerate_t sampleRate, int resolution,
98 bool notifyOnAdd = true) : 98 bool notifyOnAdd = true) :
99 IntervalModel<RegionRec>(sampleRate, resolution, notifyOnAdd), 99 IntervalModel<RegionRec>(sampleRate, resolution, notifyOnAdd),
100 m_valueQuantization(0), 100 m_valueQuantization(0),
101 m_haveDistinctValues(false) 101 m_haveDistinctValues(false)
102 { 102 {
103 } 103 }
104 104
105 RegionModel(int sampleRate, int resolution, 105 RegionModel(sv_samplerate_t sampleRate, int resolution,
106 float valueMinimum, float valueMaximum, 106 float valueMinimum, float valueMaximum,
107 bool notifyOnAdd = true) : 107 bool notifyOnAdd = true) :
108 IntervalModel<RegionRec>(sampleRate, resolution, 108 IntervalModel<RegionRec>(sampleRate, resolution,
109 valueMinimum, valueMaximum, 109 valueMinimum, valueMaximum,
110 notifyOnAdd), 110 notifyOnAdd),