comparison transform/CSVFeatureWriter.cpp @ 1047:26cf6d5251ec cxx11

Further dedicated-types fixes
author Chris Cannam
date Tue, 10 Mar 2015 17:02:52 +0000
parents b14064bd1f97
children 870acd589a38
comparison
equal deleted inserted replaced
1046:2f49be7d4264 1047:26cf6d5251ec
208 stream << m_separator; 208 stream << m_separator;
209 } 209 }
210 } 210 }
211 } 211 }
212 212
213 Vamp::RealTime duration; 213 ::RealTime duration;
214 bool haveDuration = true; 214 bool haveDuration = true;
215 215
216 if (f.hasDuration) { 216 if (f.hasDuration) {
217 duration = f.duration; 217 duration = f.duration;
218 } else if (optionalNextFeature) { 218 } else if (optionalNextFeature) {
221 haveDuration = false; 221 haveDuration = false;
222 } 222 }
223 223
224 if (m_sampleTiming) { 224 if (m_sampleTiming) {
225 225
226 int rate = int(lrintf(transform.getSampleRate())); 226 sv_samplerate_t rate = transform.getSampleRate();
227 227
228 stream << Vamp::RealTime::realTime2Frame(f.timestamp, rate); 228 stream << ::RealTime::realTime2Frame(f.timestamp, rate);
229 229
230 if (haveDuration) { 230 if (haveDuration) {
231 stream << m_separator; 231 stream << m_separator;
232 if (m_endTimes) { 232 if (m_endTimes) {
233 stream << Vamp::RealTime::realTime2Frame 233 stream << ::RealTime::realTime2Frame
234 (f.timestamp + duration, rate); 234 (::RealTime(f.timestamp) + duration, rate);
235 } else { 235 } else {
236 stream << Vamp::RealTime::realTime2Frame(duration, rate); 236 stream << ::RealTime::realTime2Frame(duration, rate);
237 } 237 }
238 } 238 }
239 239
240 } else { 240 } else {
241 241
244 stream << timestamp; 244 stream << timestamp;
245 245
246 if (haveDuration) { 246 if (haveDuration) {
247 if (m_endTimes) { 247 if (m_endTimes) {
248 QString endtime = 248 QString endtime =
249 (f.timestamp + duration).toString().c_str(); 249 (::RealTime(f.timestamp) + duration).toString().c_str();
250 endtime.replace(QRegExp("^ +"), ""); 250 endtime.replace(QRegExp("^ +"), "");
251 stream << m_separator << endtime; 251 stream << m_separator << endtime;
252 } else { 252 } else {
253 QString d = duration.toString().c_str(); 253 QString d = ::RealTime(duration).toString().c_str();
254 d.replace(QRegExp("^ +"), ""); 254 d.replace(QRegExp("^ +"), "");
255 stream << m_separator << d; 255 stream << m_separator << d;
256 } 256 }
257 } 257 }
258 } 258 }