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 AssetEditReelNumber;
39 class AssetEditReelName;
40 class AssetEditByteOrderHILO;
41 class AssetEditByteOrderLOHI;
43 class AssetEditPathText;
44 class AssetEditWindow;
46 class DetailAssetWindow;
47 class DetailAssetThread;
48 class DetailAssetButton;
50 class AssetEdit : public BC_DialogThread
53 AssetEdit(MWindow *mwindow);
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);
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;
87 BC_TextBox *tc_hours_textbox, *tc_minutes_textbox;
88 BC_TextBox *tc_seconds_textbox, *tc_rest_textbox;
92 AssetEdit *asset_edit;
95 DetailAssetThread *detail_thread;
96 void show_info_detail();
101 class AssetEditPath : public BrowseButton
104 AssetEditPath(MWindow *mwindow,
105 AssetEditWindow *fwindow,
109 const char *window_title = _(PROGRAM_NAME ": Path"),
110 const char *window_caption = _("Select a file"));
113 AssetEditWindow *fwindow;
117 class AssetEditPathText : public BC_TextBox
120 AssetEditPathText(AssetEditWindow *fwindow, int y);
121 ~AssetEditPathText();
124 AssetEditWindow *fwindow;
129 class AssetEditFormat : public FormatPopup
132 AssetEditFormat(AssetEditWindow *fwindow, char* default_, int y);
136 AssetEditWindow *fwindow;
140 class AssetEditChannels : public BC_TumbleTextBox
143 AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y);
147 AssetEditWindow *fwindow;
150 class AssetEditRate : public BC_TextBox
153 AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
157 AssetEditWindow *fwindow;
160 class AssetEditFRate : public BC_TextBox
163 AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
167 AssetEditWindow *fwindow;
170 class Interlaceautofix : public BC_CheckBox
173 Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y);
177 void showhideotherwidgets();
179 AssetEditWindow* fwindow;
182 BC_TextBox *ilacemode_textbox;
183 BC_ListBox *ilacemode_listbox;
184 BC_TextBox *ilacefixmethod_textbox;
185 BC_ListBox *ilacefixmethod_listbox;
187 char string[BCTEXTLEN];
190 class AssetEditILaceautofixoption : public BC_TextBox
193 AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w);
197 AssetEditWindow *fwindow;
200 class AssetEditILacemode : public BC_TextBox
203 AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
206 AssetEditWindow *fwindow;
209 class AssetEditInterlacemodePulldown : public BC_ListBox
212 AssetEditInterlacemodePulldown(MWindow *mwindow,
213 BC_TextBox *output_text,
215 ArrayList<BC_ListBoxItem*> *data,
216 Interlaceautofix *fixoption_chkbox,
220 char* interlacemode_to_text();
222 BC_TextBox *output_text;
224 Interlaceautofix *fixoption_chkbox;
226 char string[BCTEXTLEN];
229 class AssetEditILacefixmethod : public BC_TextBox
232 AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w);
236 AssetEditWindow *fwindow;
239 class AssetEditHeader : public BC_TextBox
242 AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
246 AssetEditWindow *fwindow;
249 class AssetEditByteOrderLOHI : public BC_Radial
252 AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
256 AssetEditWindow *fwindow;
259 class AssetEditByteOrderHILO : public BC_Radial
262 AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
266 AssetEditWindow *fwindow;
269 class AssetEditSigned : public BC_CheckBox
272 AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
276 AssetEditWindow *fwindow;
279 class AssetEditReelName : public BC_TextBox
282 AssetEditReelName(AssetEditWindow *fwindow, int x, int y);
283 ~AssetEditReelName();
287 AssetEditWindow *fwindow;
290 class AssetEditReelNumber : public BC_TextBox
293 AssetEditReelNumber(AssetEditWindow *fwindow, int x, int y);
294 ~AssetEditReelNumber();
298 AssetEditWindow *fwindow;
301 class DetailAssetWindow : public BC_Window
306 BC_ScrollTextBox *text;
308 DetailAssetWindow(MWindow *mwindow, Asset *asset);
309 ~DetailAssetWindow();
310 void create_objects();
313 class DetailAssetThread : public Thread
316 DetailAssetWindow *dwindow;
318 DetailAssetThread(MWindow *mwindow);
319 ~DetailAssetThread();
321 void start(Asset *asset);
327 class DetailAssetButton : public BC_GenericButton
330 DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
331 ~DetailAssetButton();
333 AssetEditWindow *fwindow;