diff rdf/RDFImporter.cpp @ 1039:b14064bd1f97 cxx11

This code now compiles. Main problem: sample rate types
author Chris Cannam
date Tue, 03 Mar 2015 17:09:19 +0000
parents 06579b8ffb7b
children a1cd5abcb38b
line wrap: on
line diff
--- a/rdf/RDFImporter.cpp	Tue Mar 03 15:18:24 2015 +0000
+++ b/rdf/RDFImporter.cpp	Tue Mar 03 17:09:19 2015 +0000
@@ -81,7 +81,8 @@
                                    int &sampleRate, int &windowLength,
                                    int &hopSize, int &width, int &height);
 
-    void fillModel(Model *, long, long, bool, std::vector<float> &, QString);
+    void fillModel(Model *, sv_frame_t, sv_frame_t,
+                   bool, std::vector<float> &, QString);
 };
 
 QString
@@ -686,8 +687,8 @@
                 model = modelMap[timeline][type][dimensions][haveDuration];
 
                 if (model) {
-                    long ftime = RealTime::realTime2Frame(time, m_sampleRate);
-                    long fduration = RealTime::realTime2Frame(duration, m_sampleRate);
+                    sv_frame_t ftime = RealTime::realTime2Frame(time, m_sampleRate);
+                    sv_frame_t fduration = RealTime::realTime2Frame(duration, m_sampleRate);
                     fillModel(model, ftime, fduration, haveDuration, values, label);
                 }
             }
@@ -697,8 +698,8 @@
 
 void
 RDFImporterImpl::fillModel(Model *model,
-                           long ftime,
-                           long fduration,
+                           sv_frame_t ftime,
+                           sv_frame_t fduration,
                            bool haveDuration,
                            std::vector<float> &values,
                            QString label)
@@ -757,7 +758,8 @@
                     }
                 }
             }
-            NoteModel::Point point(ftime, value, duration, level, label);
+            NoteModel::Point point(ftime, value, sv_frame_t(lrintf(duration)),
+                                   level, label);
             nm->addPoint(point);
         }
         return;
@@ -789,7 +791,8 @@
                     duration = values[1];
                 }
             }
-            RegionModel::Point point(ftime, value, duration, label);
+            RegionModel::Point point(ftime, value,
+                                     sv_frame_t(lrintf(duration)), label);
             rm->addPoint(point);
         }
         return;