comparison data/model/RegionModel.h @ 929:59e7fe1b1003 warnfix_no_size_t

Unsigned removals and warning fixes in data/
author Chris Cannam
date Tue, 17 Jun 2014 14:33:42 +0100
parents e22b6e89a7f7
children cc27f35aa75c
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
36 struct RegionRec 36 struct RegionRec
37 { 37 {
38 public: 38 public:
39 RegionRec() : frame(0), value(0.f), duration(0) { } 39 RegionRec() : frame(0), value(0.f), duration(0) { }
40 RegionRec(long _frame) : frame(_frame), value(0.0f), duration(0) { } 40 RegionRec(long _frame) : frame(_frame), value(0.0f), duration(0) { }
41 RegionRec(long _frame, float _value, size_t _duration, QString _label) : 41 RegionRec(long _frame, float _value, int _duration, QString _label) :
42 frame(_frame), value(_value), duration(_duration), label(_label) { } 42 frame(_frame), value(_value), duration(_duration), label(_label) { }
43 43
44 int getDimensions() const { return 3; } 44 int getDimensions() const { return 3; }
45 45
46 long frame; 46 long frame;
47 float value; 47 float value;
48 size_t duration; 48 int duration;
49 QString label; 49 QString label;
50 50
51 QString getLabel() const { return label; } 51 QString getLabel() const { return label; }
52 52
53 void toXml(QTextStream &stream, 53 void toXml(QTextStream &stream,
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, size_t sampleRate) const 63 QString toDelimitedDataString(QString delimiter, int 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(size_t sampleRate, size_t resolution, 97 RegionModel(int 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(size_t sampleRate, size_t resolution, 105 RegionModel(int 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),