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 BC_TextBox *tc_hrs, *tc_mins;
84 BC_TextBox *tc_secs, *tc_rest;
85 DetailAssetDialog *detail_dialog;
86 void show_info_detail();
91 class AssetEditPath : public BrowseButton
94 AssetEditPath(MWindow *mwindow,
95 AssetEditWindow *fwindow,
99 const char *window_title = _(PROGRAM_NAME ": Path"),
100 const char *window_caption = _("Select a file"));
103 AssetEditWindow *fwindow;
107 class AssetEditPathText : public BC_TextBox
110 AssetEditPathText(AssetEditWindow *fwindow, int y);
111 ~AssetEditPathText();
114 AssetEditWindow *fwindow;
119 class AssetEditChannels : public BC_TumbleTextBox
122 AssetEditChannels(AssetEditWindow *fwindow,
123 char *text, int x, int y);
127 AssetEditWindow *fwindow;
130 class AssetEditRate : public BC_TextBox
133 AssetEditRate(AssetEditWindow *fwindow,
134 char *text, int x, int y);
138 AssetEditWindow *fwindow;
141 class AssetEditFRate : public BC_TextBox
144 AssetEditFRate(AssetEditWindow *fwindow,
145 char *text, int x, int y);
149 AssetEditWindow *fwindow;
152 class AssetEditILacemode : public BC_TextBox
155 AssetEditILacemode(AssetEditWindow *fwindow,
156 const char *text, int x, int y, int w);
159 AssetEditWindow *fwindow;
162 class AssetEditInterlacemodePulldown : public BC_ListBox
165 AssetEditInterlacemodePulldown(MWindow *mwindow,
166 BC_TextBox *output_text, int *output_value,
167 ArrayList<BC_ListBoxItem*> *data, int x, int y);
169 char* interlacemode_to_text();
171 BC_TextBox *output_text;
174 char string[BCTEXTLEN];
177 class AssetEditHeader : public BC_TextBox
180 AssetEditHeader(AssetEditWindow *fwindow,
181 char *text, int x, int y);
185 AssetEditWindow *fwindow;
188 class AssetEditByteOrderLOHI : public BC_Radial
191 AssetEditByteOrderLOHI(AssetEditWindow *fwindow,
192 int value, int x, int y);
196 AssetEditWindow *fwindow;
199 class AssetEditByteOrderHILO : public BC_Radial
202 AssetEditByteOrderHILO(AssetEditWindow *fwindow,
203 int value, int x, int y);
207 AssetEditWindow *fwindow;
210 class AssetEditSigned : public BC_CheckBox
213 AssetEditSigned(AssetEditWindow *fwindow,
214 int value, int x, int y);
218 AssetEditWindow *fwindow;
221 class DetailAssetWindow : public BC_Window
226 BC_ScrollTextBox *text;
228 DetailAssetWindow(MWindow *mwindow,
229 DetailAssetDialog *detail_dialog, Asset *asset);
230 ~DetailAssetWindow();
231 void create_objects();
232 DetailAssetDialog *detail_dialog;
235 class DetailAssetDialog : public BC_DialogThread
238 DetailAssetWindow *dwindow;
240 DetailAssetDialog(MWindow *mwindow);
241 ~DetailAssetDialog();
242 void start(Asset *asset, int x, int y);
243 BC_Window* new_gui();
250 class DetailAssetButton : public BC_GenericButton
253 DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
254 ~DetailAssetButton();
256 AssetEditWindow *fwindow;