2 Copyright (C) 2011-2016 Paul Davis
3 Author: Carl Hetherington <cth@carlh.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_push2_level_meter_h__
21 #define __ardour_push2_level_meter_h__
23 #include "canvas/container.h"
24 #include "canvas/meter.h"
31 namespace ArdourCanvas {
35 namespace ArdourSurface
40 class LevelMeter : public ArdourCanvas::Container, public sigc::trackable
43 LevelMeter (Push2& p2, Item* parent, int len, ArdourCanvas::Meter::Orientation o = ArdourCanvas::Meter::Vertical);
44 virtual ~LevelMeter ();
46 virtual void set_meter (ARDOUR::PeakMeter* meter);
48 void update_gain_sensitive ();
50 float update_meters ();
51 void update_meters_falloff ();
52 void clear_meters (bool reset_highlight = true);
54 void setup_meters (int len=0, int width=3, int thin=2);
55 void set_max_audio_meter_count (uint32_t cnt = 0);
57 void set_type (ARDOUR::MeterType);
58 ARDOUR::MeterType get_type () { return meter_type; }
62 ARDOUR::PeakMeter* _meter;
63 ArdourCanvas::Meter::Orientation _meter_orientation;
64 ArdourCanvas::Box* meter_packer;
67 ArdourCanvas::Meter* meter;
82 guint16 regular_meter_width;
84 guint16 thin_meter_width;
85 std::vector<MeterInfo> meters;
87 ARDOUR::MeterType meter_type;
88 ARDOUR::MeterType visible_meter_type;
91 uint32_t max_visible_meters;
93 PBD::ScopedConnection _configuration_connection;
94 PBD::ScopedConnection _meter_type_connection;
95 PBD::ScopedConnection _parameter_connection;
97 void hide_all_meters ();
99 void parameter_changed (std::string);
100 void configuration_changed (ARDOUR::ChanCount in, ARDOUR::ChanCount out);
101 void meter_type_changed (ARDOUR::MeterType);
106 #endif /* __ardour_push2_level_meter_h__ */