Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
980:6e6da0636e5e | 1007:ba404199345f |
---|---|
99 if (timeUnits == CSVFormat::TimeSeconds) { | 99 if (timeUnits == CSVFormat::TimeSeconds) { |
100 | 100 |
101 double time = numeric.toDouble(&ok); | 101 double time = numeric.toDouble(&ok); |
102 if (!ok) time = StringBits::stringToDoubleLocaleFree(numeric, &ok); | 102 if (!ok) time = StringBits::stringToDoubleLocaleFree(numeric, &ok); |
103 calculatedFrame = int(time * sampleRate + 0.5); | 103 calculatedFrame = int(time * sampleRate + 0.5); |
104 | |
105 } else if (timeUnits == CSVFormat::TimeMilliseconds) { | |
106 | |
107 double time = numeric.toDouble(&ok); | |
108 if (!ok) time = StringBits::stringToDoubleLocaleFree(numeric, &ok); | |
109 calculatedFrame = int((time / 1000.0) * sampleRate + 0.5); | |
104 | 110 |
105 } else { | 111 } else { |
106 | 112 |
107 long n = numeric.toLong(&ok); | 113 long n = numeric.toLong(&ok); |
108 if (n >= 0) calculatedFrame = n; | 114 if (n >= 0) calculatedFrame = n; |
147 // that's likely to be visible | 153 // that's likely to be visible |
148 windowSize = 1024; | 154 windowSize = 1024; |
149 } else { | 155 } else { |
150 windowSize = 1; | 156 windowSize = 1; |
151 } | 157 } |
152 if (timeUnits == CSVFormat::TimeSeconds) { | 158 if (timeUnits == CSVFormat::TimeSeconds || |
159 timeUnits == CSVFormat::TimeMilliseconds) { | |
153 sampleRate = m_mainModelSampleRate; | 160 sampleRate = m_mainModelSampleRate; |
154 } | 161 } |
155 } | 162 } |
156 | 163 |
157 SparseOneDimensionalModel *model1 = 0; | 164 SparseOneDimensionalModel *model1 = 0; |