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 "assetedit.inc"
27 #include "awindow.inc"
29 #include "bitspopup.inc"
30 #include "browsebutton.h"
31 #include "formatpopup.h"
33 #include "indexable.inc"
36 #include "resizetrackthread.inc"
39 class AssetEdit : public BC_DialogThread
42 AssetEdit(MWindow *mwindow);
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);
54 AssetEditWindow *window;
58 Asset *changed_params;
63 // Pcm is the only format users should be able to fix.
64 // All other formats display information about the file in read-only.
66 class AssetEditWindow : public BC_Window
69 AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit);
72 void create_objects();
73 AssetEditPathText *path_text;
74 AssetEditPath *path_button;
75 AssetEditByteOrderHILO *hilo;
76 AssetEditByteOrderLOHI *lohi;
80 AssetEdit *asset_edit;
83 DetailAssetDialog *detail_dialog;
84 void show_info_detail();
89 class AssetEditPath : public BrowseButton
92 AssetEditPath(MWindow *mwindow,
93 AssetEditWindow *fwindow,
97 const char *window_title = _(PROGRAM_NAME ": Path"),
98 const char *window_caption = _("Select a file"));
101 AssetEditWindow *fwindow;
105 class AssetEditPathText : public BC_TextBox
108 AssetEditPathText(AssetEditWindow *fwindow, int y);
109 ~AssetEditPathText();
112 AssetEditWindow *fwindow;
117 class AssetEditChannels : public BC_TumbleTextBox
120 AssetEditChannels(AssetEditWindow *fwindow,
121 char *text, int x, int y);
125 AssetEditWindow *fwindow;
128 class AssetEditRate : public BC_TextBox
131 AssetEditRate(AssetEditWindow *fwindow,
132 char *text, int x, int y);
136 AssetEditWindow *fwindow;
139 class AssetEditFRate : public BC_TextBox
142 AssetEditFRate(AssetEditWindow *fwindow,
143 char *text, int x, int y);
147 AssetEditWindow *fwindow;
150 class AssetEditILacemode : public BC_TextBox
153 AssetEditILacemode(AssetEditWindow *fwindow,
154 const char *text, int x, int y, int w);
157 AssetEditWindow *fwindow;
160 class AssetEditInterlacemodePulldown : public BC_ListBox
163 AssetEditInterlacemodePulldown(MWindow *mwindow,
164 BC_TextBox *output_text, int *output_value,
165 ArrayList<BC_ListBoxItem*> *data, int x, int y);
167 char* interlacemode_to_text();
169 BC_TextBox *output_text;
172 char string[BCTEXTLEN];
175 class AssetEditHeader : public BC_TextBox
178 AssetEditHeader(AssetEditWindow *fwindow,
179 char *text, int x, int y);
183 AssetEditWindow *fwindow;
186 class AssetEditByteOrderLOHI : public BC_Radial
189 AssetEditByteOrderLOHI(AssetEditWindow *fwindow,
190 int value, int x, int y);
194 AssetEditWindow *fwindow;
197 class AssetEditByteOrderHILO : public BC_Radial
200 AssetEditByteOrderHILO(AssetEditWindow *fwindow,
201 int value, int x, int y);
205 AssetEditWindow *fwindow;
208 class AssetEditSigned : public BC_CheckBox
211 AssetEditSigned(AssetEditWindow *fwindow,
212 int value, int x, int y);
216 AssetEditWindow *fwindow;
219 class DetailAssetWindow : public BC_Window
224 BC_ScrollTextBox *text;
226 DetailAssetWindow(MWindow *mwindow,
227 DetailAssetDialog *detail_dialog, Asset *asset);
228 ~DetailAssetWindow();
229 void create_objects();
230 DetailAssetDialog *detail_dialog;
233 class DetailAssetDialog : public BC_DialogThread
236 DetailAssetWindow *dwindow;
238 DetailAssetDialog(MWindow *mwindow);
239 ~DetailAssetDialog();
240 void start(Asset *asset, int x, int y);
241 BC_Window* new_gui();
248 class DetailAssetButton : public BC_GenericButton
251 DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
252 ~DetailAssetButton();
254 AssetEditWindow *fwindow;