Remove the source files which got transferred to libpbd
[ardour.git] / libs / ardour / ardour / meter.h
index e7317f854f221da212146849c212e52267e5e28a..8ed1ade50d4c3e4f418e181d646f040e245940ad 100644 (file)
 #define __ardour_meter_h__
 
 #include <vector>
+#include "ardour/libardour_visibility.h"
 #include "ardour/types.h"
 #include "ardour/processor.h"
-#include "pbd/signals.h"
 #include "pbd/fastlog.h"
 
+#include "ardour/kmeterdsp.h"
+#include "ardour/iec1ppmdsp.h"
+#include "ardour/iec2ppmdsp.h"
+#include "ardour/vumeterdsp.h"
+
 namespace ARDOUR {
 
 class BufferSet;
 class ChanCount;
 class Session;
 
-class Metering {
+class LIBARDOUR_API Metering {
   public:
        static void               update_meters ();
        static PBD::Signal0<void> Meter;
@@ -43,17 +48,18 @@ class Metering {
 
 /** Meters peaks on the input and stores them for access.
  */
-class PeakMeter : public Processor {
+class LIBARDOUR_API PeakMeter : public Processor {
 public:
-       PeakMeter(Session& s) : Processor(s, "Meter") {}
+        PeakMeter(Session& s, const std::string& name);
+        ~PeakMeter();
 
        void meter();
        void reset ();
        void reset_max ();
 
-       bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
+       bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
        bool configure_io (ChanCount in, ChanCount out);
-       
+
        /* special method for meter, to ensure that it can always handle the maximum
           number of streams in the route, no matter where we put it.
        */
@@ -70,6 +76,9 @@ public:
        /** Compute peaks */
        void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
 
+       void activate ()   { }
+       void deactivate () { }
+
        ChanCount input_streams () const { return current_meters; }
        ChanCount output_streams () const { return current_meters; }
 
@@ -81,16 +90,15 @@ public:
                }
        }
 
-       float max_peak_power (uint32_t n) {
-               if (n < _max_peak_power.size()) {
-                       return _max_peak_power[n];
-               } else {
-                       return minus_infinity();
-               }
-       }
+       float meter_level (uint32_t n, MeterType type);
+
+       void set_type(MeterType t);
+       MeterType get_type() { return _meter_type; }
 
        XMLNode& state (bool full);
-       
+
+       PBD::Signal1<void, MeterType> TypeChanged;
+
 private:
        friend class IO;
 
@@ -99,12 +107,19 @@ private:
         *  as it can be altered outside a ::configure_io by ::reflect_inputs.
         */
        ChanCount current_meters;
-       
-       std::vector<float> _peak_power;
+
+       std::vector<float> _peak_signal;
        std::vector<float> _visible_peak_power;
+       std::vector<float> _max_peak_signal;
        std::vector<float> _max_peak_power;
-};
 
+       std::vector<Kmeterdsp *> _kmeter;
+       std::vector<Iec1ppmdsp *> _iec1meter;
+       std::vector<Iec2ppmdsp *> _iec2meter;
+       std::vector<Vumeterdsp *> _vumeter;
+
+       MeterType _meter_type;
+};
 
 } // namespace ARDOUR