add view thumbnail size pref, rework vicon view popup, add view popup zoom scale
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bcmeter.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef BCMETER_H
23 #define BCMETER_H
24
25 #include "bcmeter.inc"
26 #include "bcsubwindow.h"
27 #include "units.h"
28
29 #define METER_TYPES 2
30
31 #define METER_DB 0
32 #define METER_INT 1
33 #define METER_VERT 0
34 #define METER_HORIZ 1
35
36 // Distance from subwindow border to top and bottom tick mark
37 #define METER_MARGIN 0
38
39 class BC_Meter : public BC_SubWindow
40 {
41 public:
42         BC_Meter(int x,
43                 int y,
44                 int orientation,
45                 int pixels,
46                 int min, /* = -40, */
47                 int max,
48                 int mode, /* = METER_DB, */
49                 int use_titles, /* = 0, */
50                 int span, /* = -1 width for vertical mode only */
51                 int downmix = 0);
52         virtual ~BC_Meter();
53
54         int initialize();
55         int set_delays(
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();
64
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,
69                 int y,
70                 int span /* = -1 for vertical mode only */,
71                 int pixels);
72         int reset(int dmix=-1);
73         int reset_over();
74         int change_format(int mode, int min, int max);
75
76 private:
77         void draw_titles(int flush);
78         void draw_face(int flush);
79         int level_to_pixel(float level);
80         void get_divisions();
81
82         BC_Pixmap *images[TOTAL_METER_IMAGES];
83         int orientation;
84 // Number of pixels in the longest dimension
85         int pixels;
86 // Width if variable width
87         int span;
88         int low_division;
89         int medium_division;
90         int high_division;
91         int use_titles;
92 // Tick mark positions
93         ArrayList<int> tick_pixels;
94 // Title positions
95         ArrayList<int> title_pixels;
96         ArrayList<char*> db_titles;
97         float level, peak;
98         int mode;
99         DB db;
100         int peak_timer;
101
102
103
104
105
106
107         int peak_pixel, level_pixel, peak_pixel1, peak_pixel2;
108         int over_count, over_timer;
109         int min, max;
110         int downmix;
111         int over_delay;       // Number of updates the over warning lasts.
112         int peak_delay;       // Number of updates the peak lasts.
113 };
114
115 #endif