fix plugins using libcolors
[cinelerra_cv/ct.git] / guicast / bcmeter.h
blobe5023445ed1ca1c2a602988ba73d40e48fe1e7c2
1 #ifndef BCMETER_H
2 #define BCMETER_H
4 #include "bcmeter.inc"
5 #include "bcsubwindow.h"
6 #include "units.h"
8 #define METER_TYPES 2
10 #define METER_DB 0
11 #define METER_INT 1
12 #define METER_VERT 0
13 #define METER_HORIZ 1
15 // Distance from subwindow border to top and bottom tick mark
16 #define METER_MARGIN 0
18 class BC_Meter : public BC_SubWindow
20 public:
21 BC_Meter(int x,
22 int y,
23 int orientation,
24 int pixels,
25 int min, /* = -40, */
26 int max,
27 int mode, /* = METER_DB, */
28 int use_titles, /* = 0, */
29 // Number of updates before over dissappears
30 long over_delay, /* = 150, */
31 // Number of updates before peak updates
32 long peak_delay /* = 15 */);
33 virtual ~BC_Meter();
35 int initialize();
36 void set_images(VFrame **data);
37 int set_delays(int over_delay, int peak_delay);
38 int region_pixel(int region);
39 int region_pixels(int region);
40 virtual int button_press_event();
42 static int get_title_w();
43 static int get_meter_w();
44 int update(float new_value, int over);
45 int reposition_window(int x, int y, int pixels);
46 int reset();
47 int reset_over();
48 int change_format(int mode, int min, int max);
50 private:
51 void draw_titles();
52 void draw_face();
53 int level_to_pixel(float level);
54 void get_divisions();
56 BC_Pixmap *images[TOTAL_METER_IMAGES];
57 int orientation;
58 // Number of pixels in the longest dimension
59 int pixels;
60 int low_division;
61 int medium_division;
62 int high_division;
63 int use_titles;
64 // Tick mark positions
65 ArrayList<int> tick_pixels;
66 // Title positions
67 ArrayList<int> title_pixels;
68 ArrayList<char*> db_titles;
69 float level, peak;
70 int mode;
71 DB db;
72 int peak_timer;
79 int peak_pixel, level_pixel, peak_pixel1, peak_pixel2;
80 int over_count, over_timer;
81 int min;
82 int max;
83 long over_delay; // Number of updates the over warning lasts.
84 long peak_delay; // Number of updates the peak lasts.
87 #endif
89 // Local Variables:
90 // mode: C++
91 // c-file-style: "linux"
92 // End: