diff data/model/NoteModel.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 c48b07b34cb3
children cc27f35aa75c
line wrap: on
line diff
--- a/data/model/NoteModel.h	Tue Jun 17 13:52:07 2014 +0100
+++ b/data/model/NoteModel.h	Tue Jun 17 14:33:42 2014 +0100
@@ -39,14 +39,14 @@
 {
 public:
     Note(long _frame) : frame(_frame), value(0.0f), duration(0), level(1.f) { }
-    Note(long _frame, float _value, size_t _duration, float _level, QString _label) :
+    Note(long _frame, float _value, int _duration, float _level, QString _label) :
 	frame(_frame), value(_value), duration(_duration), level(_level), label(_label) { }
 
     int getDimensions() const { return 3; }
 
     long frame;
     float value;
-    size_t duration;
+    int duration;
     float level;
     QString label;
 
@@ -62,7 +62,7 @@
             .arg(XmlExportable::encodeEntities(label)).arg(extraAttributes);
     }
 
-    QString toDelimitedDataString(QString delimiter, size_t sampleRate) const
+    QString toDelimitedDataString(QString delimiter, int sampleRate) const
     {
         QStringList list;
         list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str();
@@ -98,7 +98,7 @@
     Q_OBJECT
     
 public:
-    NoteModel(size_t sampleRate, size_t resolution,
+    NoteModel(int sampleRate, int resolution,
 	      bool notifyOnAdd = true) :
 	IntervalModel<Note>(sampleRate, resolution, notifyOnAdd),
 	m_valueQuantization(0)
@@ -106,7 +106,7 @@
 	PlayParameterRepository::getInstance()->addPlayable(this);
     }
 
-    NoteModel(size_t sampleRate, size_t resolution,
+    NoteModel(int sampleRate, int resolution,
 	      float valueMinimum, float valueMaximum,
 	      bool notifyOnAdd = true) :
 	IntervalModel<Note>(sampleRate, resolution,
@@ -221,10 +221,10 @@
      */
 
     NoteList getNotes() const {
-        return getNotes(getStartFrame(), getEndFrame());
+        return getNotesWithin(getStartFrame(), getEndFrame());
     }
 
-    NoteList getNotes(size_t startFrame, size_t endFrame) const {
+    NoteList getNotesWithin(int startFrame, int endFrame) const {
         
 	PointList points = getPoints(startFrame, endFrame);
         NoteList notes;
@@ -232,7 +232,7 @@
         for (PointList::iterator pli =
 		 points.begin(); pli != points.end(); ++pli) {
 
-	    size_t duration = pli->duration;
+	    int duration = pli->duration;
             if (duration == 0 || duration == 1) {
                 duration = getSampleRate() / 20;
             }