initial commit
[goodguy/history.git] / cinelerra-5.0 / 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 AutoZoomPopup;
35
36 #include "guicast.h"
37 #include "mwindow.inc"
38 #include "mwindowgui.inc"
39 #include "zoompanel.h"
40
41 class ZoomBar : public BC_SubWindow
42 {
43 public:
44         ZoomBar(MWindow *mwindow, MWindowGUI *gui);
45         ~ZoomBar();
46
47         void create_objects();
48         void resize_event();
49         int draw();
50         int resize_event(int w, int h);
51         void redraw_time_dependancies();
52         int update();          // redraw the current values
53         void update_autozoom();
54         int update_clocks();
55         int update_playback(int64_t new_position);       // update the playback position
56         int set_selection(int which_one);
57         void update_formatting(BC_TextBox *dst);
58
59         MWindow *mwindow;
60         MWindowGUI *gui;
61         SampleZoomPanel *sample_zoom;
62         AmpZoomPanel *amp_zoom;
63         TrackZoomPanel *track_zoom;
64         AutoZoom *auto_zoom;
65 //      BC_Title *auto_zoom_text;
66         AutoZoomPopup *auto_zoom_popup;
67
68         BC_Title *zoom_value, *playback_value;
69         LengthTextBox *length_value;
70         FromTextBox *from_value;
71         ToTextBox *to_value;
72         char string[256], string2[256];
73         int64_t old_position;
74 };
75
76 class SampleZoomPanel : public ZoomPanel
77 {
78 public:
79         SampleZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
80         virtual ~SampleZoomPanel() {}
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         virtual ~AmpZoomPanel() {}
91         int handle_event();
92         MWindow *mwindow;
93         ZoomBar *zoombar;
94 };
95
96 class TrackZoomPanel : public ZoomPanel
97 {
98 public:
99         TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
100         virtual ~TrackZoomPanel() {}
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);
110         int handle_up_event();
111         int handle_down_event();
112         MWindow *mwindow;
113         ZoomBar *zoombar;
114 };
115
116 class AutoZoomPopup : public BC_PopupMenu
117 {
118 public:
119         AutoZoomPopup(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int w);
120         void create_objects();
121         int handle_event();
122         MWindow *mwindow;
123         ZoomBar *zoombar;
124 };
125
126
127
128
129
130
131
132
133 class FromTextBox : public BC_TextBox
134 {
135 public:
136         FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
137         int handle_event();
138         int update_position(double new_position);
139         char string[256], string2[256];
140         MWindow *mwindow;
141         ZoomBar *zoombar;
142 };
143
144
145 class LengthTextBox : public BC_TextBox
146 {
147 public:
148         LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
149         int handle_event();
150         int update_position(double new_position);
151         char string[256], string2[256];
152         MWindow *mwindow;
153         ZoomBar *zoombar;
154 };
155
156 class ToTextBox : public BC_TextBox
157 {
158 public:
159         ToTextBox(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
168
169
170 #endif