diff data/fileio/CSVFileReader.cpp @ 1007:ba404199345f tonioni

Merge from default branch
author Chris Cannam
date Mon, 10 Nov 2014 09:19:49 +0000
parents dc1695b90a58
children e369dd281cf2
line wrap: on
line diff
--- a/data/fileio/CSVFileReader.cpp	Tue Sep 09 16:36:21 2014 +0100
+++ b/data/fileio/CSVFileReader.cpp	Mon Nov 10 09:19:49 2014 +0000
@@ -101,6 +101,12 @@
         double time = numeric.toDouble(&ok);
         if (!ok) time = StringBits::stringToDoubleLocaleFree(numeric, &ok);
         calculatedFrame = int(time * sampleRate + 0.5);
+    
+    } else if (timeUnits == CSVFormat::TimeMilliseconds) {
+
+        double time = numeric.toDouble(&ok);
+        if (!ok) time = StringBits::stringToDoubleLocaleFree(numeric, &ok);
+        calculatedFrame = int((time / 1000.0) * sampleRate + 0.5);
         
     } else {
         
@@ -149,7 +155,8 @@
         } else {
             windowSize = 1;
         }
-	if (timeUnits == CSVFormat::TimeSeconds) {
+	if (timeUnits == CSVFormat::TimeSeconds ||
+            timeUnits == CSVFormat::TimeMilliseconds) {
 	    sampleRate = m_mainModelSampleRate;
 	}
     }