diff data/model/NoteModel.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
line wrap: on
line diff
--- a/data/model/NoteModel.h	Tue Mar 03 17:09:19 2015 +0000
+++ b/data/model/NoteModel.h	Wed Mar 04 12:01:04 2015 +0000
@@ -62,7 +62,7 @@
             .arg(XmlExportable::encodeEntities(label)).arg(extraAttributes);
     }
 
-    QString toDelimitedDataString(QString delimiter, int sampleRate) const
+    QString toDelimitedDataString(QString delimiter, sv_samplerate_t sampleRate) const
     {
         QStringList list;
         list << RealTime::frame2RealTime(frame, sampleRate).toString().c_str();
@@ -98,7 +98,7 @@
     Q_OBJECT
     
 public:
-    NoteModel(int sampleRate, int resolution,
+    NoteModel(sv_samplerate_t sampleRate, int resolution,
 	      bool notifyOnAdd = true) :
 	IntervalModel<Note>(sampleRate, resolution, notifyOnAdd),
 	m_valueQuantization(0)
@@ -106,7 +106,7 @@
 	PlayParameterRepository::getInstance()->addPlayable(this);
     }
 
-    NoteModel(int sampleRate, int resolution,
+    NoteModel(sv_samplerate_t sampleRate, int resolution,
 	      float valueMinimum, float valueMaximum,
 	      bool notifyOnAdd = true) :
 	IntervalModel<Note>(sampleRate, resolution,
@@ -234,7 +234,7 @@
 
 	    sv_frame_t duration = pli->duration;
             if (duration == 0 || duration == 1) {
-                duration = getSampleRate() / 20;
+                duration = sv_frame_t(getSampleRate() / 20);
             }
 
             int pitch = int(lrintf(pli->value));