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.
22 #include <ardour/io.h>
23 #include <ardour/route.h>
24 #include <ardour/route_group.h>
25 #include <ardour/session.h>
26 #include <ardour/session_route.h>
27 #include <ardour/dB.h>
29 #include <gtkmm2ext/utils.h>
30 #include <gtkmm2ext/fastmeter.h>
31 #include <gtkmm2ext/stop_signal.h>
32 #include <gtkmm2ext/barcontroller.h>
33 #include <midi++/manager.h>
34 #include <pbd/fastlog.h>
36 #include "ardour_ui.h"
37 #include "gain_meter.h"
40 #include "gui_thread.h"
42 #include "public_editor.h"
44 #include <ardour/session.h>
45 #include <ardour/route.h>
49 using namespace ARDOUR
;
51 using namespace Gtkmm2ext
;
56 sigc::signal
<void> GainMeterBase::ResetAllPeakDisplays
;
57 sigc::signal
<void,RouteGroup
*> GainMeterBase::ResetGroupPeakDisplays
;
59 map
<string
,Glib::RefPtr
<Gdk::Pixmap
> > GainMeter::metric_pixmaps
;
60 Glib::RefPtr
<Gdk::Pixbuf
> GainMeter::slider
;
64 GainMeter::setup_slider_pix ()
66 if ((slider
= ::get_icon ("fader_belt")) == 0) {
67 throw failed_constructor();
71 GainMeterBase::GainMeterBase (Session
& s
,
72 const Glib::RefPtr
<Gdk::Pixbuf
>& pix
,
75 // 0.781787 is the value needed for gain to be set to 0.
76 gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1),
77 gain_automation_style_button (""),
78 gain_automation_state_button ("")
81 using namespace Menu_Helpers
;
83 ignore_toggle
= false;
85 next_release_selects
= false;
90 gain_slider
= manage (new HSliderController (pix
,
94 gain_slider
= manage (new VSliderController (pix
,
99 level_meter
= new LevelMeter(_session
);
101 gain_slider
->signal_button_press_event().connect (mem_fun(*this, &GainMeter::start_gain_touch
));
102 gain_slider
->signal_button_release_event().connect (mem_fun(*this, &GainMeter::end_gain_touch
));
103 gain_slider
->set_name ("GainFader");
105 gain_display
.set_name ("MixerStripGainDisplay");
106 gain_display
.set_has_frame (false);
107 set_size_request_to_display_given_text (gain_display
, "-80.g", 2, 6); /* note the descender */
108 gain_display
.signal_activate().connect (mem_fun (*this, &GainMeter::gain_activated
));
109 gain_display
.signal_focus_in_event().connect (mem_fun (*this, &GainMeter::gain_focused
), false);
110 gain_display
.signal_focus_out_event().connect (mem_fun (*this, &GainMeter::gain_focused
), false);
112 peak_display
.set_name ("MixerStripPeakDisplay");
113 // peak_display.set_has_frame (false);
114 // peak_display.set_editable (false);
115 set_size_request_to_display_given_text (peak_display
, "-80.g", 2, 6); /* note the descender */
116 max_peak
= minus_infinity();
117 peak_display
.set_label (_("-inf"));
118 peak_display
.unset_flags (Gtk::CAN_FOCUS
);
120 gain_automation_style_button
.set_name ("MixerAutomationModeButton");
121 gain_automation_state_button
.set_name ("MixerAutomationPlaybackButton");
123 ARDOUR_UI::instance()->tooltips().set_tip (gain_automation_state_button
, _("Fader automation mode"));
124 ARDOUR_UI::instance()->tooltips().set_tip (gain_automation_style_button
, _("Fader automation type"));
126 gain_automation_style_button
.unset_flags (Gtk::CAN_FOCUS
);
127 gain_automation_state_button
.unset_flags (Gtk::CAN_FOCUS
);
129 gain_automation_state_button
.set_size_request(15, 15);
130 gain_automation_style_button
.set_size_request(15, 15);
132 gain_astyle_menu
.items().push_back (MenuElem (_("Trim")));
133 gain_astyle_menu
.items().push_back (MenuElem (_("Abs")));
135 gain_astate_menu
.set_name ("ArdourContextMenu");
136 gain_astyle_menu
.set_name ("ArdourContextMenu");
138 gain_adjustment
.signal_value_changed().connect (mem_fun(*this, &GainMeterBase::gain_adjusted
));
139 peak_display
.signal_button_release_event().connect (mem_fun(*this, &GainMeterBase::peak_button_release
), false);
140 gain_display
.signal_key_press_event().connect (mem_fun(*this, &GainMeterBase::gain_key_press
), false);
142 ResetAllPeakDisplays
.connect (mem_fun(*this, &GainMeterBase::reset_peak_display
));
143 ResetGroupPeakDisplays
.connect (mem_fun(*this, &GainMeterBase::reset_group_peak_display
));
145 UI::instance()->theme_changed
.connect (mem_fun(*this, &GainMeterBase::on_theme_changed
));
146 ColorsChanged
.connect (bind(mem_fun (*this, &GainMeterBase::color_handler
), false));
147 DPIReset
.connect (bind(mem_fun (*this, &GainMeterBase::color_handler
), true));
151 GainMeterBase::~GainMeterBase ()
163 GainMeterBase::set_io (boost::shared_ptr
<IO
> io
)
165 connections
.clear ();
169 level_meter
->set_io (_io
);
170 gain_slider
->set_controllable (&_io
->gain_control());
172 boost::shared_ptr
<Route
> r
;
174 if ((r
= boost::dynamic_pointer_cast
<Route
> (_io
)) != 0) {
178 using namespace Menu_Helpers
;
180 gain_astate_menu
.items().clear ();
182 gain_astate_menu
.items().push_back (MenuElem (_("Manual"),
183 bind (mem_fun (*_io
, &IO::set_gain_automation_state
), (AutoState
) Off
)));
184 gain_astate_menu
.items().push_back (MenuElem (_("Play"),
185 bind (mem_fun (*_io
, &IO::set_gain_automation_state
), (AutoState
) Play
)));
186 gain_astate_menu
.items().push_back (MenuElem (_("Write"),
187 bind (mem_fun (*_io
, &IO::set_gain_automation_state
), (AutoState
) Write
)));
188 gain_astate_menu
.items().push_back (MenuElem (_("Touch"),
189 bind (mem_fun (*_io
, &IO::set_gain_automation_state
), (AutoState
) Touch
)));
191 connections
.push_back (gain_automation_style_button
.signal_button_press_event().connect (mem_fun(*this, &GainMeterBase::gain_automation_style_button_event
), false));
192 connections
.push_back (gain_automation_state_button
.signal_button_press_event().connect (mem_fun(*this, &GainMeterBase::gain_automation_state_button_event
), false));
194 connections
.push_back (r
->gain_automation_curve().automation_state_changed
.connect (mem_fun(*this, &GainMeterBase::gain_automation_state_changed
)));
195 connections
.push_back (r
->gain_automation_curve().automation_style_changed
.connect (mem_fun(*this, &GainMeterBase::gain_automation_style_changed
)));
197 gain_automation_state_changed ();
201 connections
.push_back (_io
->gain_changed
.connect (mem_fun(*this, &GainMeterBase::gain_changed
)));
206 update_gain_sensitive ();
210 GainMeterBase::hide_all_meters ()
212 level_meter
->hide_meters();
216 GainMeter::hide_all_meters ()
218 bool remove_metric_area
= false;
220 GainMeterBase::hide_all_meters ();
222 if (remove_metric_area
) {
223 if (meter_metric_area
.get_parent()) {
224 level_meter
->remove (meter_metric_area
);
230 GainMeterBase::setup_meters (int len
)
232 level_meter
->setup_meters(len
, 5);
236 GainMeter::setup_meters (int len
)
238 if (!meter_metric_area
.get_parent()) {
239 level_meter
->pack_end (meter_metric_area
, false, false);
240 meter_metric_area
.show_all ();
242 GainMeterBase::setup_meters (len
);
246 GainMeterBase::gain_key_press (GdkEventKey
* ev
)
248 if (key_is_legal_for_numeric_entry (ev
->keyval
)) {
249 /* drop through to normal handling */
252 /* illegal key for gain entry */
257 GainMeterBase::peak_button_release (GdkEventButton
* ev
)
259 /* reset peak label */
261 if (ev
->button
== 1 && Keyboard::modifier_state_equals (ev
->state
, Keyboard::PrimaryModifier
|Keyboard::TertiaryModifier
)) {
262 ResetAllPeakDisplays ();
263 } else if (ev
->button
== 1 && Keyboard::modifier_state_equals (ev
->state
, Keyboard::PrimaryModifier
)) {
264 boost::shared_ptr
<Route
> r
;
266 if ((r
= boost::dynamic_pointer_cast
<Route
> (_io
)) != 0) {
267 ResetGroupPeakDisplays (r
->mix_group());
270 reset_peak_display ();
277 GainMeterBase::reset_peak_display ()
279 boost::shared_ptr
<Route
> r
;
281 if ((r
= boost::dynamic_pointer_cast
<Route
> (_io
)) != 0) {
282 r
->reset_max_peak_meters();
285 level_meter
->clear_meters();
286 max_peak
= -INFINITY
;
287 peak_display
.set_label (_("-Inf"));
288 peak_display
.set_name ("MixerStripPeakDisplay");
292 GainMeterBase::reset_group_peak_display (RouteGroup
* group
)
294 boost::shared_ptr
<Route
> r
;
296 if ((r
= boost::dynamic_pointer_cast
<Route
> (_io
)) != 0) {
297 if (group
== r
->mix_group()) {
298 reset_peak_display ();
304 GainMeterBase::popup_meter_menu (GdkEventButton
*ev
)
306 using namespace Menu_Helpers
;
308 if (meter_menu
== 0) {
309 meter_menu
= new Gtk::Menu
;
310 MenuList
& items
= meter_menu
->items();
312 items
.push_back (MenuElem ("-inf .. +0dBFS"));
313 items
.push_back (MenuElem ("-10dB .. +0dBFS"));
314 items
.push_back (MenuElem ("-4 .. +0dBFS"));
315 items
.push_back (SeparatorElem());
316 items
.push_back (MenuElem ("-inf .. -2dBFS"));
317 items
.push_back (MenuElem ("-10dB .. -2dBFS"));
318 items
.push_back (MenuElem ("-4 .. -2dBFS"));
321 meter_menu
->popup (1, ev
->time
);
325 GainMeterBase::gain_focused (GdkEventFocus
* ev
)
328 gain_display
.select_region (0, -1);
330 gain_display
.select_region (0, 0);
336 GainMeterBase::gain_activated ()
340 if (sscanf (gain_display
.get_text().c_str(), "%f", &f
) == 1) {
342 /* clamp to displayable values */
346 _io
->set_gain (dB_to_coefficient(f
), this);
348 if (gain_display
.has_focus()) {
349 PublicEditor::instance().reset_focus();
355 GainMeterBase::show_gain ()
359 float v
= gain_adjustment
.get_value();
362 strcpy (buf
, _("-inf"));
364 snprintf (buf
, 32, "%.1f", accurate_coefficient_to_dB (slider_position_to_gain (v
)));
367 gain_display
.set_text (buf
);
371 GainMeterBase::gain_adjusted ()
373 if (!ignore_toggle
) {
374 _io
->set_gain (slider_position_to_gain (gain_adjustment
.get_value()), this);
380 GainMeterBase::effective_gain_display ()
382 gfloat value
= gain_to_slider_position (_io
->effective_gain());
384 if (gain_adjustment
.get_value() != value
) {
385 ignore_toggle
= true;
386 gain_adjustment
.set_value (value
);
387 ignore_toggle
= false;
392 GainMeterBase::gain_changed (void *src
)
394 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &GainMeterBase::effective_gain_display
));
398 GainMeterBase::set_meter_strip_name (const char * name
)
400 meter_metric_area
.set_name (name
);
401 style_changed
= true;
405 GainMeterBase::set_fader_name (const char * name
)
407 gain_slider
->set_name (name
);
411 GainMeterBase::update_gain_sensitive ()
413 static_cast<Gtkmm2ext::SliderController
*>(gain_slider
)->set_sensitive (!(_io
->gain_automation_state() & Play
));
418 next_meter_point (MeterPoint mp
)
422 return MeterPreFader
;
426 return MeterPostFader
;
438 GainMeterBase::meter_press(GdkEventButton
* ev
)
440 boost::shared_ptr
<Route
> _route
;
442 wait_for_release
= false;
444 if ((_route
= boost::dynamic_pointer_cast
<Route
>(_io
)) == 0) {
448 if (!ignore_toggle
) {
450 if (Keyboard::is_context_menu_event (ev
)) {
452 // no menu at this time.
456 if (Keyboard::is_button2_event(ev
)) {
458 // Primary-button2 click is the midi binding click
459 // button2-click is "momentary"
461 if (!Keyboard::modifier_state_equals (ev
->state
, Keyboard::ModifierMask (Keyboard::PrimaryModifier
))) {
462 wait_for_release
= true;
463 old_meter_point
= _route
->meter_point ();
467 if (ev
->button
== 1 || Keyboard::is_button2_event (ev
)) {
469 if (Keyboard::modifier_state_equals (ev
->state
, Keyboard::ModifierMask (Keyboard::PrimaryModifier
|Keyboard::TertiaryModifier
))) {
471 /* Primary+Tertiary-click applies change to all routes */
473 _session
.begin_reversible_command (_("meter point change"));
474 Session::GlobalMeteringStateCommand
*cmd
= new Session::GlobalMeteringStateCommand (_session
, this);
475 _session
.foreach_route (this, &GainMeterBase::set_meter_point
, next_meter_point (_route
->meter_point()));
477 _session
.add_command (cmd
);
478 _session
.commit_reversible_command ();
481 } else if (Keyboard::modifier_state_equals (ev
->state
, Keyboard::PrimaryModifier
)) {
483 /* Primary-click: solo mix group.
484 NOTE: Primary-button2 is MIDI learn.
487 if (ev
->button
== 1) {
488 _session
.begin_reversible_command (_("meter point change"));
489 Session::GlobalMeteringStateCommand
*cmd
= new Session::GlobalMeteringStateCommand (_session
, this);
490 set_mix_group_meter_point (*_route
, next_meter_point (_route
->meter_point()));
492 _session
.add_command (cmd
);
493 _session
.commit_reversible_command ();
498 /* click: change just this route */
502 _route
->set_meter_point (next_meter_point (_route
->meter_point()), this);
513 GainMeterBase::meter_release(GdkEventButton
* ev
)
516 if (wait_for_release
){
517 wait_for_release
= false;
519 boost::shared_ptr
<Route
> r
;
521 if ((r
= boost::dynamic_pointer_cast
<Route
>(_io
)) != 0) {
522 set_meter_point (*r
, old_meter_point
);
531 GainMeterBase::set_meter_point (Route
& route
, MeterPoint mp
)
533 route
.set_meter_point (mp
, this);
537 GainMeterBase::set_mix_group_meter_point (Route
& route
, MeterPoint mp
)
539 RouteGroup
* mix_group
;
541 if((mix_group
= route
.mix_group()) != 0){
542 mix_group
->apply (&Route::set_meter_point
, mp
, this);
544 route
.set_meter_point (mp
, this);
549 GainMeterBase::meter_point_clicked ()
551 boost::shared_ptr
<Route
> r
;
553 if ((r
= boost::dynamic_pointer_cast
<Route
> (_io
)) != 0) {
559 GainMeterBase::start_gain_touch (GdkEventButton
* ev
)
561 _io
->start_gain_touch ();
566 GainMeterBase::end_gain_touch (GdkEventButton
* ev
)
568 _io
->end_gain_touch ();
573 GainMeterBase::gain_automation_state_button_event (GdkEventButton
*ev
)
575 if (ev
->type
== GDK_BUTTON_RELEASE
) {
579 switch (ev
->button
) {
581 gain_astate_menu
.popup (1, ev
->time
);
591 GainMeterBase::gain_automation_style_button_event (GdkEventButton
*ev
)
593 if (ev
->type
== GDK_BUTTON_RELEASE
) {
597 switch (ev
->button
) {
599 gain_astyle_menu
.popup (1, ev
->time
);
608 GainMeterBase::astate_string (AutoState state
)
610 return _astate_string (state
, false);
614 GainMeterBase::short_astate_string (AutoState state
)
616 return _astate_string (state
, true);
620 GainMeterBase::_astate_string (AutoState state
, bool shrt
)
626 sstr
= (shrt
? "M" : _("M"));
629 sstr
= (shrt
? "P" : _("P"));
632 sstr
= (shrt
? "T" : _("T"));
635 sstr
= (shrt
? "W" : _("W"));
643 GainMeterBase::astyle_string (AutoStyle style
)
645 return _astyle_string (style
, false);
649 GainMeterBase::short_astyle_string (AutoStyle style
)
651 return _astyle_string (style
, true);
655 GainMeterBase::_astyle_string (AutoStyle style
, bool shrt
)
660 /* XXX it might different in different languages */
662 return (shrt
? _("Abs") : _("Abs"));
667 GainMeterBase::gain_automation_style_changed ()
671 gain_automation_style_button
.set_label (astyle_string(_io
->gain_automation_curve().automation_style()));
674 gain_automation_style_button
.set_label (short_astyle_string(_io
->gain_automation_curve().automation_style()));
680 GainMeterBase::gain_automation_state_changed ()
682 ENSURE_GUI_THREAD(mem_fun(*this, &GainMeterBase::gain_automation_state_changed
));
688 gain_automation_state_button
.set_label (astate_string(_io
->gain_automation_curve().automation_state()));
691 gain_automation_state_button
.set_label (short_astate_string(_io
->gain_automation_curve().automation_state()));
695 x
= (_io
->gain_automation_state() != Off
);
697 if (gain_automation_state_button
.get_active() != x
) {
698 ignore_toggle
= true;
699 gain_automation_state_button
.set_active (x
);
700 ignore_toggle
= false;
703 update_gain_sensitive ();
705 /* start watching automation so that things move */
707 gain_watching
.disconnect();
710 gain_watching
= ARDOUR_UI::RapidScreenUpdate
.connect (mem_fun (*this, &GainMeterBase::effective_gain_display
));
715 GainMeterBase::update_meters()
718 float mpeak
= level_meter
->update_meters();
720 if (mpeak
> max_peak
) {
722 if (mpeak
<= -200.0f
) {
723 peak_display
.set_label (_("-inf"));
725 snprintf (buf
, sizeof(buf
), "%.1f", mpeak
);
726 peak_display
.set_label (buf
);
730 peak_display
.set_name ("MixerStripPeakDisplayPeak");
735 void GainMeterBase::color_handler(bool dpi
)
737 color_changed
= true;
738 dpi_changed
= (dpi
) ? true : false;
743 GainMeterBase::set_width (Width w
, int len
)
746 level_meter
->setup_meters (len
);
751 GainMeterBase::on_theme_changed()
753 style_changed
= true;
756 GainMeter::GainMeter (Session
& s
)
757 : GainMeterBase (s
, slider
, false)
759 gain_display_box
.set_homogeneous (true);
760 gain_display_box
.set_spacing (2);
761 gain_display_box
.pack_start (gain_display
, true, true);
763 meter_metric_area
.set_name ("AudioTrackMetrics");
764 set_size_request_to_display_given_text (meter_metric_area
, "-50", 0, 0);
766 gain_automation_style_button
.set_name ("MixerAutomationModeButton");
767 gain_automation_state_button
.set_name ("MixerAutomationPlaybackButton");
769 ARDOUR_UI::instance()->tooltips().set_tip (gain_automation_state_button
, _("Fader automation mode"));
770 ARDOUR_UI::instance()->tooltips().set_tip (gain_automation_style_button
, _("Fader automation type"));
772 gain_automation_style_button
.unset_flags (Gtk::CAN_FOCUS
);
773 gain_automation_state_button
.unset_flags (Gtk::CAN_FOCUS
);
775 gain_automation_state_button
.set_size_request(15, 15);
776 gain_automation_style_button
.set_size_request(15, 15);
778 HBox
* fader_centering_box
= manage (new HBox
);
779 fader_centering_box
->pack_start (*gain_slider
, true, false);
781 fader_vbox
= manage (new Gtk::VBox());
782 fader_vbox
->set_spacing (0);
783 fader_vbox
->pack_start (*fader_centering_box
, false, false, 0);
785 hbox
.set_spacing (2);
786 hbox
.pack_start (*fader_vbox
, true, true);
790 pack_start (gain_display_box
, Gtk::PACK_SHRINK
);
791 pack_start (hbox
, Gtk::PACK_SHRINK
);
793 meter_metric_area
.signal_expose_event().connect (mem_fun(*this, &GainMeter::meter_metrics_expose
));
797 GainMeter::set_io (boost::shared_ptr
<IO
> io
)
799 if (level_meter
->get_parent()) {
800 hbox
.remove (*level_meter
);
803 if (peak_display
.get_parent()) {
804 gain_display_box
.remove (peak_display
);
807 if (gain_automation_state_button
.get_parent()) {
808 fader_vbox
->remove (gain_automation_state_button
);
811 GainMeterBase::set_io (io
);
813 boost::shared_ptr
<Route
> r
;
815 if ((r
= boost::dynamic_pointer_cast
<Route
> (_io
)) != 0) {
818 if we have a non-hidden route (ie. we're not the click or the auditioner),
819 pack some route-dependent stuff.
822 gain_display_box
.pack_end (peak_display
, true, true);
823 hbox
.pack_end (*level_meter
, true, true);
826 fader_vbox
->pack_start (gain_automation_state_button
, false, false, 0);
832 GainMeter::get_gm_width ()
835 hbox
.size_request (sz
);
839 Glib::RefPtr
<Gdk::Pixmap
>
840 GainMeter::render_metrics (Gtk::Widget
& w
)
842 Glib::RefPtr
<Gdk::Window
> win (w
.get_window());
843 Glib::RefPtr
<Gdk::GC
> fg_gc (w
.get_style()->get_fg_gc (Gtk::STATE_NORMAL
));
844 Glib::RefPtr
<Gdk::GC
> bg_gc (w
.get_style()->get_bg_gc (Gtk::STATE_NORMAL
));
846 int db_points
[] = { -50, -40, -20, -30, -10, -3, 0, 4 };
849 win
->get_size (width
, height
);
851 Glib::RefPtr
<Gdk::Pixmap
> pixmap
= Gdk::Pixmap::create (win
, width
, height
);
853 metric_pixmaps
[w
.get_name()] = pixmap
;
855 pixmap
->draw_rectangle (bg_gc
, true, 0, 0, width
, height
);
857 Glib::RefPtr
<Pango::Layout
> layout
= w
.create_pango_layout("");
859 for (uint32_t i
= 0; i
< sizeof (db_points
)/sizeof (db_points
[0]); ++i
) {
861 float fraction
= log_meter (db_points
[i
]);
862 gint pos
= height
- (gint
) floor (height
* fraction
);
864 snprintf (buf
, sizeof (buf
), "%d", abs (db_points
[i
]));
866 layout
->set_text (buf
);
868 /* we want logical extents, not ink extents here */
871 layout
->get_pixel_size (width
, height
);
873 pixmap
->draw_line (fg_gc
, 0, pos
, 4, pos
);
874 pixmap
->draw_layout (fg_gc
, 6, pos
- (height
/2), layout
);
881 GainMeter::meter_metrics_expose (GdkEventExpose
*ev
)
883 static Glib::RefPtr
<Gtk::Style
> meter_style
;
885 meter_style
= meter_metric_area
.get_style();
887 Glib::RefPtr
<Gdk::Window
> win (meter_metric_area
.get_window());
888 Glib::RefPtr
<Gdk::GC
> bg_gc (meter_style
->get_bg_gc (Gtk::STATE_INSENSITIVE
));
889 GdkRectangle base_rect
;
890 GdkRectangle draw_rect
;
893 win
->get_size (width
, height
);
895 base_rect
.width
= width
;
896 base_rect
.height
= height
;
900 Glib::RefPtr
<Gdk::Pixmap
> pixmap
;
901 std::map
<string
,Glib::RefPtr
<Gdk::Pixmap
> >::iterator i
= metric_pixmaps
.find (meter_metric_area
.get_name());
903 if (i
== metric_pixmaps
.end() || style_changed
|| dpi_changed
) {
904 pixmap
= render_metrics (meter_metric_area
);
909 gdk_rectangle_intersect (&ev
->area
, &base_rect
, &draw_rect
);
910 win
->draw_drawable (bg_gc
, pixmap
, draw_rect
.x
, draw_rect
.y
, draw_rect
.x
, draw_rect
.y
, draw_rect
.width
, draw_rect
.height
);
911 style_changed
= false;