copy/paste behavior tweaks
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / meterpanel.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2011 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 METERPANEL_H
23 #define METERPANEL_H
24
25 #include "guicast.h"
26 #include "mwindow.inc"
27 #include "theme.inc"
28
29 class MeterReset;
30 class MeterMeter;
31
32 class MeterPanel
33 {
34 public:
35         MeterPanel(MWindow *mwindow,
36                 BC_WindowBase *subwindow,
37                 int x,
38                 int y,
39                 int w, /* Ignored if -1 */
40                 int h,
41                 int meter_count,
42                 int visible,
43                 int use_headroom /* = 0 */,
44                 int use_titles);
45         virtual ~MeterPanel();
46
47         void create_objects();
48         int set_meters(int meter_count, int visible);
49         static int get_meters_width(Theme *theme, int meter_count, int visible);
50         void reposition_window(int x,
51                 int y,
52                 int w,  /* Ignored if -1 */
53                 int h);
54         int get_title_x(int number, const char *text);
55         int get_reset_x();
56         int get_reset_y();
57         int get_meter_h();
58 // Calculate meter width without border
59         int get_meter_w(int number);
60         void update(double *levels);
61         void init_meters(int dmix);
62         void update_peak(int number, float value);
63         void stop_meters();
64         void change_format(int mode, int min, int max);
65         virtual int change_status_event(int new_status);
66         void reset_meters();
67
68         MWindow *mwindow;
69         BC_WindowBase *subwindow;
70         ArrayList<MeterMeter*> meters;
71         ArrayList<BC_Title*> meter_titles;
72         ArrayList<float> meter_peaks;
73         MeterReset *reset;
74         int meter_count;
75         int visible;
76         int x, y, w, h;
77         int use_headroom;
78         int use_titles;
79 };
80
81
82 class MeterReset : public BC_Button
83 {
84 public:
85         MeterReset(MWindow *mwindow, MeterPanel *panel, int x, int y);
86         ~MeterReset();
87         int handle_event();
88         MWindow *mwindow;
89         MeterPanel *panel;
90 };
91
92 class MeterShow : public BC_Toggle
93 {
94 public:
95         MeterShow(MWindow *mwindow, MeterPanel *panel, int x, int y);
96         ~MeterShow();
97         int handle_event();
98         MWindow *mwindow;
99         MeterPanel *panel;
100 };
101
102 class MeterMeter : public BC_Meter
103 {
104 public:
105         MeterMeter(MWindow *mwindow,
106                 MeterPanel *panel,
107                 int x,
108                 int y,
109                 int w,
110                 int h,
111                 int titles);
112         ~MeterMeter();
113
114         int button_press_event();
115
116         MWindow *mwindow;
117         MeterPanel *panel;
118 };
119
120 #endif