diff data/fileio/WavFileReader.h @ 1513:75d92155fa20 import-audio-data

Add normalisation option
author Chris Cannam
date Fri, 07 Sep 2018 16:13:21 +0100
parents 1bc6f70cb4c7
children 954d0cf29ca7
line wrap: on
line diff
--- a/data/fileio/WavFileReader.h	Thu Sep 06 16:26:19 2018 +0100
+++ b/data/fileio/WavFileReader.h	Fri Sep 07 16:13:21 2018 +0100
@@ -41,7 +41,9 @@
 class WavFileReader : public AudioFileReader
 {
 public:
-    WavFileReader(FileSource source, bool fileUpdating = false);
+    WavFileReader(FileSource source,
+                  bool fileUpdating = false,
+                  bool normalise = false);
     virtual ~WavFileReader();
 
     virtual QString getLocation() const { return m_source.getLocation(); }
@@ -55,7 +57,8 @@
      * Must be safe to call from multiple threads with different
      * arguments on the same object at the same time.
      */
-    virtual floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count) const;
+    virtual floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count)
+        const;
     
     static void getSupportedExtensions(std::set<QString> &extensions);
     static bool supportsExtension(QString ext);
@@ -84,7 +87,14 @@
     mutable sv_frame_t m_lastStart;
     mutable sv_frame_t m_lastCount;
 
+    bool m_normalise;
+    float m_max;
+
     bool m_updating;
+
+    floatvec_t getInterleavedFramesUnnormalised(sv_frame_t start,
+                                                sv_frame_t count) const;
+    float getMax() const;
 };
 
 #endif