initial commit
[goodguy/history.git] / cinelerra-5.0 / 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 "awindow.inc"
27 #include "bcdialog.h"
28 #include "bitspopup.inc"
29 #include "browsebutton.h"
30 #include "formatpopup.h"
31 #include "guicast.h"
32 #include "indexable.inc"
33 #include "language.h"
34 #include "mwindow.h"
35 #include "resizetrackthread.inc"
36
37
38 class AssetEditByteOrderHILO;
39 class AssetEditByteOrderLOHI;
40 class AssetEditPath;
41 class AssetEditPathText;
42 class AssetEditWindow;
43
44 class DetailAssetWindow;
45 class DetailAssetThread;
46 class DetailAssetButton;
47
48 class AssetEdit : public BC_DialogThread
49 {
50 public:
51         AssetEdit(MWindow *mwindow);
52         ~AssetEdit();
53         
54         void edit_asset(Indexable *indexable);
55         int set_asset(Indexable *indexable);
56         void handle_close_event(int result);
57         BC_Window* new_gui();
58
59         Indexable *indexable;
60         MWindow *mwindow;
61         AssetEditWindow *window;
62
63
64 // Changed parameters
65         Asset *changed_params;
66 };
67
68
69
70 // Pcm is the only format users should be able to fix.
71 // All other formats display information about the file in read-only.
72
73 class AssetEditWindow : public BC_Window
74 {
75 public:
76         AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit);
77         ~AssetEditWindow();
78
79         void create_objects();
80         AssetEditPathText *path_text;
81         AssetEditPath *path_button;
82         AssetEditByteOrderHILO *hilo;
83         AssetEditByteOrderLOHI *lohi;
84         BitsPopup *bitspopup;
85         int allow_edits;
86         MWindow *mwindow;
87         AssetEdit *asset_edit;
88         BC_Title *win_width;
89         BC_Title *win_height;
90         DetailAssetThread *detail_thread;
91         void show_info_detail();
92 };
93
94
95 class AssetEditPath : public BrowseButton
96 {
97 public:
98         AssetEditPath(MWindow *mwindow, 
99                 AssetEditWindow *fwindow, 
100                 BC_TextBox *textbox, 
101                 int y, 
102                 const char *text, 
103                 const char *window_title = _(PROGRAM_NAME " Path"), 
104                 const char *window_caption = _("Select a file"));
105         ~AssetEditPath();
106         
107         AssetEditWindow *fwindow;
108 };
109
110
111 class AssetEditPathText : public BC_TextBox
112 {
113 public:
114         AssetEditPathText(AssetEditWindow *fwindow, int y);
115         ~AssetEditPathText();
116         int handle_event();
117
118         AssetEditWindow *fwindow;
119 };
120
121
122
123 class AssetEditFormat : public FormatPopup
124 {
125 public:
126         AssetEditFormat(AssetEditWindow *fwindow, char* default_, int y);
127         ~AssetEditFormat();
128         
129         int handle_event();
130         AssetEditWindow *fwindow;
131 };
132
133
134 class AssetEditChannels : public BC_TumbleTextBox
135 {
136 public:
137         AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y);
138         
139         int handle_event();
140         
141         AssetEditWindow *fwindow;
142 };
143
144 class AssetEditRate : public BC_TextBox
145 {
146 public:
147         AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y);
148         
149         int handle_event();
150         
151         AssetEditWindow *fwindow;
152 };
153
154 class AssetEditFRate : public BC_TextBox
155 {
156 public:
157         AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y);
158         
159         int handle_event();
160         
161         AssetEditWindow *fwindow;
162 };
163
164 class AssetEditHeader : public BC_TextBox
165 {
166 public:
167         AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y);
168         
169         int handle_event();
170         
171         AssetEditWindow *fwindow;
172 };
173
174 class AssetEditByteOrderLOHI : public BC_Radial
175 {
176 public:
177         AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y);
178         
179         int handle_event();
180         
181         AssetEditWindow *fwindow;
182 };
183
184 class AssetEditByteOrderHILO : public BC_Radial
185 {
186 public:
187         AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y);
188         
189         int handle_event();
190         
191         AssetEditWindow *fwindow;
192 };
193
194 class AssetEditSigned : public BC_CheckBox
195 {
196 public:
197         AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y);
198         
199         int handle_event();
200         
201         AssetEditWindow *fwindow;
202 };
203
204 class DetailAssetWindow : public BC_Window
205 {
206         MWindow *mwindow;
207         Asset *asset;
208         char info[65536];
209         BC_ScrollTextBox *text;
210 public:
211         DetailAssetWindow(MWindow *mwindow, Asset *asset);
212         ~DetailAssetWindow();
213         void create_objects();
214 };
215
216 class DetailAssetThread : public Thread
217 {
218         MWindow *mwindow;
219         DetailAssetWindow *dwindow;
220 public:
221         DetailAssetThread(MWindow *mwindow);
222         ~DetailAssetThread();
223
224         void start(Asset *asset);
225         void run();
226 };
227
228
229 class DetailAssetButton : public BC_GenericButton
230 {
231 public:
232         DetailAssetButton(AssetEditWindow *fwindow, int x, int y);
233         ~DetailAssetButton();
234
235         AssetEditWindow *fwindow;
236         int handle_event();
237 };
238
239 #endif