r136: This commit was manufactured by cvs2svn to create tag 'hv_1_1_8'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / channeledit.h
blob169cfe25a4f9157855e4e2992c858dcdff27381a
1 #ifndef CHANNELEDIT_H
2 #define CHANNELEDIT_H
4 #include "guicast.h"
5 #include "channel.inc"
6 #include "channelpicker.inc"
7 #include "mutex.h"
8 #include "mwindow.inc"
9 #include "record.h"
11 class ChannelEditWindow;
13 class ChannelEditThread : public Thread
15 public:
16 ChannelEditThread(MWindow *mwindow,
17 ChannelPicker *channel_picker,
18 ArrayList<Channel*> *channeldb,
19 Record *Record);
20 ~ChannelEditThread();
21 void run();
22 int close_threads();
24 Mutex completion;
25 int in_progress;
26 int current_channel;
27 ChannelPicker *channel_picker;
28 ArrayList<Channel*> *channeldb;
29 ArrayList <Channel*> *new_channels;
30 ChannelEditWindow *window;
31 MWindow *mwindow;
32 Record *record;
35 class ChannelEditList;
36 class ChannelEditEditThread;
37 class ChannelEditPictureThread;
39 class ChannelEditWindow : public BC_Window
41 public:
42 ChannelEditWindow(MWindow *mwindow, ChannelEditThread *thread, ChannelPicker *channel_picker);
43 ~ChannelEditWindow();
45 int create_objects();
46 int close_event();
47 int add_channel(); // Start the thread for adding a channel
48 int delete_channel(int channel);
49 int delete_channel(Channel *channel);
50 int edit_channel();
51 int edit_picture();
52 int update_list(); // Synchronize the list box with the channel arrays
53 int update_list(Channel *channel); // Synchronize the list box and the channel
54 int update_output();
55 int move_channel_up();
56 int move_channel_down();
57 int change_channel_from_list(int channel_number);
60 ArrayList<BC_ListBoxItem*> channel_list;
61 ChannelEditList *list_box;
62 ChannelEditThread *thread;
63 ChannelPicker *channel_picker;
64 ChannelEditEditThread *edit_thread;
65 ChannelEditPictureThread *picture_thread;
66 MWindow *mwindow;
69 class ChannelEditSelect : public BC_GenericButton
71 public:
72 ChannelEditSelect(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
73 ~ChannelEditSelect();
74 int handle_event();
75 ChannelEditWindow *window;
79 class ChannelEditAdd : public BC_GenericButton
81 public:
82 ChannelEditAdd(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
83 ~ChannelEditAdd();
84 int handle_event();
85 ChannelEditWindow *window;
88 class ChannelEditList : public BC_ListBox
90 public:
91 ChannelEditList(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
92 ~ChannelEditList();
93 int handle_event();
94 ChannelEditWindow *window;
95 static char *column_titles[2];
98 class ChannelEditMoveUp : public BC_GenericButton
100 public:
101 ChannelEditMoveUp(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
102 ~ChannelEditMoveUp();
103 int handle_event();
104 ChannelEditWindow *window;
107 class ChannelEditMoveDown : public BC_GenericButton
109 public:
110 ChannelEditMoveDown(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
111 ~ChannelEditMoveDown();
112 int handle_event();
113 ChannelEditWindow *window;
116 class ChannelEditDel : public BC_GenericButton
118 public:
119 ChannelEditDel(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
120 ~ChannelEditDel();
121 int handle_event();
122 ChannelEditWindow *window;
125 class ChannelEdit : public BC_GenericButton
127 public:
128 ChannelEdit(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
129 ~ChannelEdit();
130 int handle_event();
131 ChannelEditWindow *window;
134 class ChannelEditPicture : public BC_GenericButton
136 public:
137 ChannelEditPicture(MWindow *mwindow, ChannelEditWindow *window, int x, int y);
138 ~ChannelEditPicture();
139 int handle_event();
140 ChannelEditWindow *window;
144 // ============================= Edit a single channel
146 class ChannelEditEditSource;
147 class ChannelEditEditWindow;
149 class ChannelEditEditThread : public Thread
151 public:
152 ChannelEditEditThread(ChannelEditWindow *window,
153 ChannelPicker *channel_picker,
154 Record *record);
155 ~ChannelEditEditThread();
157 void run();
158 int edit_channel(Channel *channel, int editing);
159 void set_device(); // Set the device to the new channel
160 int change_source(char *source_name); // Change to the source matching the name
161 int source_up();
162 int source_down();
163 int set_input(int value);
164 int set_norm(int value);
165 int set_freqtable(int value);
166 char* value_to_freqtable(int value);
167 char* value_to_norm(int value);
168 char* value_to_input(int value);
169 int close_threads();
171 Channel new_channel;
172 Channel *output_channel;
173 ChannelPicker *channel_picker;
174 ChannelEditWindow *window;
175 ChannelEditEditSource *source_text;
176 ChannelEditEditWindow *edit_window;
177 Record *record;
178 int editing; // Tells whether or not to delete the channel on cancel
179 int in_progress; // Allow only 1 thread at a time
180 Mutex completion;
183 class ChannelEditEditWindow : public BC_Window
185 public:
186 ChannelEditEditWindow(ChannelEditEditThread *thread,
187 ChannelEditWindow *window,
188 ChannelPicker *channel_picker);
189 ~ChannelEditEditWindow();
190 int create_objects(Channel *channel);
192 ChannelEditEditThread *thread;
193 ChannelEditWindow *window;
194 Channel *new_channel;
195 ChannelPicker *channel_picker;
198 class ChannelEditEditTitle : public BC_TextBox
200 public:
201 ChannelEditEditTitle(int x, int y, ChannelEditEditThread *thread);
202 ~ChannelEditEditTitle();
203 int handle_event();
204 ChannelEditEditThread *thread;
207 class ChannelEditEditSource : public BC_TextBox
209 public:
210 ChannelEditEditSource(int x, int y, ChannelEditEditThread *thread);
211 ~ChannelEditEditSource();
212 int handle_event();
213 ChannelEditEditThread *thread;
216 class ChannelEditEditSourceTumbler : public BC_Tumbler
218 public:
219 ChannelEditEditSourceTumbler(int x, int y, ChannelEditEditThread *thread);
220 ~ChannelEditEditSourceTumbler();
221 int handle_up_event();
222 int handle_down_event();
223 ChannelEditEditThread *thread;
226 class ChannelEditEditInput : public BC_PopupMenu
228 public:
229 ChannelEditEditInput(int x, int y, ChannelEditEditThread *thread, Record *record);
230 ~ChannelEditEditInput();
231 int add_items();
232 int handle_event();
233 ChannelEditEditThread *thread;
234 Record *record;
237 class ChannelEditEditInputItem : public BC_MenuItem
239 public:
240 ChannelEditEditInputItem(ChannelEditEditThread *thread, char *text, int value);
241 ~ChannelEditEditInputItem();
242 int handle_event();
243 ChannelEditEditThread *thread;
244 int value;
247 class ChannelEditEditNorm : public BC_PopupMenu
249 public:
250 ChannelEditEditNorm(int x, int y, ChannelEditEditThread *thread);
251 ~ChannelEditEditNorm();
252 int add_items();
253 ChannelEditEditThread *thread;
256 class ChannelEditEditNormItem : public BC_MenuItem
258 public:
259 ChannelEditEditNormItem(ChannelEditEditThread *thread, char *text, int value);
260 ~ChannelEditEditNormItem();
261 int handle_event();
262 ChannelEditEditThread *thread;
263 int value;
266 class ChannelEditEditFreqtable : public BC_PopupMenu
268 public:
269 ChannelEditEditFreqtable(int x, int y, ChannelEditEditThread *thread);
270 ~ChannelEditEditFreqtable();
272 int add_items();
274 ChannelEditEditThread *thread;
277 class ChannelEditEditFreqItem : public BC_MenuItem
279 public:
280 ChannelEditEditFreqItem(ChannelEditEditThread *thread, char *text, int value);
281 ~ChannelEditEditFreqItem();
283 int handle_event();
284 ChannelEditEditThread *thread;
285 int value;
288 class ChannelEditEditFine : public BC_ISlider
290 public:
291 ChannelEditEditFine(int x, int y, ChannelEditEditThread *thread);
292 ~ChannelEditEditFine();
293 int handle_event();
294 ChannelEditEditThread *thread;
297 // =================== Edit the picture quality
300 class ChannelEditPictureWindow;
302 class ChannelEditPictureThread : public Thread
304 public:
305 ChannelEditPictureThread(ChannelPicker *channel_picker, ChannelEditWindow *window);
306 ~ChannelEditPictureThread();
308 void run();
309 int close_threads();
310 int edit_picture();
312 int in_progress; // Allow only 1 thread at a time
313 Mutex completion;
314 ChannelPicker *channel_picker;
315 ChannelEditWindow *window;
316 ChannelEditPictureWindow *edit_window;
319 class ChannelEditPictureWindow : public BC_Window
321 public:
322 ChannelEditPictureWindow(ChannelEditPictureThread *thread, ChannelPicker *channel_picker);
323 ~ChannelEditPictureWindow();
324 int create_objects();
326 ChannelEditPictureThread *thread;
327 ChannelPicker *channel_picker;
330 class ChannelEditBright : public BC_IPot
332 public:
333 ChannelEditBright(int x, int y, ChannelPicker *channel_picker, int value);
334 ~ChannelEditBright();
335 int handle_event();
336 int button_release_event();
337 ChannelPicker *channel_picker;
340 class ChannelEditContrast : public BC_IPot
342 public:
343 ChannelEditContrast(int x, int y, ChannelPicker *channel_picker, int value);
344 ~ChannelEditContrast();
345 int handle_event();
346 int button_release_event();
347 ChannelPicker *channel_picker;
350 class ChannelEditColor : public BC_IPot
352 public:
353 ChannelEditColor(int x, int y, ChannelPicker *channel_picker, int value);
354 ~ChannelEditColor();
355 int handle_event();
356 int button_release_event();
357 ChannelPicker *channel_picker;
360 class ChannelEditHue : public BC_IPot
362 public:
363 ChannelEditHue(int x, int y, ChannelPicker *channel_picker, int value);
364 ~ChannelEditHue();
365 int handle_event();
366 int button_release_event();
367 ChannelPicker *channel_picker;
370 class ChannelEditWhiteness : public BC_IPot
372 public:
373 ChannelEditWhiteness(int x, int y, ChannelPicker *channel_picker, int value);
374 ~ChannelEditWhiteness();
375 int handle_event();
376 int button_release_event();
377 ChannelPicker *channel_picker;
382 #endif