comparison data/fileio/CSVFormat.h @ 1515:ffec849858a7 import-audio-data

Add sample-range support to CSVFormat
author Chris Cannam
date Fri, 07 Sep 2018 16:55:29 +0100
parents c9c2aa17439a
children ad46f6e80369
comparison
equal deleted inserted replaced
1514:b7042aaecebe 1515:ffec849858a7
63 ColumnLarge = 16, // Values "quickly" grew to over 1000 63 ColumnLarge = 16, // Values "quickly" grew to over 1000
64 ColumnSigned = 32, // Some negative values were seen 64 ColumnSigned = 32, // Some negative values were seen
65 ColumnNearEmpty = 64, // Nothing in this column beyond first row 65 ColumnNearEmpty = 64, // Nothing in this column beyond first row
66 }; 66 };
67 typedef unsigned int ColumnQualities; 67 typedef unsigned int ColumnQualities;
68
69 enum AudioSampleRange {
70 SampleRangeSigned1 = 0, // -1 .. 1
71 SampleRangeUnsigned255, // 0 .. 255
72 SampleRangeSigned32767, // -32768 .. 32767
73 SampleRangeOther // Other/unknown: Normalise on load
74 };
68 75
69 CSVFormat() : // arbitrary defaults 76 CSVFormat() : // arbitrary defaults
70 m_modelType(TwoDimensionalModel), 77 m_modelType(TwoDimensionalModel),
71 m_timingType(ExplicitTiming), 78 m_timingType(ExplicitTiming),
72 m_timeUnits(TimeSeconds), 79 m_timeUnits(TimeSeconds),
147 bool m_variableColumnCount; 154 bool m_variableColumnCount;
148 155
149 QList<ColumnQualities> m_columnQualities; 156 QList<ColumnQualities> m_columnQualities;
150 QList<ColumnPurpose> m_columnPurposes; 157 QList<ColumnPurpose> m_columnPurposes;
151 158
159 AudioSampleRange m_audioSampleRange;
160
152 QList<float> m_prevValues; 161 QList<float> m_prevValues;
153 162
154 bool m_allowQuoting; 163 bool m_allowQuoting;
155 164
156 QList<QStringList> m_example; 165 QList<QStringList> m_example;
157 int m_maxExampleCols; 166 int m_maxExampleCols;
158 167
159 void guessSeparator(QString line); 168 void guessSeparator(QString line);
160 void guessQualities(QString line, int lineno); 169 void guessQualities(QString line, int lineno);
161 void guessPurposes(); 170 void guessPurposes();
162 171 void guessAudioSampleRange();
163 void guessFormatFor_Old(QString path);
164
165 }; 172 };
166 173
167 #endif 174 #endif