Revert new meter types (postponed until after 3.3 release)
authorRobin Gareus <robin@gareus.org>
Mon, 15 Jul 2013 14:07:37 +0000 (16:07 +0200)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 8 Aug 2013 19:23:09 +0000 (15:23 -0400)
This reverts commit ce621d1c8a600853be0020942a9664ccee0ab165.
This reverts commit 80aa2574819e947668092c660d767e25a661c6f1.

17 files changed:
gtk2_ardour/meter_patterns.cc
gtk2_ardour/meter_strip.cc
gtk2_ardour/mixer_strip.cc
libs/ardour/ardour/iec1ppmdsp.h [deleted file]
libs/ardour/ardour/iec2ppmdsp.h [deleted file]
libs/ardour/ardour/kmeterdsp.h [deleted file]
libs/ardour/ardour/meter.h
libs/ardour/ardour/types.h
libs/ardour/ardour/vumeterdsp.h [deleted file]
libs/ardour/enums.cc
libs/ardour/iec1ppmdsp.cc [deleted file]
libs/ardour/iec2ppmdsp.cc [deleted file]
libs/ardour/kmeterdsp.cc
libs/ardour/kmeterdsp.h [new file with mode: 0644]
libs/ardour/meter.cc
libs/ardour/vumeterdsp.cc [deleted file]
libs/ardour/wscript

index ccf24fcefc9a7678b03fe5bb53bdc1b5b6c14df0..80655af7b9a452a63bd751416d699a9f6a5a52e1 100644 (file)
@@ -64,15 +64,6 @@ ArdourMeter::meter_type_string (ARDOUR::MeterType mt)
                case MeterKrms:
                        return _("RMS + Peak");
                        break;
-               case MeterIEC1:
-                       return _("DIN");
-                       break;
-               case MeterIEC2:
-                       return _("EBU/BBC");
-                       break;
-               case MeterVU:
-                       return _("VU");
-                       break;
                default:
                        return _("???");
                        break;
index 3a8410867af565cfe8f1e277d86163ff9e1b1823..44144114a4dad2cbc167d2d238fb26c180678854 100644 (file)
@@ -573,9 +573,6 @@ MeterStrip::popup_level_meter_menu (GdkEventButton* ev)
        _suspend_menu_callbacks = true;
        add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
        add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
-       add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterIEC1), MeterIEC1);
-       add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterIEC2), MeterIEC2);
-       add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterVU),   MeterVU);
 
        MeterType cmt = _route->meter_type();
        const std::string cmn = ArdourMeter::meter_type_string(cmt);
index dec072b067fa68f430a95677e82c0d2f896760bb..6128780cf03dda5837d9d8f175467f5549ff19c5 100644 (file)
@@ -2135,9 +2135,6 @@ MixerStrip::popup_level_meter_menu (GdkEventButton* ev)
 
        add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
        add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
-       add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterIEC1), MeterIEC1);
-       add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterIEC2), MeterIEC2);
-       add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterVU),   MeterVU);
 
        int _strip_type;
        if (_route->is_master()) {
diff --git a/libs/ardour/ardour/iec1ppmdsp.h b/libs/ardour/ardour/iec1ppmdsp.h
deleted file mode 100644 (file)
index 58dea97..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-    Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __IEC1PPMDSP_H
-#define        __IEC1PPMDSP_H
-
-
-class Iec1ppmdsp
-{
-public:
-
-    Iec1ppmdsp (void);
-    ~Iec1ppmdsp (void);
-
-    void process (float *p, int n);  
-    float read (void);
-    void reset ();
-
-    static void init (float fsamp); 
-
-private:
-
-    float          _z1;          // filter state
-    float          _z2;          // filter state
-    float          _m;           // max value since last read()
-    bool           _res;         // flag to reset m
-
-    static float   _w1;          // attack filter coefficient
-    static float   _w2;          // attack filter coefficient
-    static float   _w3;          // release filter coefficient
-    static float   _g;           // gain factor
-};
-
-
-#endif
diff --git a/libs/ardour/ardour/iec2ppmdsp.h b/libs/ardour/ardour/iec2ppmdsp.h
deleted file mode 100644 (file)
index 3574a8b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-    Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __IEC2PPMDSP_H
-#define        __IEC2PPMDSP_H
-
-
-class Iec2ppmdsp
-{
-public:
-
-    Iec2ppmdsp (void);
-    ~Iec2ppmdsp (void);
-
-    void process (float *p, int n);  
-    float read (void);
-    void reset ();
-
-    static void init (float fsamp); 
-
-private:
-
-    float          _z1;          // filter state
-    float          _z2;          // filter state
-    float          _m;           // max value since last read()
-    bool           _res;         // flag to reset m
-
-    static float   _w1;          // attack filter coefficient
-    static float   _w2;          // attack filter coefficient
-    static float   _w3;          // release filter coefficient
-    static float   _g;           // gain factor
-};
-
-
-#endif
diff --git a/libs/ardour/ardour/kmeterdsp.h b/libs/ardour/ardour/kmeterdsp.h
deleted file mode 100644 (file)
index eca3c76..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-    Copyright (C) 2008-2011 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __KMETERDSP_H
-#define        __KMETERDSP_H
-
-class Kmeterdsp
-{
-public:
-
-    Kmeterdsp (void);
-    ~Kmeterdsp (void);
-
-    void process (float *p, int n);
-    float read ();
-    void reset ();
-
-    static void init (int fsamp);
-
-private:
-
-    float          _z1;          // filter state
-    float          _z2;          // filter state
-    float          _rms;         // max rms value since last read()
-    bool           _flag;        // flag set by read(), resets _rms
-
-    static float   _omega;       // ballistics filter constant.
-};
-
-#endif
index 4ac140fd04d75661b66032811888283b5f8d4d78..31ebc76179800e925656f6548ee0b0b0dfc48038 100644 (file)
 #include "ardour/types.h"
 #include "ardour/processor.h"
 #include "pbd/fastlog.h"
-
-#include "ardour/kmeterdsp.h"
-#include "ardour/iec1ppmdsp.h"
-#include "ardour/iec2ppmdsp.h"
-#include "ardour/vumeterdsp.h"
+#include "kmeterdsp.h"
 
 namespace ARDOUR {
 
@@ -108,11 +104,7 @@ private:
        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;
 };
index df7209b5810e96a5019888ad809d1fcc1c0ce6e1..05d6d0b27d47563ca2950c5785f3afec74eda217 100644 (file)
@@ -181,10 +181,7 @@ namespace ARDOUR {
                MeterMaxSignal = 0x01,
                MeterMaxPeak   = 0x02,
                MeterPeak      = 0x04,
-               MeterKrms      = 0x08,
-               MeterIEC1      = 0x10,
-               MeterIEC2      = 0x20,
-               MeterVU        = 0x40
+               MeterKrms      = 0x08
        };
 
        enum TrackMode {
diff --git a/libs/ardour/ardour/vumeterdsp.h b/libs/ardour/ardour/vumeterdsp.h
deleted file mode 100644 (file)
index 86487e8..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-    Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __VUMETERDSP_H
-#define        __VUMETERDSP_H
-
-
-class Vumeterdsp
-{
-public:
-
-    Vumeterdsp (void);
-    ~Vumeterdsp (void);
-
-    void process (float *p, int n);  
-    float read (void);
-    void reset ();
-
-    static void init (float fsamp); 
-
-private:
-
-    float          _z1;          // filter state
-    float          _z2;          // filter state
-    float          _m;           // max value since last read()
-    bool           _res;         // flag to reset m
-
-    static float   _w;           // lowpass filter coefficient
-    static float   _g;           // gain factor
-};
-
-
-#endif
index 12eb59ce65c2b0ae9bbf4dbf4d52d408eab500fb..495ff0b4c350d5e1e953bc17b04f53513edce7e2 100644 (file)
@@ -177,9 +177,6 @@ setup_enum_writer ()
        REGISTER_ENUM (MeterMaxPeak);
        REGISTER_ENUM (MeterPeak);
        REGISTER_ENUM (MeterKrms);
-       REGISTER_ENUM (MeterIEC1);
-       REGISTER_ENUM (MeterIEC2);
-       REGISTER_ENUM (MeterVU);
        REGISTER (_MeterType);
 
        REGISTER_ENUM (Normal);
diff --git a/libs/ardour/iec1ppmdsp.cc b/libs/ardour/iec1ppmdsp.cc
deleted file mode 100644 (file)
index bed8250..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-    Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include <math.h>
-#include "ardour/iec1ppmdsp.h"
-
-
-float Iec1ppmdsp::_w1;
-float Iec1ppmdsp::_w2;
-float Iec1ppmdsp::_w3;
-float Iec1ppmdsp::_g;
-
-
-Iec1ppmdsp::Iec1ppmdsp (void) :
-    _z1 (0),
-    _z2 (0),
-    _m (0),
-    _res (true)
-{
-}
-
-
-Iec1ppmdsp::~Iec1ppmdsp (void)
-{
-}
-
-
-void Iec1ppmdsp::process (float *p, int n)
-{
-    float z1, z2, m, t;
-
-    z1 = _z1;
-    z2 = _z2;
-    m = _res ? 0: _m;
-    _res = false;
-
-    n /= 4;
-    while (n--)
-    {
-       z1 *= _w3;
-       z2 *= _w3;
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = z1 + z2;
-       if (t > m) m = t;
-    }
-
-    _z1 = z1 + 1e-10f;
-    _z2 = z2 + 1e-10f;
-    _m = m;
-}
-
-
-float Iec1ppmdsp::read (void)
-{
-    _res = true;
-    return _g * _m;
-}
-
-void Iec1ppmdsp::reset ()
-{
-    _z1 = _z2 = _m = .0f;
-    _res = true;
-}
-
-void Iec1ppmdsp::init (float fsamp)
-{
-    _w1 =  450.0f / fsamp;
-    _w2 = 1300.0f / fsamp;
-    _w3 = 1.0f - 5.4f / fsamp;
-    _g  = 0.5108f;
-}
-
-/* vi:set ts=8 sts=8 sw=4: */
diff --git a/libs/ardour/iec2ppmdsp.cc b/libs/ardour/iec2ppmdsp.cc
deleted file mode 100644 (file)
index 76862cc..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-    Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include <math.h>
-#include "ardour/iec2ppmdsp.h"
-
-
-float Iec2ppmdsp::_w1;
-float Iec2ppmdsp::_w2;
-float Iec2ppmdsp::_w3;
-float Iec2ppmdsp::_g;
-
-
-Iec2ppmdsp::Iec2ppmdsp (void) :
-    _z1 (0),
-    _z2 (0),
-    _m (0),
-    _res (true)
-{
-}
-
-
-Iec2ppmdsp::~Iec2ppmdsp (void)
-{
-}
-
-
-void Iec2ppmdsp::process (float *p, int n)
-{
-    float z1, z2, m, t;
-
-    z1 = _z1;
-    z2 = _z2;
-    m = _res ? 0: _m;
-    _res = false;
-
-    n /= 4;
-    while (n--)
-    {
-       z1 *= _w3;
-       z2 *= _w3;
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = fabsf (*p++);
-       if (t > z1) z1 += _w1 * (t - z1);
-       if (t > z2) z2 += _w2 * (t - z2);
-       t = z1 + z2;
-       if (t > m) m = t;
-    }
-
-    _z1 = z1 + 1e-10f;
-    _z2 = z2 + 1e-10f;
-    _m = m;
-}
-
-
-float Iec2ppmdsp::read (void)
-{
-    _res = true;
-    return _g * _m;
-}
-
-void Iec2ppmdsp::reset ()
-{
-    _z1 = _z2 = _m = .0f;
-    _res = true;
-}
-
-void Iec2ppmdsp::init (float fsamp)
-{
-    _w1 = 200.0f / fsamp;
-    _w2 = 860.0f / fsamp;
-    _w3 = 1.0f - 4.0f / fsamp;
-    _g = 0.5141f;
-}
-
-/* vi:set ts=8 sts=8 sw=4: */
index 2490ae34ec06f39b130aead7ce67d59815db1e13..77d1a87a8135dfee1b2b7fe01bfdc9a800e333e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
     Copyright (C) 2008-2011 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
+               Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <math.h>
-#include "ardour/kmeterdsp.h"
 
+#include <math.h>
+#include "kmeterdsp.h"
 
 float  Kmeterdsp::_omega;
 
-
 Kmeterdsp::Kmeterdsp (void) :
     _z1 (0),
     _z2 (0),
@@ -37,10 +36,6 @@ Kmeterdsp::~Kmeterdsp (void)
 {
 }
 
-void Kmeterdsp::init (int fsamp)
-{
-    _omega = 9.72f / fsamp; // ballistic filter coefficient
-}
 
 void Kmeterdsp::process (float *p, int n)
 {
@@ -98,6 +93,7 @@ void Kmeterdsp::process (float *p, int n)
     if (s > _rms) _rms = s;
 }
 
+
 /* Returns highest _rms value since last call */
 float Kmeterdsp::read ()
 {
@@ -106,10 +102,15 @@ float Kmeterdsp::read ()
     return rv;
 }
 
+void Kmeterdsp::init (int fsamp)
+{
+    _omega = 9.72f / fsamp; // ballistic filter coefficient
+}
+
 void Kmeterdsp::reset ()
 {
-    _z1 = _z2 = _rms = .0f;
-    _flag = false;
+    _z1 = _z2 = _rms = 0.0;
+    _flag=false;
 }
 
-/* vi:set ts=8 sts=8 sw=4: */
+/* vi:set ts=8 sts=8 sw=8: */
diff --git a/libs/ardour/kmeterdsp.h b/libs/ardour/kmeterdsp.h
new file mode 100644 (file)
index 0000000..9c2309e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    Copyright (C) 2008-2011 Fons Adriaensen <fons@linuxaudio.org>
+               Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __KMETERDSP_H
+#define        __KMETERDSP_H
+
+class Kmeterdsp
+{
+public:
+
+    Kmeterdsp (void);
+    ~Kmeterdsp (void);
+
+    void process (float *p, int n);
+    float read ();
+    static void init (int fsamp);
+    void reset ();
+
+private:
+
+    float          _z1;          // filter state
+    float          _z2;          // filter state
+    float          _rms;         // max rms value since last read()
+    bool           _flag;        // flag set by read(), resets _rms
+
+    static float   _omega;       // ballistics filter constant.
+};
+
+#endif
index 383a5bdfad7ccb96d592a92855416c1a919f8935..f239a1c4b7025075009d33e568443bd4bee643d0 100644 (file)
@@ -40,22 +40,13 @@ PeakMeter::PeakMeter (Session& s, const std::string& name)
     : Processor (s, string_compose ("meter-%1", name))
 {
        Kmeterdsp::init(s.nominal_frame_rate());
-       Iec1ppmdsp::init(s.nominal_frame_rate());
-       Iec2ppmdsp::init(s.nominal_frame_rate());
-       Vumeterdsp::init(s.nominal_frame_rate());
 }
 
 PeakMeter::~PeakMeter ()
 {
        while (_kmeter.size() > 0) {
                delete (_kmeter.back());
-               delete (_iec1meter.back());
-               delete (_iec2meter.back());
-               delete (_vumeter.back());
                _kmeter.pop_back();
-               _iec1meter.pop_back();
-               _iec2meter.pop_back();
-               _vumeter.pop_back();
        }
 }
 
@@ -109,15 +100,6 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
                if (_meter_type & MeterKrms) {
                        _kmeter[i]->process(bufs.get_audio(i).data(), nframes);
                }
-               if (_meter_type & MeterIEC1) {
-                       _iec1meter[i]->process(bufs.get_audio(i).data(), nframes);
-               }
-               if (_meter_type & MeterIEC2) {
-                       _iec2meter[i]->process(bufs.get_audio(i).data(), nframes);
-               }
-               if (_meter_type & MeterVU) {
-                       _vumeter[i]->process(bufs.get_audio(i).data(), nframes);
-               }
        }
 
        // Zero any excess peaks
@@ -185,9 +167,6 @@ PeakMeter::reflect_inputs (const ChanCount& in)
 
        for (size_t n = 0; n < n_audio; ++n) {
                _kmeter[n]->reset();
-               _iec1meter[n]->reset();
-               _iec2meter[n]->reset();
-               _vumeter[n]->reset();
        }
 
        reset_max();
@@ -223,24 +202,12 @@ PeakMeter::reset_max_channels (const ChanCount& chn)
        /* alloc/free other audio-only meter types. */
        while (_kmeter.size() > n_audio) {
                delete (_kmeter.back());
-               delete (_iec1meter.back());
-               delete (_iec2meter.back());
-               delete (_vumeter.back());
                _kmeter.pop_back();
-               _iec1meter.pop_back();
-               _iec2meter.pop_back();
-               _vumeter.pop_back();
        }
        while (_kmeter.size() < n_audio) {
                _kmeter.push_back(new Kmeterdsp());
-               _iec1meter.push_back(new Iec1ppmdsp());
-               _iec2meter.push_back(new Iec2ppmdsp());
-               _vumeter.push_back(new Vumeterdsp());
        }
        assert(_kmeter.size() == n_audio);
-       assert(_iec1meter.size() == n_audio);
-       assert(_iec2meter.size() == n_audio);
-       assert(_vumeter.size() == n_audio);
 }
 
 /** To be driven by the Meter signal from IO.
@@ -312,51 +279,32 @@ PeakMeter::meter_level(uint32_t n, MeterType type) {
        switch (type) {
                case MeterKrms:
                        {
-                               const uint32_t n_midi = current_meters.n_midi();
+                               const uint32_t n_midi  = current_meters.n_midi();
                                if ((n - n_midi) < _kmeter.size() && (n - n_midi) >= 0) {
-                                       return accurate_coefficient_to_dB (_kmeter[n - n_midi]->read());
-                               }
-                       }
-                       break;
-               case MeterIEC1:
-                       {
-                               const uint32_t n_midi = current_meters.n_midi();
-                               if ((n - n_midi) < _iec1meter.size() && (n - n_midi) >= 0) {
-                                       return accurate_coefficient_to_dB (_iec1meter[n - n_midi]->read());
-                               }
-                       }
-                       break;
-               case MeterIEC2:
-                       {
-                               const uint32_t n_midi = current_meters.n_midi();
-                               if ((n - n_midi) < _iec2meter.size() && (n - n_midi) >= 0) {
-                                       return accurate_coefficient_to_dB (_iec2meter[n - n_midi]->read());
+#if 0
+                                       return fast_coefficient_to_dB (_kmeter[n-n_midi]->read());
+#else
+                                       return accurate_coefficient_to_dB (_kmeter[n-n_midi]->read());
+#endif
                                }
+                               return minus_infinity();
                        }
-                       break;
-               case MeterVU:
-                       {
-                               const uint32_t n_midi = current_meters.n_midi();
-                               if ((n - n_midi) < _vumeter.size() && (n - n_midi) >= 0) {
-                                       return accurate_coefficient_to_dB (_vumeter[n - n_midi]->read());
-                               }
-                       }
-                       break;
                case MeterPeak:
                        return peak_power(n);
                case MeterMaxSignal:
                        if (n < _max_peak_signal.size()) {
                                return _max_peak_signal[n];
+                       } else {
+                               return minus_infinity();
                        }
-                       break;
                default:
                case MeterMaxPeak:
                        if (n < _max_peak_power.size()) {
                                return _max_peak_power[n];
+                       } else {
+                               return minus_infinity();
                        }
-                       break;
        }
-       return minus_infinity();
 }
 
 void
@@ -374,25 +322,6 @@ PeakMeter::set_type(MeterType t)
                        _kmeter[n]->reset();
                }
        }
-       if (t & MeterIEC1) {
-               const size_t n_audio = current_meters.n_audio();
-               for (size_t n = 0; n < n_audio; ++n) {
-                       _iec1meter[n]->reset();
-               }
-       }
-       if (t & MeterIEC2) {
-               const size_t n_audio = current_meters.n_audio();
-               for (size_t n = 0; n < n_audio; ++n) {
-                       _iec2meter[n]->reset();
-               }
-       }
-       if (t & MeterVU) {
-               const size_t n_audio = current_meters.n_audio();
-               for (size_t n = 0; n < n_audio; ++n) {
-                       _vumeter[n]->reset();
-               }
-       }
-
        TypeChanged(t);
 }
 
diff --git a/libs/ardour/vumeterdsp.cc b/libs/ardour/vumeterdsp.cc
deleted file mode 100644 (file)
index 67d48f6..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-    Copyright (C) 2012 Fons Adriaensen <fons@linuxaudio.org>
-    Adopted for Ardour 2013 by Robin Gareus <robin@gareus.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include <math.h>
-#include "ardour/vumeterdsp.h"
-
-
-float Vumeterdsp::_w;
-float Vumeterdsp::_g;
-
-
-Vumeterdsp::Vumeterdsp (void) :
-    _z1 (0),
-    _z2 (0),
-    _m (0),
-    _res (true)
-{
-}
-
-
-Vumeterdsp::~Vumeterdsp (void)
-{
-}
-
-
-void Vumeterdsp::process (float *p, int n)
-{
-    float z1, z2, m, t1, t2;
-
-    z1 = _z1;
-    z2 = _z2;
-    m = _res ? 0: _m;
-    _res = false;
-
-    n /= 4;
-    while (n--)
-    {
-       t2 = z2 / 2;
-       t1 = fabsf (*p++) - t2;
-       z1 += _w * (t1 - z1);
-       t1 = fabsf (*p++) - t2;
-       z1 += _w * (t1 - z1);
-       t1 = fabsf (*p++) - t2;
-       z1 += _w * (t1 - z1);
-       t1 = fabsf (*p++) - t2;
-       z1 += _w * (t1 - z1);
-       z2 += 4 * _w * (z1 - z2);
-       if (z2 > m) m = z2;
-    }
-
-    _z1 = z1;
-    _z2 = z2 + 1e-10f;
-    _m = m;
-}
-
-
-float Vumeterdsp::read (void)
-{
-    _res = true;
-    return _g * _m;
-}
-
-void Vumeterdsp::reset ()
-{
-    _z1 = _z2 = _m = .0f;
-    _res = true;
-}
-
-void Vumeterdsp::init (float fsamp)
-{
-    _w = 11.1f / fsamp; 
-    _g = 1.5f * 1.571f;
-}
index f81f2c848e04507d634f47410571fa86b8a0ccba..131dda520bca5f26952184fc4df956d250d3cb9a 100644 (file)
@@ -91,8 +91,6 @@ libardour_sources = [
         'globals.cc',
         'graph.cc',
         'graphnode.cc',
-        'iec1ppmdsp.cc',
-        'iec2ppmdsp.cc',
         'import.cc',
         'instrument_info.cc',
         'internal_return.cc',
@@ -208,7 +206,6 @@ libardour_sources = [
         'user_bundle.cc',
         'utils.cc',
         'version.cc',
-        'vumeterdsp.cc',
         'worker.cc'
 ]