diff 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
line wrap: on
line diff
--- a/data/fileio/CSVFormat.h	Fri Sep 07 16:13:48 2018 +0100
+++ b/data/fileio/CSVFormat.h	Fri Sep 07 16:55:29 2018 +0100
@@ -66,6 +66,13 @@
     };
     typedef unsigned int ColumnQualities;
 
+    enum AudioSampleRange {
+        SampleRangeSigned1 = 0, //     -1 .. 1
+        SampleRangeUnsigned255, //      0 .. 255
+        SampleRangeSigned32767, // -32768 .. 32767
+        SampleRangeOther        // Other/unknown: Normalise on load
+    };
+
     CSVFormat() : // arbitrary defaults
         m_modelType(TwoDimensionalModel),
         m_timingType(ExplicitTiming),
@@ -149,6 +156,8 @@
     QList<ColumnQualities> m_columnQualities;
     QList<ColumnPurpose> m_columnPurposes;
 
+    AudioSampleRange m_audioSampleRange;
+
     QList<float> m_prevValues;
 
     bool m_allowQuoting;
@@ -159,9 +168,7 @@
     void guessSeparator(QString line);
     void guessQualities(QString line, int lineno);
     void guessPurposes();
-
-    void guessFormatFor_Old(QString path);
- 
+    void guessAudioSampleRange();
 };
 
 #endif