6 #include "channelpicker.inc"
11 class ChannelEditWindow
;
13 class ChannelEditThread
: public Thread
16 ChannelEditThread(MWindow
*mwindow
,
17 ChannelPicker
*channel_picker
,
18 ArrayList
<Channel
*> *channeldb
,
27 ChannelPicker
*channel_picker
;
28 ArrayList
<Channel
*> *channeldb
;
29 ArrayList
<Channel
*> *new_channels
;
30 ChannelEditWindow
*window
;
35 class ChannelEditList
;
36 class ChannelEditEditThread
;
37 class ChannelEditPictureThread
;
39 class ChannelEditWindow
: public BC_Window
42 ChannelEditWindow(MWindow
*mwindow
, ChannelEditThread
*thread
, ChannelPicker
*channel_picker
);
47 int add_channel(); // Start the thread for adding a channel
48 int delete_channel(int channel
);
49 int delete_channel(Channel
*channel
);
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
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
;
69 class ChannelEditSelect
: public BC_GenericButton
72 ChannelEditSelect(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
75 ChannelEditWindow
*window
;
79 class ChannelEditAdd
: public BC_GenericButton
82 ChannelEditAdd(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
85 ChannelEditWindow
*window
;
88 class ChannelEditList
: public BC_ListBox
91 ChannelEditList(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
94 ChannelEditWindow
*window
;
95 static char *column_titles
[2];
98 class ChannelEditMoveUp
: public BC_GenericButton
101 ChannelEditMoveUp(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
102 ~ChannelEditMoveUp();
104 ChannelEditWindow
*window
;
107 class ChannelEditMoveDown
: public BC_GenericButton
110 ChannelEditMoveDown(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
111 ~ChannelEditMoveDown();
113 ChannelEditWindow
*window
;
116 class ChannelEditDel
: public BC_GenericButton
119 ChannelEditDel(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
122 ChannelEditWindow
*window
;
125 class ChannelEdit
: public BC_GenericButton
128 ChannelEdit(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
131 ChannelEditWindow
*window
;
134 class ChannelEditPicture
: public BC_GenericButton
137 ChannelEditPicture(MWindow
*mwindow
, ChannelEditWindow
*window
, int x
, int y
);
138 ~ChannelEditPicture();
140 ChannelEditWindow
*window
;
144 // ============================= Edit a single channel
146 class ChannelEditEditSource
;
147 class ChannelEditEditWindow
;
149 class ChannelEditEditThread
: public Thread
152 ChannelEditEditThread(ChannelEditWindow
*window
,
153 ChannelPicker
*channel_picker
,
155 ~ChannelEditEditThread();
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
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
);
172 Channel
*output_channel
;
173 ChannelPicker
*channel_picker
;
174 ChannelEditWindow
*window
;
175 ChannelEditEditSource
*source_text
;
176 ChannelEditEditWindow
*edit_window
;
178 int editing
; // Tells whether or not to delete the channel on cancel
179 int in_progress
; // Allow only 1 thread at a time
183 class ChannelEditEditWindow
: public BC_Window
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
201 ChannelEditEditTitle(int x
, int y
, ChannelEditEditThread
*thread
);
202 ~ChannelEditEditTitle();
204 ChannelEditEditThread
*thread
;
207 class ChannelEditEditSource
: public BC_TextBox
210 ChannelEditEditSource(int x
, int y
, ChannelEditEditThread
*thread
);
211 ~ChannelEditEditSource();
213 ChannelEditEditThread
*thread
;
216 class ChannelEditEditSourceTumbler
: public BC_Tumbler
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
229 ChannelEditEditInput(int x
, int y
, ChannelEditEditThread
*thread
, Record
*record
);
230 ~ChannelEditEditInput();
233 ChannelEditEditThread
*thread
;
237 class ChannelEditEditInputItem
: public BC_MenuItem
240 ChannelEditEditInputItem(ChannelEditEditThread
*thread
, char *text
, int value
);
241 ~ChannelEditEditInputItem();
243 ChannelEditEditThread
*thread
;
247 class ChannelEditEditNorm
: public BC_PopupMenu
250 ChannelEditEditNorm(int x
, int y
, ChannelEditEditThread
*thread
);
251 ~ChannelEditEditNorm();
253 ChannelEditEditThread
*thread
;
256 class ChannelEditEditNormItem
: public BC_MenuItem
259 ChannelEditEditNormItem(ChannelEditEditThread
*thread
, char *text
, int value
);
260 ~ChannelEditEditNormItem();
262 ChannelEditEditThread
*thread
;
266 class ChannelEditEditFreqtable
: public BC_PopupMenu
269 ChannelEditEditFreqtable(int x
, int y
, ChannelEditEditThread
*thread
);
270 ~ChannelEditEditFreqtable();
274 ChannelEditEditThread
*thread
;
277 class ChannelEditEditFreqItem
: public BC_MenuItem
280 ChannelEditEditFreqItem(ChannelEditEditThread
*thread
, char *text
, int value
);
281 ~ChannelEditEditFreqItem();
284 ChannelEditEditThread
*thread
;
288 class ChannelEditEditFine
: public BC_ISlider
291 ChannelEditEditFine(int x
, int y
, ChannelEditEditThread
*thread
);
292 ~ChannelEditEditFine();
294 ChannelEditEditThread
*thread
;
297 // =================== Edit the picture quality
300 class ChannelEditPictureWindow
;
302 class ChannelEditPictureThread
: public Thread
305 ChannelEditPictureThread(ChannelPicker
*channel_picker
, ChannelEditWindow
*window
);
306 ~ChannelEditPictureThread();
312 int in_progress
; // Allow only 1 thread at a time
314 ChannelPicker
*channel_picker
;
315 ChannelEditWindow
*window
;
316 ChannelEditPictureWindow
*edit_window
;
319 class ChannelEditPictureWindow
: public BC_Window
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
333 ChannelEditBright(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
334 ~ChannelEditBright();
336 int button_release_event();
337 ChannelPicker
*channel_picker
;
340 class ChannelEditContrast
: public BC_IPot
343 ChannelEditContrast(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
344 ~ChannelEditContrast();
346 int button_release_event();
347 ChannelPicker
*channel_picker
;
350 class ChannelEditColor
: public BC_IPot
353 ChannelEditColor(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
356 int button_release_event();
357 ChannelPicker
*channel_picker
;
360 class ChannelEditHue
: public BC_IPot
363 ChannelEditHue(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
366 int button_release_event();
367 ChannelPicker
*channel_picker
;
370 class ChannelEditWhiteness
: public BC_IPot
373 ChannelEditWhiteness(int x
, int y
, ChannelPicker
*channel_picker
, int value
);
374 ~ChannelEditWhiteness();
376 int button_release_event();
377 ChannelPicker
*channel_picker
;