awindowgui / mwindowedit / label rework
[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);
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
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         DetailAssetThread *detail_thread;
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, char *text, int x, int y);
132
133         int handle_event();
134
135         AssetEditWindow *fwindow;
136 };
137
138 class AssetEditRate : public BC_TextBox
139 {
140 public:
141         AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
142
143         int handle_event();
144
145         AssetEditWindow *fwindow;
146 };
147
148 class AssetEditFRate : public BC_TextBox
149 {
150 public:
151         AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
152
153         int handle_event();
154
155         AssetEditWindow *fwindow;
156 };
157
158 class Interlaceautofix : public BC_CheckBox
159 {
160 public:
161         Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y);
162         ~Interlaceautofix();
163         int handle_event();
164
165         void showhideotherwidgets();
166
167         AssetEditWindow* fwindow;
168         MWindow *mwindow;
169
170         BC_TextBox *ilacemode_textbox;
171         BC_ListBox *ilacemode_listbox;
172         BC_TextBox *ilacefixmethod_textbox;
173         BC_ListBox *ilacefixmethod_listbox;
174 private:
175         char string[BCTEXTLEN];
176 };
177
178 class AssetEditILaceautofixoption : public BC_TextBox
179 {
180 public:
181         AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w);
182
183         int handle_event();
184         int thedefault;
185         AssetEditWindow *fwindow;
186 };
187
188 class AssetEditILacemode : public BC_TextBox
189 {
190 public:
191         AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
192         int handle_event();
193         int thedefault;
194         AssetEditWindow *fwindow;
195 };
196
197 class AssetEditInterlacemodePulldown : public BC_ListBox
198 {
199 public:
200         AssetEditInterlacemodePulldown(MWindow *mwindow,
201                                 BC_TextBox *output_text,
202                                 int *output_value,
203                                 ArrayList<BC_ListBoxItem*> *data,
204                                 Interlaceautofix *fixoption_chkbox,
205                                 int x,
206                                 int y);
207         int handle_event();
208         char* interlacemode_to_text();
209         MWindow *mwindow;
210         BC_TextBox *output_text;
211         int *output_value;
212         Interlaceautofix *fixoption_chkbox;
213 private:
214         char string[BCTEXTLEN];
215 };
216
217 class AssetEditILacefixmethod : public BC_TextBox
218 {
219 public:
220         AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
221
222         int handle_event();
223         int thedefault;
224         AssetEditWindow *fwindow;
225 };
226
227 class AssetEditHeader : public BC_TextBox
228 {
229 public:
230         AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
231
232         int handle_event();
233
234         AssetEditWindow *fwindow;
235 };
236
237 class AssetEditByteOrderLOHI : public BC_Radial
238 {
239 public:
240         AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
241
242         int handle_event();
243
244         AssetEditWindow *fwindow;
245 };
246
247 class AssetEditByteOrderHILO : public BC_Radial
248 {
249 public:
250         AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
251
252         int handle_event();
253
254         AssetEditWindow *fwindow;
255 };
256
257 class AssetEditSigned : public BC_CheckBox
258 {
259 public:
260         AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
261
262         int handle_event();
263
264         AssetEditWindow *fwindow;
265 };
266
267 class DetailAssetWindow : public BC_Window
268 {
269         MWindow *mwindow;
270         Asset *asset;
271         char info[65536];
272         BC_ScrollTextBox *text;
273 public:
274         DetailAssetWindow(MWindow *mwindow, Asset *asset);
275         ~DetailAssetWindow();
276         void create_objects();
277 };
278
279 class DetailAssetThread : public Thread
280 {
281         MWindow *mwindow;
282         DetailAssetWindow *dwindow;
283 public:
284         DetailAssetThread(MWindow *mwindow);
285         ~DetailAssetThread();
286
287         void start(Asset *asset);
288         void stop();
289         void run();
290 };
291
292
293 class DetailAssetButton : public BC_GenericButton
294 {
295 public:
296         DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
297         ~DetailAssetButton();
298
299         AssetEditWindow *fwindow;
300         int handle_event();
301 };
302
303 #endif