plugin manager: filter-by-type really is filter-by-category, so fix the naming and...
[ardour2.git] / gtk2_ardour / level_meter.h
blob521b9d1d8f10e5c766d65486f72a371b20d68374
1 /*
2 Copyright (C) 2002 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_gtk_track_meter_h__
21 #define __ardour_gtk_track_meter_h__
23 #include <vector>
24 #include <map>
26 #include <gtkmm/box.h>
27 #include <gtkmm/adjustment.h>
28 #include <gtkmm/frame.h>
29 #include <gtkmm/eventbox.h>
30 #include <gtkmm/button.h>
31 #include <gtkmm/table.h>
32 #include <gtkmm/drawingarea.h>
34 #include <ardour/types.h>
36 #include <gtkmm2ext/click_box.h>
37 #include <gtkmm2ext/focus_entry.h>
38 #include <gtkmm2ext/slider_controller.h>
40 #include "enums.h"
42 namespace ARDOUR {
43 class IO;
44 class Session;
45 class Route;
46 class RouteGroup;
48 namespace Gtkmm2ext {
49 class FastMeter;
50 class BarController;
52 namespace Gtk {
53 class Menu;
56 class LevelMeter : public Gtk::HBox
58 public:
59 LevelMeter (ARDOUR::Session&);
60 ~LevelMeter ();
62 virtual void set_io (boost::shared_ptr<ARDOUR::IO> io);
64 void update_gain_sensitive ();
66 float update_meters ();
67 void update_meters_falloff ();
68 void clear_meters ();
69 void hide_meters ();
70 void setup_meters (int len=0, int width=3);
72 private:
74 //friend class MixerStrip;
75 boost::shared_ptr<ARDOUR::IO> _io;
76 ARDOUR::Session& _session;
78 Width _width;
80 struct MeterInfo {
81 Gtkmm2ext::FastMeter *meter;
82 gint16 width;
83 int length;
84 bool packed;
86 MeterInfo() {
87 meter = 0;
88 width = 0;
89 length = 0;
90 packed = false;
94 guint16 regular_meter_width;
95 static const guint16 thin_meter_width = 2;
96 vector<MeterInfo> meters;
97 float max_peak;
99 void hide_all_meters ();
100 gint meter_button_release (GdkEventButton*, uint32_t);
102 void parameter_changed (const char*);
104 void on_theme_changed ();
105 bool style_changed;
106 bool color_changed;
107 void color_handler ();
110 #endif /* __ardour_gtk_track_meter_h__ */