ibeam column select tweaks, fix title alpha fader value popup, title bar border color...
[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         int update_clocks();
46         int update_playback(int64_t new_position);       // update the playback position
47         int set_selection(int which_one);
48         void update_formatting(BC_TextBox *dst);
49
50         MWindow *mwindow;
51         MWindowGUI *gui;
52         SampleZoomPanel *sample_zoom;
53         AmpZoomPanel *amp_zoom;
54         TrackZoomPanel *track_zoom;
55         AutoZoom *auto_zoom;
56         AutoTypeMenu *auto_type;
57         ZoomTextBox *auto_zoom_text;
58
59         LengthTextBox *length_value;
60         FromTextBox *from_value;
61         ToTextBox *to_value;
62         TitleAlphaBar *title_alpha_bar;
63         TitleAlphaText *title_alpha_text;
64         char string[256], string2[256];
65 };
66
67 class SampleZoomPanel : public ZoomPanel
68 {
69 public:
70         SampleZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
71         int handle_event();
72         MWindow *mwindow;
73         ZoomBar *zoombar;
74 };
75
76 class AmpZoomPanel : public ZoomPanel
77 {
78 public:
79         AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
80         int handle_event();
81         MWindow *mwindow;
82         ZoomBar *zoombar;
83 };
84
85 class TrackZoomPanel : public ZoomPanel
86 {
87 public:
88         TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
89         int handle_event();
90         MWindow *mwindow;
91         ZoomBar *zoombar;
92 };
93
94 class AutoZoom : public BC_Tumbler
95 {
96 public:
97         AutoZoom(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int changemax);
98         int handle_up_event();
99         int handle_down_event();
100         MWindow *mwindow;
101         ZoomBar *zoombar;
102         int changemax;
103 };
104
105
106 class AutoTypeMenu : public BC_PopupMenu
107 {
108 public:
109         AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar,
110                      int x, int y, int wid);
111         void create_objects();
112         static const char* to_text(int shape);
113         static int from_text(char *text);
114         int handle_event();
115         MWindow *mwindow;
116         ZoomBar *zoombar;
117 };
118
119
120 class ZoomTextBox : public BC_TextBox
121 {
122 public:
123         ZoomTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y, const char *text);
124         int button_press_event();
125         int handle_event();
126         MWindow *mwindow;
127         ZoomBar *zoombar;
128 };
129
130
131 class FromTextBox : public BC_TextBox
132 {
133 public:
134         FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
135         int handle_event();
136         int update_position(double new_position);
137         char string[256], string2[256];
138         MWindow *mwindow;
139         ZoomBar *zoombar;
140 };
141
142
143 class LengthTextBox : public BC_TextBox
144 {
145 public:
146         LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
147         int handle_event();
148         int update_position(double new_position);
149         char string[256], string2[256];
150         MWindow *mwindow;
151         ZoomBar *zoombar;
152 };
153
154 class ToTextBox : public BC_TextBox
155 {
156 public:
157         ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
158         int handle_event();
159         int update_position(double new_position);
160         char string[256], string2[256];
161         MWindow *mwindow;
162         ZoomBar *zoombar;
163 };
164
165 class TitleAlphaBar : public BC_FSlider
166 {
167 public:
168         TitleAlphaBar(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
169         int handle_event();
170         MWindow *mwindow;
171         ZoomBar *zoombar;
172 };
173
174 class TitleAlphaText : public BC_TextBox
175 {
176 public:
177         TitleAlphaText(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
178         int handle_event();
179         MWindow *mwindow;
180         ZoomBar *zoombar;
181 };
182
183 #endif