improve delays created by vicon drawing locks, reset_cache segv fix, gang track toolt...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / zoombar.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 ZOOMBAR_H
23 #define ZOOMBAR_H
24
25 #include "guicast.h"
26 #include "mwindow.inc"
27 #include "mwindowgui.inc"
28 #include "zoombar.inc"
29 #include "zoompanel.h"
30
31
32 class ZoomBar : public BC_SubWindow
33 {
34 public:
35         ZoomBar(MWindow *mwindow, MWindowGUI *gui);
36         ~ZoomBar();
37
38         void create_objects();
39         void resize_event();
40         int draw();
41         int resize_event(int w, int h);
42         void redraw_time_dependancies();
43         int update();          // redraw the current values
44         void update_autozoom();
45         void update_autozoom(int grouptype, int color);
46         void update_autozoom(int color);
47         int update_clocks();
48         int update_playback(int64_t new_position);       // update the playback position
49         int set_selection(int which_one);
50         void update_formatting(BC_TextBox *dst);
51
52         MWindow *mwindow;
53         MWindowGUI *gui;
54         SampleZoomPanel *sample_zoom;
55         AmpZoomPanel *amp_zoom;
56         ATrackZoomPanel *atrack_zoom;
57         VTrackZoomPanel *vtrack_zoom;
58         AutoZoom *auto_zoom;
59         AutoTypeMenu *auto_type;
60         ZoomTextBox *auto_zoom_text;
61
62         LengthTextBox *length_value;
63         FromTextBox *from_value;
64         ToTextBox *to_value;
65         TitleAlphaBar *title_alpha_bar;
66         TitleAlphaText *title_alpha_text;
67         char string[256], string2[256];
68 };
69
70 class SampleZoomPanel : public ZoomPanel
71 {
72 public:
73         SampleZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
74         int handle_event();
75         MWindow *mwindow;
76         ZoomBar *zoombar;
77 };
78
79 class AmpZoomPanel : public ZoomPanel
80 {
81 public:
82         AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
83         int handle_event();
84         MWindow *mwindow;
85         ZoomBar *zoombar;
86 };
87
88 class ATrackZoomPanel : public ZoomPanel
89 {
90 public:
91         ATrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
92         int handle_event();
93         MWindow *mwindow;
94         ZoomBar *zoombar;
95 };
96
97 class VTrackZoomPanel : public ZoomPanel
98 {
99 public:
100         VTrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
101         int handle_event();
102         MWindow *mwindow;
103         ZoomBar *zoombar;
104 };
105
106 class AutoZoom : public BC_Tumbler
107 {
108 public:
109         AutoZoom(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int changemax);
110         int handle_up_event();
111         int handle_down_event();
112         MWindow *mwindow;
113         ZoomBar *zoombar;
114         int changemax;
115 };
116
117
118 class AutoTypeMenu : public BC_PopupMenu
119 {
120 public:
121         AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar,
122                      int x, int y, int wid);
123         void create_objects();
124         static const char* to_text(int shape);
125         static int from_text(char *text);
126         int draw_face(int dx, int color);
127         int handle_event();
128         MWindow *mwindow;
129         ZoomBar *zoombar;
130 };
131
132
133 class ZoomTextBox : public BC_TextBox
134 {
135 public:
136         ZoomTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y, const char *text);
137         int button_press_event();
138         int handle_event();
139         MWindow *mwindow;
140         ZoomBar *zoombar;
141 };
142
143
144 class FromTextBox : public BC_TextBox
145 {
146 public:
147         FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
148         int handle_event();
149         int update_position(double new_position);
150         char string[256], string2[256];
151         MWindow *mwindow;
152         ZoomBar *zoombar;
153 };
154
155
156 class LengthTextBox : public BC_TextBox
157 {
158 public:
159         LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
160         int handle_event();
161         int update_position(double new_position);
162         char string[256], string2[256];
163         MWindow *mwindow;
164         ZoomBar *zoombar;
165 };
166
167 class ToTextBox : public BC_TextBox
168 {
169 public:
170         ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
171         int handle_event();
172         int update_position(double new_position);
173         char string[256], string2[256];
174         MWindow *mwindow;
175         ZoomBar *zoombar;
176 };
177
178 class TitleAlphaBar : public BC_FSlider
179 {
180 public:
181         TitleAlphaBar(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
182         int handle_event();
183         MWindow *mwindow;
184         ZoomBar *zoombar;
185 };
186
187 class TitleAlphaText : public BC_TextBox
188 {
189 public:
190         TitleAlphaText(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
191         int handle_event();
192         MWindow *mwindow;
193         ZoomBar *zoombar;
194 };
195
196 #endif