/* Copyright (C) 2003 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id$ */ #include #include #include #include #include #include using namespace Gtk; using namespace Gdk; using namespace Glib; using namespace Gtkmm2ext; using namespace std; RefPtr FastMeter::v_pixmap; RefPtr FastMeter::v_mask; gint FastMeter::v_pixheight = 0; gint FastMeter::v_pixwidth = 0; RefPtr FastMeter::h_pixmap; RefPtr FastMeter::h_mask; gint FastMeter::h_pixheight = 0; gint FastMeter::h_pixwidth = 0; FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o) { orientation = o; hold_cnt = hold; hold_state = 0; current_peak = 0; current_level = 0; current_user_level = -100.0f; set_events (BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK); pixrect.x = 0; pixrect.y = 0; if (orientation == Vertical) { pixrect.width = min (v_pixwidth, (gint) dimen); pixrect.height = v_pixheight; } else { pixrect.width = h_pixwidth; pixrect.height = min (h_pixheight, (gint) dimen); } request_width = pixrect.width; request_height= pixrect.height; } FastMeter::~FastMeter () { } void FastMeter::on_realize () { DrawingArea::on_realize(); RefPtr