comparison data/model/SparseOneDimensionalModel.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 3a3541b357fe
children cc27f35aa75c
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
24 #include <QStringList> 24 #include <QStringList>
25 25
26 struct OneDimensionalPoint 26 struct OneDimensionalPoint
27 { 27 {
28 public: 28 public:
29 OneDimensionalPoint(long _frame) : frame(_frame) { } 29 OneDimensionalPoint(int _frame) : frame(_frame) { }
30 OneDimensionalPoint(long _frame, QString _label) : frame(_frame), label(_label) { } 30 OneDimensionalPoint(int _frame, QString _label) : frame(_frame), label(_label) { }
31 31
32 int getDimensions() const { return 1; } 32 int getDimensions() const { return 1; }
33 33
34 long frame; 34 int frame;
35 QString label; 35 QString label;
36 36
37 QString getLabel() const { return label; } 37 QString getLabel() const { return label; }
38 38
39 void toXml(QTextStream &stream, 39 void toXml(QTextStream &stream,
43 stream << QString("%1<point frame=\"%2\" label=\"%3\" %4/>\n") 43 stream << QString("%1<point frame=\"%2\" label=\"%3\" %4/>\n")
44 .arg(indent).arg(frame).arg(XmlExportable::encodeEntities(label)) 44 .arg(indent).arg(frame).arg(XmlExportable::encodeEntities(label))
45 .arg(extraAttributes); 45 .arg(extraAttributes);
46 } 46 }
47 47
48 QString toDelimitedDataString(QString delimiter, size_t sampleRate) const 48 QString toDelimitedDataString(QString delimiter, int sampleRate) const
49 { 49 {
50 QStringList list; 50 QStringList list;
51 list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str(); 51 list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str();
52 if (label != "") list << label; 52 if (label != "") list << label;
53 return list.join(delimiter); 53 return list.join(delimiter);
74 public NoteExportable 74 public NoteExportable
75 { 75 {
76 Q_OBJECT 76 Q_OBJECT
77 77
78 public: 78 public:
79 SparseOneDimensionalModel(size_t sampleRate, size_t resolution, 79 SparseOneDimensionalModel(int sampleRate, int resolution,
80 bool notifyOnAdd = true) : 80 bool notifyOnAdd = true) :
81 SparseModel<OneDimensionalPoint>(sampleRate, resolution, notifyOnAdd) 81 SparseModel<OneDimensionalPoint>(sampleRate, resolution, notifyOnAdd)
82 { 82 {
83 PlayParameterRepository::getInstance()->addPlayable(this); 83 PlayParameterRepository::getInstance()->addPlayable(this);
84 } 84 }
182 /** 182 /**
183 * NoteExportable methods. 183 * NoteExportable methods.
184 */ 184 */
185 185
186 NoteList getNotes() const { 186 NoteList getNotes() const {
187 return getNotes(getStartFrame(), getEndFrame()); 187 return getNotesWithin(getStartFrame(), getEndFrame());
188 } 188 }
189 189
190 NoteList getNotes(size_t startFrame, size_t endFrame) const { 190 NoteList getNotesWithin(int startFrame, int endFrame) const {
191 191
192 PointList points = getPoints(startFrame, endFrame); 192 PointList points = getPoints(startFrame, endFrame);
193 NoteList notes; 193 NoteList notes;
194 194
195 for (PointList::iterator pli = 195 for (PointList::iterator pli =