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