summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/meter_patterns.cc9
-rw-r--r--gtk2_ardour/meter_strip.cc3
-rw-r--r--gtk2_ardour/mixer_strip.cc3
-rw-r--r--libs/ardour/ardour/iec1ppmdsp.h51
-rw-r--r--libs/ardour/ardour/iec2ppmdsp.h51
-rw-r--r--libs/ardour/ardour/meter.h10
-rw-r--r--libs/ardour/ardour/types.h5
-rw-r--r--libs/ardour/ardour/vumeterdsp.h49
-rw-r--r--libs/ardour/enums.cc3
-rw-r--r--libs/ardour/iec1ppmdsp.cc100
-rw-r--r--libs/ardour/iec2ppmdsp.cc100
-rw-r--r--libs/ardour/kmeterdsp.cc23
-rw-r--r--libs/ardour/kmeterdsp.h (renamed from libs/ardour/ardour/kmeterdsp.h)5
-rw-r--r--libs/ardour/meter.cc93
-rw-r--r--libs/ardour/vumeterdsp.cc89
-rw-r--r--libs/ardour/wscript3
16 files changed, 27 insertions, 570 deletions
diff --git a/gtk2_ardour/meter_patterns.cc b/gtk2_ardour/meter_patterns.cc
index ccf24fcefc..80655af7b9 100644
--- a/gtk2_ardour/meter_patterns.cc
+++ b/gtk2_ardour/meter_patterns.cc
@@ -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;
diff --git a/gtk2_ardour/meter_strip.cc b/gtk2_ardour/meter_strip.cc
index 3a8410867a..44144114a4 100644
--- a/gtk2_ardour/meter_strip.cc
+++ b/gtk2_ardour/meter_strip.cc
@@ -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);
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index dec072b067..6128780cf0 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -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
index 58dea97555..0000000000
--- a/libs/ardour/ardour/iec1ppmdsp.h
+++ /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
index 3574a8bd3f..0000000000
--- a/libs/ardour/ardour/iec2ppmdsp.h
+++ /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/meter.h b/libs/ardour/ardour/meter.h
index 4ac140fd04..31ebc76179 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -23,11 +23,7 @@
#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;
};
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index df7209b581..05d6d0b27d 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -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
index 86487e8e8e..0000000000
--- a/libs/ardour/ardour/vumeterdsp.h
+++ /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
diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc
index 12eb59ce65..495ff0b4c3 100644
--- a/libs/ardour/enums.cc
+++ b/libs/ardour/enums.cc
@@ -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
index bed825048f..0000000000
--- a/libs/ardour/iec1ppmdsp.cc
+++ /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
index 76862cccd2..0000000000
--- a/libs/ardour/iec2ppmdsp.cc
+++ /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: */
diff --git a/libs/ardour/kmeterdsp.cc b/libs/ardour/kmeterdsp.cc
index 2490ae34ec..77d1a87a81 100644
--- a/libs/ardour/kmeterdsp.cc
+++ b/libs/ardour/kmeterdsp.cc
@@ -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
@@ -17,13 +17,12 @@
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/ardour/kmeterdsp.h b/libs/ardour/kmeterdsp.h
index eca3c76695..9c2309e09c 100644
--- a/libs/ardour/ardour/kmeterdsp.h
+++ b/libs/ardour/kmeterdsp.h
@@ -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
@@ -29,9 +29,8 @@ public:
void process (float *p, int n);
float read ();
- void reset ();
-
static void init (int fsamp);
+ void reset ();
private:
diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc
index 383a5bdfad..f239a1c4b7 100644
--- a/libs/ardour/meter.cc
+++ b/libs/ardour/meter.cc
@@ -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
index 67d48f6c54..0000000000
--- a/libs/ardour/vumeterdsp.cc
+++ /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;
-}
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index ea08636ea8..4e7e23aa1a 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -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'
]