# HG changeset patch # User Chris Cannam # Date 1412346511 -3600 # Node ID 7a8f7a553b37bf8054cff054a4561271f897506e # Parent 1974859baba52e1e8d2c97e0e3d38b20c41a6e20# Parent c9d456b1fcde4ddc6e0347c4eb105a8b6e4ca527 Merge diff -r c9d456b1fcde -r 7a8f7a553b37 data/fileio/CSVFileReader.cpp --- a/data/fileio/CSVFileReader.cpp Fri Oct 03 09:29:11 2014 +0100 +++ b/data/fileio/CSVFileReader.cpp Fri Oct 03 15:28:31 2014 +0100 @@ -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; } } diff -r c9d456b1fcde -r 7a8f7a553b37 data/fileio/CSVFormat.cpp --- a/data/fileio/CSVFormat.cpp Fri Oct 03 09:29:11 2014 +0100 +++ b/data/fileio/CSVFormat.cpp Fri Oct 03 15:28:31 2014 +0100 @@ -103,7 +103,7 @@ QStringList list = StringBits::split(line, m_separator[0], m_allowQuoting); int cols = list.size(); - if (lineno == 0 || (cols < m_columnCount)) m_columnCount = cols; + if (lineno == 0 || (cols > m_columnCount)) m_columnCount = cols; if (cols != m_columnCount) m_variableColumnCount = true; // All columns are regarded as having these qualities until we see diff -r c9d456b1fcde -r 7a8f7a553b37 data/fileio/CSVFormat.h --- a/data/fileio/CSVFormat.h Fri Oct 03 09:29:11 2014 +0100 +++ b/data/fileio/CSVFormat.h Fri Oct 03 15:28:31 2014 +0100 @@ -37,8 +37,9 @@ enum TimeUnits { TimeSeconds, + TimeMilliseconds, TimeAudioFrames, - TimeWindows + TimeWindows, }; enum ColumnPurpose {