4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "bcmeter.inc"
26 #include "bcsubwindow.h"
36 // Distance from subwindow border to top and bottom tick mark
37 #define METER_MARGIN 0
39 class BC_Meter : public BC_SubWindow
48 int mode, /* = METER_DB, */
49 int use_titles, /* = 0, */
50 int span, /* = -1 width for vertical mode only */
56 // Number of updates before over dissappears
57 int over_delay, /* = 150, */
58 // Number of updates before peak updates
59 int peak_delay /* = 15 */);
60 void set_images(VFrame **data);
61 int region_pixel(int region);
62 int region_pixels(int region);
63 virtual int button_press_event();
65 static int get_title_w();
66 static int get_meter_w();
67 int update(float new_value, int over, int dmix=-1);
68 int reposition_window(int x,
70 int span /* = -1 for vertical mode only */,
72 int reset(int dmix=-1);
74 int change_format(int mode, int min, int max);
77 void draw_titles(int flush);
78 void draw_face(int flush);
79 int level_to_pixel(float level);
82 BC_Pixmap *images[TOTAL_METER_IMAGES];
84 // Number of pixels in the longest dimension
86 // Width if variable width
92 // Tick mark positions
93 ArrayList<int> tick_pixels;
95 ArrayList<int> title_pixels;
96 ArrayList<char*> db_titles;
107 int peak_pixel, level_pixel, peak_pixel1, peak_pixel2;
108 int over_count, over_timer;
111 int over_delay; // Number of updates the over warning lasts.
112 int peak_delay; // Number of updates the peak lasts.