Remove idiocy.
[ardour2.git] / gtk2_ardour / level_meter.h
blobbf0e081ccec5ccff2b72fd3c2e44cecc249d2743
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>
25 #include <gtkmm/box.h>
26 #include <gtkmm/adjustment.h>
27 #include <gtkmm/frame.h>
28 #include <gtkmm/eventbox.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/drawingarea.h>
33 #include "ardour/types.h"
35 #include <gtkmm2ext/click_box.h>
36 #include <gtkmm2ext/focus_entry.h>
37 #include <gtkmm2ext/slider_controller.h>
39 #include "enums.h"
41 namespace ARDOUR {
42 class Session;
43 class PeakMeter;
45 namespace Gtkmm2ext {
46 class FastMeter;
48 namespace Gtk {
49 class Menu;
52 class LevelMeter : public Gtk::HBox
54 public:
55 LevelMeter (ARDOUR::Session&);
56 ~LevelMeter ();
58 virtual void set_meter (ARDOUR::PeakMeter* meter);
60 void update_gain_sensitive ();
62 float update_meters ();
63 void update_meters_falloff ();
64 void clear_meters ();
65 void hide_meters ();
66 void setup_meters (int len=0, int width=3);
68 private:
69 ARDOUR::Session& _session;
70 ARDOUR::PeakMeter* _meter;
72 Width _width;
74 struct MeterInfo {
75 Gtkmm2ext::FastMeter *meter;
76 gint16 width;
77 int length;
78 bool packed;
80 MeterInfo() {
81 meter = 0;
82 width = 0;
83 length = 0;
84 packed = false;
88 guint16 regular_meter_width;
89 int meter_length;
90 static const guint16 thin_meter_width = 2;
91 std::vector<MeterInfo> meters;
92 float max_peak;
94 sigc::connection _configuration_connection;
96 void hide_all_meters ();
97 gint meter_button_release (GdkEventButton*, uint32_t);
99 void parameter_changed (std::string);
100 void configuration_changed (ARDOUR::ChanCount in, ARDOUR::ChanCount out);
102 void on_theme_changed ();
103 bool style_changed;
104 bool color_changed;
105 void color_handler ();
108 #endif /* __ardour_gtk_track_meter_h__ */