Less weak plugin preset system (maybe AU preset stuff can use the 'normal' thing...
[ardour.git] / libs / ardour / ardour / meter.h
index ed38fc4f0a1ce59289f620961eb6f448a673da71..112f306ccb98db6b74bbdaff70921b568f68ac92 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <vector>
 #include <ardour/types.h>
+#include <ardour/processor.h>
 #include <pbd/fastlog.h>
 
 namespace ARDOUR {
@@ -32,16 +33,18 @@ class Session;
 
 /** Meters peaks on the input and stores them for access.
  */
-class PeakMeter {
+class PeakMeter : public Processor {
 public:
-       PeakMeter(Session& s) : _session(s) {}
+       PeakMeter(Session& s) : Processor(s, "meter", PreFader) {}
 
-       void setup (const ChanCount& in);
        void reset ();
        void reset_max ();
-
+       
+       bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const { return true; }
+       bool configure_io (ChanCount in, ChanCount out);
+       
        /** Compute peaks */
-       void run (BufferSet& bufs, nframes_t nframes, nframes_t offset=0);
+       void run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
        
        float peak_power (uint32_t n) { 
                if (n < _visible_peak_power.size()) {
@@ -64,7 +67,6 @@ private:
        friend class IO;
        void meter();
 
-       Session&           _session;
        std::vector<float> _peak_power;
        std::vector<float> _visible_peak_power;
        std::vector<float> _max_peak_power;