Pretty dumb smoothing.
[dcpomatic.git] / src / lib / audio_analysis.h
index 1c668b9c223daa54cbfc91e2bdadc93066148462..a8cfbdeca81a6132afa74004c2a36dc429b2e4db 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <iostream>
 #include <vector>
+#include <list>
 
 class AudioPoint
 {
@@ -33,10 +34,11 @@ public:
        };
 
        AudioPoint ();
+       AudioPoint (std::istream &);
 
        void write (std::ostream &) const;
        
-       float& operator[] (Type t) {
+       float& operator[] (int t) {
                return _data[t];
        }
 
@@ -48,10 +50,18 @@ class AudioAnalysis
 {
 public:
        AudioAnalysis (int c);
+       AudioAnalysis (std::string);
 
        void add_point (int c, AudioPoint const & p);
+       
+       AudioPoint get_point (int c, int p) const;
+       int points (int c) const;
+       int channels () const;
+
        void write (std::string);
 
+       static float smooth (std::list<float> const &, AudioPoint::Type);
+
 private:
        std::vector<std::vector<AudioPoint> > _data;
 };