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