rework keyframe hide popup, keyframe auto render, textbox set_selection wide text
[goodguy/history.git] / cinelerra-5.1 / cinelerra / assetedit.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 ASSETEDIT_H
23 #define ASSETEDIT_H
24
25 #include "asset.inc"
26 #include "awindow.inc"
27 #include "bcdialog.h"
28 #include "bitspopup.inc"
29 #include "browsebutton.h"
30 #include "formatpopup.h"
31 #include "guicast.h"
32 #include "indexable.inc"
33 #include "language.h"
34 #include "mwindow.h"
35 #include "resizetrackthread.inc"
36
37
38 class AssetEditReelNumber;
39 class AssetEditReelName;
40 class AssetEditByteOrderHILO;
41 class AssetEditByteOrderLOHI;
42 class AssetEditPath;
43 class AssetEditPathText;
44 class AssetEditWindow;
45
46 class DetailAssetWindow;
47 class DetailAssetThread;
48 class DetailAssetButton;
49
50 class AssetEdit : public BC_DialogThread
51 {
52 public:
53         AssetEdit(MWindow *mwindow);
54         ~AssetEdit();
55
56         void edit_asset(Indexable *indexable);
57         int set_asset(Indexable *indexable);
58         void handle_done_event(int result);
59         void handle_close_event(int result);
60         BC_Window* new_gui();
61
62         Indexable *indexable;
63         MWindow *mwindow;
64         AssetEditWindow *window;
65
66
67 // Changed parameters
68         Asset *changed_params;
69 };
70
71
72
73 // Pcm is the only format users should be able to fix.
74 // All other formats display information about the file in read-only.
75
76 class AssetEditWindow : public BC_Window
77 {
78 public:
79         AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit);
80         ~AssetEditWindow();
81
82         void create_objects();
83         AssetEditPathText *path_text;
84         AssetEditPath *path_button;
85         AssetEditByteOrderHILO *hilo;
86         AssetEditByteOrderLOHI *lohi;
87         BC_TextBox *tc_hours_textbox, *tc_minutes_textbox;
88         BC_TextBox *tc_seconds_textbox, *tc_rest_textbox;
89         BitsPopup *bitspopup;
90         int allow_edits;
91         MWindow *mwindow;
92         AssetEdit *asset_edit;
93         BC_Title *win_width;
94         BC_Title *win_height;
95         DetailAssetThread *detail_thread;
96         void show_info_detail();
97
98 };
99
100
101 class AssetEditPath : public BrowseButton
102 {
103 public:
104         AssetEditPath(MWindow *mwindow,
105                 AssetEditWindow *fwindow,
106                 BC_TextBox *textbox,
107                 int y,
108                 const char *text,
109                 const char *window_title = _(PROGRAM_NAME ": Path"),
110                 const char *window_caption = _("Select a file"));
111         ~AssetEditPath();
112
113         AssetEditWindow *fwindow;
114 };
115
116
117 class AssetEditPathText : public BC_TextBox
118 {
119 public:
120         AssetEditPathText(AssetEditWindow *fwindow, int y);
121         ~AssetEditPathText();
122         int handle_event();
123
124         AssetEditWindow *fwindow;
125 };
126
127
128
129 class AssetEditFormat : public FormatPopup
130 {
131 public:
132         AssetEditFormat(AssetEditWindow *fwindow, char* default_, int y);
133         ~AssetEditFormat();
134
135         int handle_event();
136         AssetEditWindow *fwindow;
137 };
138
139
140 class AssetEditChannels : public BC_TumbleTextBox
141 {
142 public:
143         AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y);
144
145         int handle_event();
146
147         AssetEditWindow *fwindow;
148 };
149
150 class AssetEditRate : public BC_TextBox
151 {
152 public:
153         AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
154
155         int handle_event();
156
157         AssetEditWindow *fwindow;
158 };
159
160 class AssetEditFRate : public BC_TextBox
161 {
162 public:
163         AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
164
165         int handle_event();
166
167         AssetEditWindow *fwindow;
168 };
169
170 class Interlaceautofix : public BC_CheckBox
171 {
172 public:
173         Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y);
174         ~Interlaceautofix();
175         int handle_event();
176
177         void showhideotherwidgets();
178
179         AssetEditWindow* fwindow;
180         MWindow *mwindow;
181
182         BC_TextBox *ilacemode_textbox;
183         BC_ListBox *ilacemode_listbox;
184         BC_TextBox *ilacefixmethod_textbox;
185         BC_ListBox *ilacefixmethod_listbox;
186 private:
187         char string[BCTEXTLEN];
188 };
189
190 class AssetEditILaceautofixoption : public BC_TextBox
191 {
192 public:
193         AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w);
194
195         int handle_event();
196         int thedefault;
197         AssetEditWindow *fwindow;
198 };
199
200 class AssetEditILacemode : public BC_TextBox
201 {
202 public:
203         AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
204         int handle_event();
205         int thedefault;
206         AssetEditWindow *fwindow;
207 };
208
209 class AssetEditInterlacemodePulldown : public BC_ListBox
210 {
211 public:
212         AssetEditInterlacemodePulldown(MWindow *mwindow,
213                                 BC_TextBox *output_text,
214                                 int *output_value,
215                                 ArrayList<BC_ListBoxItem*> *data,
216                                 Interlaceautofix *fixoption_chkbox,
217                                 int x,
218                                 int y);
219         int handle_event();
220         char* interlacemode_to_text();
221         MWindow *mwindow;
222         BC_TextBox *output_text;
223         int *output_value;
224         Interlaceautofix *fixoption_chkbox;
225 private:
226         char string[BCTEXTLEN];
227 };
228
229 class AssetEditILacefixmethod : public BC_TextBox
230 {
231 public:
232         AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
233
234         int handle_event();
235         int thedefault;
236         AssetEditWindow *fwindow;
237 };
238
239 class AssetEditHeader : public BC_TextBox
240 {
241 public:
242         AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
243
244         int handle_event();
245
246         AssetEditWindow *fwindow;
247 };
248
249 class AssetEditByteOrderLOHI : public BC_Radial
250 {
251 public:
252         AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
253
254         int handle_event();
255
256         AssetEditWindow *fwindow;
257 };
258
259 class AssetEditByteOrderHILO : public BC_Radial
260 {
261 public:
262         AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
263
264         int handle_event();
265
266         AssetEditWindow *fwindow;
267 };
268
269 class AssetEditSigned : public BC_CheckBox
270 {
271 public:
272         AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
273
274         int handle_event();
275
276         AssetEditWindow *fwindow;
277 };
278
279 class AssetEditReelName : public BC_TextBox
280 {
281 public:
282         AssetEditReelName(AssetEditWindow *fwindow, int x, int y);
283         ~AssetEditReelName();
284
285         int handle_event();
286
287         AssetEditWindow *fwindow;
288 };
289
290 class AssetEditReelNumber : public BC_TextBox
291 {
292 public:
293         AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y);
294         ~AssetEditReelNumber();
295
296         int handle_event();
297
298         AssetEditWindow *fwindow;
299 };
300
301 class DetailAssetWindow : public BC_Window
302 {
303         MWindow *mwindow;
304         Asset *asset;
305         char info[65536];
306         BC_ScrollTextBox *text;
307 public:
308         DetailAssetWindow(MWindow *mwindow, Asset *asset);
309         ~DetailAssetWindow();
310         void create_objects();
311 };
312
313 class DetailAssetThread : public Thread
314 {
315         MWindow *mwindow;
316         DetailAssetWindow *dwindow;
317 public:
318         DetailAssetThread(MWindow *mwindow);
319         ~DetailAssetThread();
320
321         void start(Asset *asset);
322         void stop();
323         void run();
324 };
325
326
327 class DetailAssetButton : public BC_GenericButton
328 {
329 public:
330         DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
331         ~DetailAssetButton();
332
333         AssetEditWindow *fwindow;
334         int handle_event();
335 };
336
337 #endif