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.
21 #ifndef __ardour_gtk_gain_meter_h__
22 #define __ardour_gtk_gain_meter_h__
26 #include <ardour/types.h>
29 #include <gtkmm2ext/slider_controller.h>
30 #include <gtkmm2ext/click_box.h>
46 class GainMeter : public Gtk::VBox
49 GainMeter (ARDOUR::IO&, ARDOUR::Session&);
52 void update_gain_sensitive ();
54 void update_meters ();
55 void update_meters_falloff ();
57 void effective_gain_display ();
59 void set_width (Width);
62 void set_meter_strip_name (string name);
63 void set_fader_name (string name);
67 ARDOUR::Session& _session;
71 Gtkmm2ext::VSliderController *gain_slider;
72 Gtk::Adjustment gain_adjustment;
73 Gtk::Frame gain_display_frame;
74 Gtkmm2ext::ClickBox gain_display;
75 Gtk::Frame peak_display_frame;
76 Gtk::EventBox peak_display;
77 Gtk::Label peak_display_label;
78 Gtk::Button gain_unit_button;
79 Gtk::Label gain_unit_label;
80 Gtk::HBox gain_display_box;
82 Gtk::DrawingArea meter_metric_area;
83 Gtk::Button meter_point_button;
84 Gtk::Label meter_point_label;
88 gint meter_metrics_expose (GdkEventExpose *);
90 static void _gain_printer (char buf[32], Gtk::Adjustment&, void *);
91 void gain_printer (char buf[32], Gtk::Adjustment&);
94 Gtkmm2ext::FastMeter *meter;
105 static const guint16 regular_meter_width = 5;
106 static const guint16 thin_meter_width = 2;
107 vector<MeterInfo> meters;
112 Gtk::HBox meter_packer;
114 void gain_adjusted ();
115 void gain_changed (void *);
117 void meter_point_clicked ();
118 void meter_changed (void *);
119 void gain_unit_changed ();
121 void hide_all_meters ();
123 gint meter_button_press (GdkEventButton*, uint32_t);
124 gint meter_button_release (GdkEventButton*, uint32_t);
126 gint peak_button_release (GdkEventButton*);
128 Gtk::Menu* meter_menu;
129 void popup_meter_menu (GdkEventButton*);
131 gint start_gain_touch (GdkEventButton*);
132 gint end_gain_touch (GdkEventButton*);
134 void set_mix_group_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint);
135 void set_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint);
136 gint meter_release (GdkEventButton*);
137 gint meter_press (GdkEventButton*);
138 bool wait_for_release;
139 ARDOUR::MeterPoint old_meter_point;
141 void meter_hold_changed();
143 void reset_peak_display ();
144 void reset_group_peak_display (ARDOUR::RouteGroup*);
146 static sigc::signal<void> ResetAllPeakDisplays;
147 static sigc::signal<void,ARDOUR::RouteGroup*> ResetGroupPeakDisplays;
149 static Gtkmm2ext::Pix* slider_pix;
150 static int setup_slider_pix ();
153 #endif /* __ardour_gtk_gain_meter_h__ */