5 #include "bcprogressbox.inc"
8 #include "channeldb.inc"
9 #include "channelpicker.inc"
10 #include "condition.inc"
12 #include "picture.inc"
15 class ChannelEditWindow
;
18 class ChannelEditThread
: public Thread
21 ChannelEditThread(ChannelPicker
*channel_picker
,
22 ChannelDB
*channeldb
);
26 char* value_to_freqtable(int value
);
27 char* value_to_norm(int value
);
28 char* value_to_input(int value
);
30 Condition
*completion
;
34 ChannelPicker
*channel_picker
;
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
49 ChannelEditWindow(ChannelEditThread
*thread
,
50 ChannelPicker
*channel_picker
);
55 int add_channel(); // Start the thread for adding a channel
56 int delete_channel(int channel
);
57 int delete_channel(Channel
*channel
);
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
63 int move_channel_up();
64 int move_channel_down();
65 int change_channel_from_list(int channel_number
);
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
83 ChannelEditSelect(ChannelEditWindow
*window
, int x
, int y
);
86 ChannelEditWindow
*window
;
90 class ChannelEditAdd
: public BC_GenericButton
93 ChannelEditAdd(ChannelEditWindow
*window
, int x
, int y
);
96 ChannelEditWindow
*window
;
99 class ChannelEditList
: public BC_ListBox
102 ChannelEditList(ChannelEditWindow
*window
, int x
, int y
);
105 ChannelEditWindow
*window
;
106 static char *column_titles
[2];
109 class ChannelEditMoveUp
: public BC_GenericButton
112 ChannelEditMoveUp(ChannelEditWindow
*window
, int x
, int y
);
113 ~ChannelEditMoveUp();
115 ChannelEditWindow
*window
;
118 class ChannelEditMoveDown
: public BC_GenericButton
121 ChannelEditMoveDown(ChannelEditWindow
*window
, int x
, int y
);
122 ~ChannelEditMoveDown();
124 ChannelEditWindow
*window
;
127 class ChannelEditSort
: public BC_GenericButton
130 ChannelEditSort(ChannelEditWindow
*window
, int x
, int y
);
132 ChannelEditWindow
*window
;
135 class ChannelEditScan
: public BC_GenericButton
138 ChannelEditScan(ChannelEditWindow
*window
, int x
, int y
);
140 ChannelEditWindow
*window
;
143 class ChannelEditDel
: public BC_GenericButton
146 ChannelEditDel(ChannelEditWindow
*window
, int x
, int y
);
149 ChannelEditWindow
*window
;
152 class ChannelEdit
: public BC_GenericButton
155 ChannelEdit(ChannelEditWindow
*window
, int x
, int y
);
158 ChannelEditWindow
*window
;
161 class ChannelEditPicture
: public BC_GenericButton
164 ChannelEditPicture(ChannelEditWindow
*window
, int x
, int y
);
165 ~ChannelEditPicture();
167 ChannelEditWindow
*window
;
176 // ============================== Confirm overwrite with scanning
178 class ConfirmScan
: public BC_Window
181 ConfirmScan(ChannelEditWindow
*gui
, int x
, int y
);
182 void create_objects();
183 ChannelEditWindow
*gui
;
186 class ConfirmScanThread
: public BC_DialogThread
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
204 ScanThread(ChannelEditThread
*edit
);
210 ChannelEditThread
*edit
;
212 BC_ProgressBox
*progress
;
221 // ============================= Edit a single channel
223 class ChannelEditEditSource
;
224 class ChannelEditEditWindow
;
226 class ChannelEditEditThread
: public Thread
229 ChannelEditEditThread(ChannelEditWindow
*window
,
230 ChannelPicker
*channel_picker
);
231 ~ChannelEditEditThread();
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
239 int set_input(int value
);
240 int set_norm(int value
);
241 int set_freqtable(int value
);
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
253 Condition
*completion
;
256 class ChannelEditEditTitle
;
259 class ChannelEditEditWindow
: public BC_Window
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
278 ChannelEditEditTitle(int x
, int y
, ChannelEditEditThread
*thread
);
279 ~ChannelEditEditTitle();
281 ChannelEditEditThread
*thread
;
284 class ChannelEditEditSource
: public BC_TextBox
287 ChannelEditEditSource(int x
, int y
, ChannelEditEditThread
*thread
);
288 ~ChannelEditEditSource();
290 ChannelEditEditThread
*thread
;
293 class ChannelEditEditSourceTumbler
: public BC_Tumbler
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
306 ChannelEditEditInput(int x
,
308 ChannelEditEditThread
*thread
,
309 ChannelEditThread
*edit
);
310 ~ChannelEditEditInput();
313 ChannelEditEditThread
*thread
;
314 ChannelEditThread
*edit
;
317 class ChannelEditEditInputItem
: public BC_MenuItem
320 ChannelEditEditInputItem(ChannelEditEditThread
*thread
,
321 ChannelEditThread
*edit
,
324 ~ChannelEditEditInputItem();
326 ChannelEditEditThread
*thread
;
327 ChannelEditThread
*edit
;
331 class ChannelEditEditNorm
: public BC_PopupMenu
334 ChannelEditEditNorm(int x
,
336 ChannelEditEditThread
*thread
,
337 ChannelEditThread
*edit
);
338 ~ChannelEditEditNorm();
340 ChannelEditEditThread
*thread
;
341 ChannelEditThread
*edit
;
344 class ChannelEditEditNormItem
: public BC_MenuItem
347 ChannelEditEditNormItem(ChannelEditEditThread
*thread
,
348 ChannelEditThread
*edit
,
351 ~ChannelEditEditNormItem();
353 ChannelEditEditThread
*thread
;
354 ChannelEditThread
*edit
;
358 class ChannelEditEditFreqtable
: public BC_PopupMenu
361 ChannelEditEditFreqtable(int x
,
363 ChannelEditEditThread
*thread
,
364 ChannelEditThread
*edit
);
365 ~ChannelEditEditFreqtable();
369 ChannelEditEditThread
*thread
;
370 ChannelEditThread
*edit
;
373 class ChannelEditEditFreqItem
: public BC_MenuItem
376 ChannelEditEditFreqItem(ChannelEditEditThread
*thread
,
377 ChannelEditThread
*edit
,
380 ~ChannelEditEditFreqItem();
383 ChannelEditEditThread
*thread
;
384 ChannelEditThread
*edit
;
388 class ChannelEditEditFine
: public BC_ISlider
391 ChannelEditEditFine(int x
, int y
, ChannelEditEditThread
*thread
);
392 ~ChannelEditEditFine();
394 int button_release_event();
395 ChannelEditEditThread
*thread
;
398 // =================== Edit the picture quality
401 class ChannelEditPictureWindow
;
403 class ChannelEditPictureThread
: public Thread
406 ChannelEditPictureThread(ChannelPicker
*channel_picker
, ChannelEditWindow
*window
);
407 ~ChannelEditPictureThread();
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
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
437 ChannelEditBright(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
438 ~ChannelEditBright();
440 int button_release_event();
441 ChannelPicker
*channel_picker
;
444 class ChannelEditContrast
: public BC_IPot
447 ChannelEditContrast(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
448 ~ChannelEditContrast();
450 int button_release_event();
451 ChannelPicker
*channel_picker
;
454 class ChannelEditColor
: public BC_IPot
457 ChannelEditColor(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
460 int button_release_event();
461 ChannelPicker
*channel_picker
;
464 class ChannelEditHue
: public BC_IPot
467 ChannelEditHue(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
470 int button_release_event();
471 ChannelPicker
*channel_picker
;
474 class ChannelEditWhiteness
: public BC_IPot
477 ChannelEditWhiteness(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
478 ~ChannelEditWhiteness();
480 int button_release_event();
481 ChannelPicker
*channel_picker
;
486 class ChannelEditCommon
: public BC_IPot
489 ChannelEditCommon(int x
,
491 ChannelPicker
*channel_picker
,
493 ~ChannelEditCommon();
495 int button_release_event();
496 ChannelPicker
*channel_picker
;