2 Copyright (C) 2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __ardour_meter_h__
20 #define __ardour_meter_h__
23 #include <ardour/types.h>
24 #include <pbd/fastlog.h>
33 /** Meters peaks on the input and stores them for access.
37 PeakMeter(Session& s) : _session(s) {}
39 void setup (const ChanCount& in);
44 void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset=0);
46 float peak_power (uint32_t n) {
47 if (n < _visible_peak_power.size()) {
48 return _visible_peak_power[n];
50 return minus_infinity();
54 float max_peak_power (uint32_t n) {
55 if (n < _max_peak_power.size()) {
56 return _max_peak_power[n];
58 return minus_infinity();
68 std::vector<float> _peak_power;
69 std::vector<float> _visible_peak_power;
70 std::vector<float> _max_peak_power;
76 #endif // __ardour_meter_h__