r1005: Increase the number of displayed digits for resample audio dialog box
[cinelerra_cv/mob.git] / cinelerra / channeledit.h
blobc9e0a4537ba98f115f54e073b15fa5d7edab08ad
1 #ifndef CHANNELEDIT_H
2 #define CHANNELEDIT_H
4 #include "bcdialog.h"
5 #include "bcprogressbox.inc"
6 #include "guicast.h"
7 #include "channel.inc"
8 #include "channeldb.inc"
9 #include "channelpicker.inc"
10 #include "condition.inc"
11 #include "mutex.inc"
12 #include "picture.inc"
13 #include "record.h"
15 class ChannelEditWindow;
16 class ScanThread;
18 class ChannelEditThread : public Thread
20 public:
21 ChannelEditThread(ChannelPicker *channel_picker,
22 ChannelDB *channeldb);
23 ~ChannelEditThread();
24 void run();
25 int close_threads();
26 char* value_to_freqtable(int value);
27 char* value_to_norm(int value);
28 char* value_to_input(int value);
30 Condition *completion;
31 int in_progress;
32 int current_channel;
33 Channel scan_params;
34 ChannelPicker *channel_picker;
35 ChannelDB *channeldb;
36 ChannelDB *new_channels;
37 ChannelEditWindow *window;
38 ScanThread *scan_thread;
41 class ChannelEditList;
42 class ChannelEditEditThread;
43 class ChannelEditPictureThread;
44 class ConfirmScanThread;
46 class ChannelEditWindow : public BC_Window
48 public:
49 ChannelEditWindow(ChannelEditThread *thread,
50 ChannelPicker *channel_picker);
51 ~ChannelEditWindow();
53 int create_objects();
54 int close_event();
55 int add_channel(); // Start the thread for adding a channel
56 int delete_channel(int channel);
57 int delete_channel(Channel *channel);
58 int edit_channel();
59 int edit_picture();
60 int update_list(); // Synchronize the list box with the channel arrays
61 int update_list(Channel *channel); // Synchronize the list box and the channel
62 int update_output();
63 int move_channel_up();
64 int move_channel_down();
65 int change_channel_from_list(int channel_number);
66 void sort();
67 void scan_confirm();
68 void scan();
71 ArrayList<BC_ListBoxItem*> channel_list;
72 ChannelEditList *list_box;
73 ChannelEditThread *thread;
74 ChannelPicker *channel_picker;
75 ChannelEditEditThread *edit_thread;
76 ChannelEditPictureThread *picture_thread;
77 ConfirmScanThread *scan_confirm_thread;
80 class ChannelEditSelect : public BC_GenericButton
82 public:
83 ChannelEditSelect(ChannelEditWindow *window, int x, int y);
84 ~ChannelEditSelect();
85 int handle_event();
86 ChannelEditWindow *window;
90 class ChannelEditAdd : public BC_GenericButton
92 public:
93 ChannelEditAdd(ChannelEditWindow *window, int x, int y);
94 ~ChannelEditAdd();
95 int handle_event();
96 ChannelEditWindow *window;
99 class ChannelEditList : public BC_ListBox
101 public:
102 ChannelEditList(ChannelEditWindow *window, int x, int y);
103 ~ChannelEditList();
104 int handle_event();
105 ChannelEditWindow *window;
106 static char *column_titles[2];
109 class ChannelEditMoveUp : public BC_GenericButton
111 public:
112 ChannelEditMoveUp(ChannelEditWindow *window, int x, int y);
113 ~ChannelEditMoveUp();
114 int handle_event();
115 ChannelEditWindow *window;
118 class ChannelEditMoveDown : public BC_GenericButton
120 public:
121 ChannelEditMoveDown(ChannelEditWindow *window, int x, int y);
122 ~ChannelEditMoveDown();
123 int handle_event();
124 ChannelEditWindow *window;
127 class ChannelEditSort : public BC_GenericButton
129 public:
130 ChannelEditSort(ChannelEditWindow *window, int x, int y);
131 int handle_event();
132 ChannelEditWindow *window;
135 class ChannelEditScan : public BC_GenericButton
137 public:
138 ChannelEditScan(ChannelEditWindow *window, int x, int y);
139 int handle_event();
140 ChannelEditWindow *window;
143 class ChannelEditDel : public BC_GenericButton
145 public:
146 ChannelEditDel(ChannelEditWindow *window, int x, int y);
147 ~ChannelEditDel();
148 int handle_event();
149 ChannelEditWindow *window;
152 class ChannelEdit : public BC_GenericButton
154 public:
155 ChannelEdit(ChannelEditWindow *window, int x, int y);
156 ~ChannelEdit();
157 int handle_event();
158 ChannelEditWindow *window;
161 class ChannelEditPicture : public BC_GenericButton
163 public:
164 ChannelEditPicture(ChannelEditWindow *window, int x, int y);
165 ~ChannelEditPicture();
166 int handle_event();
167 ChannelEditWindow *window;
176 // ============================== Confirm overwrite with scanning
178 class ConfirmScan : public BC_Window
180 public:
181 ConfirmScan(ChannelEditWindow *gui, int x, int y);
182 void create_objects();
183 ChannelEditWindow *gui;
186 class ConfirmScanThread : public BC_DialogThread
188 public:
189 ConfirmScanThread(ChannelEditWindow *gui);
190 void handle_done_event(int result);
191 BC_Window* new_gui();
192 ChannelEditWindow *gui;
199 // ============================= Scan
201 class ScanThread : public Thread
203 public:
204 ScanThread(ChannelEditThread *edit);
205 ~ScanThread();
207 void start();
208 void run();
210 ChannelEditThread *edit;
211 int interrupt;
212 BC_ProgressBox *progress;
221 // ============================= Edit a single channel
223 class ChannelEditEditSource;
224 class ChannelEditEditWindow;
226 class ChannelEditEditThread : public Thread
228 public:
229 ChannelEditEditThread(ChannelEditWindow *window,
230 ChannelPicker *channel_picker);
231 ~ChannelEditEditThread();
233 void run();
234 int edit_channel(Channel *channel, int editing);
235 void set_device(); // Set the device to the new channel
236 int change_source(char *source_name); // Change to the source matching the name
237 int source_up();
238 int source_down();
239 int set_input(int value);
240 int set_norm(int value);
241 int set_freqtable(int value);
242 int close_threads();
244 Channel new_channel;
245 Channel *output_channel;
246 ChannelPicker *channel_picker;
247 ChannelEditWindow *window;
248 ChannelEditEditSource *source_text;
249 ChannelEditEditWindow *edit_window;
250 int editing; // Tells whether or not to delete the channel on cancel
251 int in_progress; // Allow only 1 thread at a time
252 int user_title;
253 Condition *completion;
256 class ChannelEditEditTitle;
259 class ChannelEditEditWindow : public BC_Window
261 public:
262 ChannelEditEditWindow(ChannelEditEditThread *thread,
263 ChannelEditWindow *window,
264 ChannelPicker *channel_picker);
265 ~ChannelEditEditWindow();
266 int create_objects(Channel *channel);
268 ChannelEditEditThread *thread;
269 ChannelEditWindow *window;
270 ChannelEditEditTitle *title_text;
271 Channel *new_channel;
272 ChannelPicker *channel_picker;
275 class ChannelEditEditTitle : public BC_TextBox
277 public:
278 ChannelEditEditTitle(int x, int y, ChannelEditEditThread *thread);
279 ~ChannelEditEditTitle();
280 int handle_event();
281 ChannelEditEditThread *thread;
284 class ChannelEditEditSource : public BC_TextBox
286 public:
287 ChannelEditEditSource(int x, int y, ChannelEditEditThread *thread);
288 ~ChannelEditEditSource();
289 int handle_event();
290 ChannelEditEditThread *thread;
293 class ChannelEditEditSourceTumbler : public BC_Tumbler
295 public:
296 ChannelEditEditSourceTumbler(int x, int y, ChannelEditEditThread *thread);
297 ~ChannelEditEditSourceTumbler();
298 int handle_up_event();
299 int handle_down_event();
300 ChannelEditEditThread *thread;
303 class ChannelEditEditInput : public BC_PopupMenu
305 public:
306 ChannelEditEditInput(int x,
307 int y,
308 ChannelEditEditThread *thread,
309 ChannelEditThread *edit);
310 ~ChannelEditEditInput();
311 int add_items();
312 int handle_event();
313 ChannelEditEditThread *thread;
314 ChannelEditThread *edit;
317 class ChannelEditEditInputItem : public BC_MenuItem
319 public:
320 ChannelEditEditInputItem(ChannelEditEditThread *thread,
321 ChannelEditThread *edit,
322 char *text,
323 int value);
324 ~ChannelEditEditInputItem();
325 int handle_event();
326 ChannelEditEditThread *thread;
327 ChannelEditThread *edit;
328 int value;
331 class ChannelEditEditNorm : public BC_PopupMenu
333 public:
334 ChannelEditEditNorm(int x,
335 int y,
336 ChannelEditEditThread *thread,
337 ChannelEditThread *edit);
338 ~ChannelEditEditNorm();
339 int add_items();
340 ChannelEditEditThread *thread;
341 ChannelEditThread *edit;
344 class ChannelEditEditNormItem : public BC_MenuItem
346 public:
347 ChannelEditEditNormItem(ChannelEditEditThread *thread,
348 ChannelEditThread *edit,
349 char *text,
350 int value);
351 ~ChannelEditEditNormItem();
352 int handle_event();
353 ChannelEditEditThread *thread;
354 ChannelEditThread *edit;
355 int value;
358 class ChannelEditEditFreqtable : public BC_PopupMenu
360 public:
361 ChannelEditEditFreqtable(int x,
362 int y,
363 ChannelEditEditThread *thread,
364 ChannelEditThread *edit);
365 ~ChannelEditEditFreqtable();
367 int add_items();
369 ChannelEditEditThread *thread;
370 ChannelEditThread *edit;
373 class ChannelEditEditFreqItem : public BC_MenuItem
375 public:
376 ChannelEditEditFreqItem(ChannelEditEditThread *thread,
377 ChannelEditThread *edit,
378 char *text,
379 int value);
380 ~ChannelEditEditFreqItem();
382 int handle_event();
383 ChannelEditEditThread *thread;
384 ChannelEditThread *edit;
385 int value;
388 class ChannelEditEditFine : public BC_ISlider
390 public:
391 ChannelEditEditFine(int x, int y, ChannelEditEditThread *thread);
392 ~ChannelEditEditFine();
393 int handle_event();
394 int button_release_event();
395 ChannelEditEditThread *thread;
398 // =================== Edit the picture quality
401 class ChannelEditPictureWindow;
403 class ChannelEditPictureThread : public Thread
405 public:
406 ChannelEditPictureThread(ChannelPicker *channel_picker, ChannelEditWindow *window);
407 ~ChannelEditPictureThread();
409 void run();
410 int close_threads();
411 int edit_picture();
413 int in_progress; // Allow only 1 thread at a time
414 Condition *completion;
415 ChannelPicker *channel_picker;
416 ChannelEditWindow *window;
417 ChannelEditPictureWindow *edit_window;
420 class ChannelEditPictureWindow : public BC_Window
422 public:
423 ChannelEditPictureWindow(ChannelEditPictureThread *thread,
424 ChannelPicker *channel_picker);
425 ~ChannelEditPictureWindow();
427 int calculate_h(ChannelPicker *channel_picker);
428 int create_objects();
430 ChannelEditPictureThread *thread;
431 ChannelPicker *channel_picker;
434 class ChannelEditBright : public BC_IPot
436 public:
437 ChannelEditBright(int x, int y, ChannelPicker *channel_picker, int value);
438 ~ChannelEditBright();
439 int handle_event();
440 int button_release_event();
441 ChannelPicker *channel_picker;
444 class ChannelEditContrast : public BC_IPot
446 public:
447 ChannelEditContrast(int x, int y, ChannelPicker *channel_picker, int value);
448 ~ChannelEditContrast();
449 int handle_event();
450 int button_release_event();
451 ChannelPicker *channel_picker;
454 class ChannelEditColor : public BC_IPot
456 public:
457 ChannelEditColor(int x, int y, ChannelPicker *channel_picker, int value);
458 ~ChannelEditColor();
459 int handle_event();
460 int button_release_event();
461 ChannelPicker *channel_picker;
464 class ChannelEditHue : public BC_IPot
466 public:
467 ChannelEditHue(int x, int y, ChannelPicker *channel_picker, int value);
468 ~ChannelEditHue();
469 int handle_event();
470 int button_release_event();
471 ChannelPicker *channel_picker;
474 class ChannelEditWhiteness : public BC_IPot
476 public:
477 ChannelEditWhiteness(int x, int y, ChannelPicker *channel_picker, int value);
478 ~ChannelEditWhiteness();
479 int handle_event();
480 int button_release_event();
481 ChannelPicker *channel_picker;
486 class ChannelEditCommon : public BC_IPot
488 public:;
489 ChannelEditCommon(int x,
490 int y,
491 ChannelPicker *channel_picker,
492 PictureItem *item);
493 ~ChannelEditCommon();
494 int handle_event();
495 int button_release_event();
496 ChannelPicker *channel_picker;
497 int device_id;
502 #endif