4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
26 #include "awindow.inc"
28 #include "bitspopup.inc"
29 #include "browsebutton.h"
30 #include "formatpopup.h"
32 #include "indexable.inc"
35 #include "resizetrackthread.inc"
38 class AssetEditTCStartTextBox;
39 class AssetEditReelNumber;
40 class AssetEditReelName;
41 class AssetEditByteOrderHILO;
42 class AssetEditByteOrderLOHI;
44 class AssetEditPathText;
45 class AssetEditWindow;
47 class DetailAssetWindow;
48 class DetailAssetThread;
49 class DetailAssetButton;
51 class AssetEdit : public BC_DialogThread
54 AssetEdit(MWindow *mwindow);
57 void edit_asset(Indexable *indexable);
58 int set_asset(Indexable *indexable);
59 void handle_close_event(int result);
64 AssetEditWindow *window;
68 Asset *changed_params;
73 // Pcm is the only format users should be able to fix.
74 // All other formats display information about the file in read-only.
76 class AssetEditWindow : public BC_Window
79 AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit);
82 void create_objects();
83 AssetEditPathText *path_text;
84 AssetEditPath *path_button;
85 AssetEditByteOrderHILO *hilo;
86 AssetEditByteOrderLOHI *lohi;
90 AssetEdit *asset_edit;
93 DetailAssetThread *detail_thread;
94 void show_info_detail();
98 class AssetEditPath : public BrowseButton
101 AssetEditPath(MWindow *mwindow,
102 AssetEditWindow *fwindow,
106 const char *window_title = _(PROGRAM_NAME ": Path"),
107 const char *window_caption = _("Select a file"));
110 AssetEditWindow *fwindow;
114 class AssetEditPathText : public BC_TextBox
117 AssetEditPathText(AssetEditWindow *fwindow, int y);
118 ~AssetEditPathText();
121 AssetEditWindow *fwindow;
126 class AssetEditFormat : public FormatPopup
129 AssetEditFormat(AssetEditWindow *fwindow, char* default_, int y);
133 AssetEditWindow *fwindow;
137 class AssetEditChannels : public BC_TumbleTextBox
140 AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y);
144 AssetEditWindow *fwindow;
147 class AssetEditRate : public BC_TextBox
150 AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
154 AssetEditWindow *fwindow;
157 class AssetEditFRate : public BC_TextBox
160 AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
164 AssetEditWindow *fwindow;
167 class Interlaceautofix : public BC_CheckBox
170 Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y);
174 void showhideotherwidgets();
176 AssetEditWindow* fwindow;
179 BC_TextBox *ilacemode_textbox;
180 BC_ListBox *ilacemode_listbox;
181 BC_TextBox *ilacefixmethod_textbox;
182 BC_ListBox *ilacefixmethod_listbox;
184 char string[BCTEXTLEN];
187 class AssetEditILaceautofixoption : public BC_TextBox
190 AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w);
194 AssetEditWindow *fwindow;
197 class AssetEditILacemode : public BC_TextBox
200 AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
203 AssetEditWindow *fwindow;
206 class AssetEditInterlacemodePulldown : public BC_ListBox
209 AssetEditInterlacemodePulldown(MWindow *mwindow,
210 BC_TextBox *output_text,
212 ArrayList<BC_ListBoxItem*> *data,
213 Interlaceautofix *fixoption_chkbox,
217 char* interlacemode_to_text();
219 BC_TextBox *output_text;
221 Interlaceautofix *fixoption_chkbox;
223 char string[BCTEXTLEN];
226 class AssetEditILacefixmethod : public BC_TextBox
229 AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
233 AssetEditWindow *fwindow;
236 class AssetEditHeader : public BC_TextBox
239 AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
243 AssetEditWindow *fwindow;
246 class AssetEditByteOrderLOHI : public BC_Radial
249 AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
253 AssetEditWindow *fwindow;
256 class AssetEditByteOrderHILO : public BC_Radial
259 AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
263 AssetEditWindow *fwindow;
266 class AssetEditSigned : public BC_CheckBox
269 AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
273 AssetEditWindow *fwindow;
276 class AssetEditReelName : public BC_TextBox
279 AssetEditReelName(AssetEditWindow *fwindow, int x, int y);
280 ~AssetEditReelName();
284 AssetEditWindow *fwindow;
287 class AssetEditReelNumber : public BC_TextBox
290 AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y);
291 ~AssetEditReelNumber();
295 AssetEditWindow *fwindow;
298 class AssetEditTCStartTextBox : public BC_TextBox
301 AssetEditTCStartTextBox(AssetEditWindow *fwindow, int value, int x, int y, int multiplier);
302 ~AssetEditTCStartTextBox();
305 AssetEditWindow *fwindow;
306 // Multiplier is the # of frames for whatever unit of time this is.
307 // fps dependent, and unit dependent
312 class DetailAssetWindow : public BC_Window
317 BC_ScrollTextBox *text;
319 DetailAssetWindow(MWindow *mwindow, Asset *asset);
320 ~DetailAssetWindow();
321 void create_objects();
324 class DetailAssetThread : public Thread
327 DetailAssetWindow *dwindow;
329 DetailAssetThread(MWindow *mwindow);
330 ~DetailAssetThread();
332 void start(Asset *asset);
338 class DetailAssetButton : public BC_GenericButton
341 DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
342 ~DetailAssetButton();
344 AssetEditWindow *fwindow;