Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[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 AssetEditTCStartTextBox;
39 class AssetEditReelNumber;
40 class AssetEditReelName;
41 class AssetEditByteOrderHILO;
42 class AssetEditByteOrderLOHI;
43 class AssetEditPath;
44 class AssetEditPathText;
45 class AssetEditWindow;
46
47 class DetailAssetWindow;
48 class DetailAssetThread;
49 class DetailAssetButton;
50
51 class AssetEdit : public BC_DialogThread
52 {
53 public:
54         AssetEdit(MWindow *mwindow);
55         ~AssetEdit();
56
57         void edit_asset(Indexable *indexable);
58         int set_asset(Indexable *indexable);
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         BitsPopup *bitspopup;
88         int allow_edits;
89         MWindow *mwindow;
90         AssetEdit *asset_edit;
91         BC_Title *win_width;
92         BC_Title *win_height;
93         DetailAssetThread *detail_thread;
94         void show_info_detail();
95 };
96
97
98 class AssetEditPath : public BrowseButton
99 {
100 public:
101         AssetEditPath(MWindow *mwindow,
102                 AssetEditWindow *fwindow,
103                 BC_TextBox *textbox,
104                 int y,
105                 const char *text,
106                 const char *window_title = _(PROGRAM_NAME ": Path"),
107                 const char *window_caption = _("Select a file"));
108         ~AssetEditPath();
109
110         AssetEditWindow *fwindow;
111 };
112
113
114 class AssetEditPathText : public BC_TextBox
115 {
116 public:
117         AssetEditPathText(AssetEditWindow *fwindow, int y);
118         ~AssetEditPathText();
119         int handle_event();
120
121         AssetEditWindow *fwindow;
122 };
123
124
125
126 class AssetEditFormat : public FormatPopup
127 {
128 public:
129         AssetEditFormat(AssetEditWindow *fwindow, char* default_, int y);
130         ~AssetEditFormat();
131
132         int handle_event();
133         AssetEditWindow *fwindow;
134 };
135
136
137 class AssetEditChannels : public BC_TumbleTextBox
138 {
139 public:
140         AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y);
141
142         int handle_event();
143
144         AssetEditWindow *fwindow;
145 };
146
147 class AssetEditRate : public BC_TextBox
148 {
149 public:
150         AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
151
152         int handle_event();
153
154         AssetEditWindow *fwindow;
155 };
156
157 class AssetEditFRate : public BC_TextBox
158 {
159 public:
160         AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
161
162         int handle_event();
163
164         AssetEditWindow *fwindow;
165 };
166
167 class Interlaceautofix : public BC_CheckBox
168 {
169 public:
170         Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y);
171         ~Interlaceautofix();
172         int handle_event();
173
174         void showhideotherwidgets();
175
176         AssetEditWindow* fwindow;
177         MWindow *mwindow;
178
179         BC_TextBox *ilacemode_textbox;
180         BC_ListBox *ilacemode_listbox;
181         BC_TextBox *ilacefixmethod_textbox;
182         BC_ListBox *ilacefixmethod_listbox;
183 private:
184         char string[BCTEXTLEN];
185 };
186
187 class AssetEditILaceautofixoption : public BC_TextBox
188 {
189 public:
190         AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w);
191
192         int handle_event();
193         int thedefault;
194         AssetEditWindow *fwindow;
195 };
196
197 class AssetEditILacemode : public BC_TextBox
198 {
199 public:
200         AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
201         int handle_event();
202         int thedefault;
203         AssetEditWindow *fwindow;
204 };
205
206 class AssetEditInterlacemodePulldown : public BC_ListBox
207 {
208 public:
209         AssetEditInterlacemodePulldown(MWindow *mwindow,
210                                 BC_TextBox *output_text,
211                                 int *output_value,
212                                 ArrayList<BC_ListBoxItem*> *data,
213                                 Interlaceautofix *fixoption_chkbox,
214                                 int x,
215                                 int y);
216         int handle_event();
217         char* interlacemode_to_text();
218         MWindow *mwindow;
219         BC_TextBox *output_text;
220         int *output_value;
221         Interlaceautofix *fixoption_chkbox;
222 private:
223         char string[BCTEXTLEN];
224 };
225
226 class AssetEditILacefixmethod : public BC_TextBox
227 {
228 public:
229         AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
230
231         int handle_event();
232         int thedefault;
233         AssetEditWindow *fwindow;
234 };
235
236 class AssetEditHeader : public BC_TextBox
237 {
238 public:
239         AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
240
241         int handle_event();
242
243         AssetEditWindow *fwindow;
244 };
245
246 class AssetEditByteOrderLOHI : public BC_Radial
247 {
248 public:
249         AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
250
251         int handle_event();
252
253         AssetEditWindow *fwindow;
254 };
255
256 class AssetEditByteOrderHILO : public BC_Radial
257 {
258 public:
259         AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
260
261         int handle_event();
262
263         AssetEditWindow *fwindow;
264 };
265
266 class AssetEditSigned : public BC_CheckBox
267 {
268 public:
269         AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
270
271         int handle_event();
272
273         AssetEditWindow *fwindow;
274 };
275
276 class AssetEditReelName : public BC_TextBox
277 {
278 public:
279         AssetEditReelName(AssetEditWindow *fwindow, int x, int y);
280         ~AssetEditReelName();
281
282         int handle_event();
283
284         AssetEditWindow *fwindow;
285 };
286
287 class AssetEditReelNumber : public BC_TextBox
288 {
289 public:
290         AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y);
291         ~AssetEditReelNumber();
292
293         int handle_event();
294
295         AssetEditWindow *fwindow;
296 };
297
298 class AssetEditTCStartTextBox : public BC_TextBox
299 {
300 public:
301         AssetEditTCStartTextBox(AssetEditWindow *fwindow, int value, int x, int y, int multiplier);
302         ~AssetEditTCStartTextBox();
303         int handle_event();
304
305         AssetEditWindow *fwindow;
306 // Multiplier is the # of frames for whatever unit of time this is.
307 // fps dependent, and unit dependent
308         int multiplier;
309         int previous;
310 };
311
312 class DetailAssetWindow : public BC_Window
313 {
314         MWindow *mwindow;
315         Asset *asset;
316         char info[65536];
317         BC_ScrollTextBox *text;
318 public:
319         DetailAssetWindow(MWindow *mwindow, Asset *asset);
320         ~DetailAssetWindow();
321         void create_objects();
322 };
323
324 class DetailAssetThread : public Thread
325 {
326         MWindow *mwindow;
327         DetailAssetWindow *dwindow;
328 public:
329         DetailAssetThread(MWindow *mwindow);
330         ~DetailAssetThread();
331
332         void start(Asset *asset);
333         void stop();
334         void run();
335 };
336
337
338 class DetailAssetButton : public BC_GenericButton
339 {
340 public:
341         DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
342         ~DetailAssetButton();
343
344         AssetEditWindow *fwindow;
345         int handle_event();
346 };
347
348 #endif