1 #ifndef CHANNELPICKER_H
2 #define CHANNELPICKER_H
6 #include "channeldb.inc"
7 #include "channeledit.inc"
11 #include "recordmonitor.inc"
12 #include "vdeviceprefs.inc"
27 * ChannelPicker(MWindow *mwindow,
29 * RecordMonitor *record_monitor,
30 * ChannelDB *channeldb,
33 * BC_WindowBase *parent_window);
35 ChannelPicker(ChannelDB
*channeldb
,
38 BC_WindowBase
*parent_window
);
39 virtual ~ChannelPicker();
41 // This can't be virtual because it's called from a destructor.
42 BC_WindowBase
* get_subwindow();
44 // Called at completion of ChannelEditThread
45 virtual void handle_channel_edit(int result
) {};
47 virtual void load_scan_defaults(Channel
*scan_params
) {};
48 virtual void save_scan_defaults(Channel
*scan_params
) {};
50 virtual Channel
* get_master_channel() { return 0; };
51 // Return 1 if the select button is needed
52 virtual int use_select() { return 0; };
53 virtual BC_Theme
* get_theme() { return 0; };
54 // Get the current state of the channel
55 virtual Channel
* get_current_channel_struct() { return 0; };
56 virtual int get_current_channel_number() { return 0; };
57 // Set the current state of the channel
58 virtual void set_channel_number(int number
) {};
59 virtual void set_channel(Channel
*channel
) {};
60 virtual int has_signal() { return 0; };
61 // Get what inputs the device supports, one Channel structure for every input.
62 virtual ArrayList
<Channel
*>* get_video_inputs() { return 0; };
63 // Get a structure containing what parameters the device supports
64 virtual Channel
* get_channel_usage() { return 0; };
66 // Set current picture state
67 virtual int set_brightness(int value
) { return 0; };
68 virtual int set_hue(int value
) { return 0; };
69 virtual int set_color(int value
) { return 0; };
70 virtual int set_contrast(int value
) { return 0; };
71 virtual int set_whiteness(int value
) { return 0; };
72 virtual int set_picture(int device_id
, int value
) { return 0; };
74 // Get the current state of the picture
75 virtual int get_brightness() { return 0; };
76 virtual int get_hue() { return 0; };
77 virtual int get_color() { return 0; };
78 virtual int get_contrast() { return 0; };
79 virtual int get_whiteness() { return 0; };
80 virtual int get_controls() { return 0; };
81 virtual PictureItem
* get_control(int i
) { return 0; };
82 // Get a structure containing what parameters the device supports
83 virtual PictureConfig
* get_picture_usage() { return 0; };
87 void update_channel_list();
91 char *get_source_name(Channel
*channel
); // Get the name of the source for a channel
92 char *current_channel_name(); // Get the name of the current channel of the device
97 Channel
*current_channel
;
100 // RecordMonitor *record_monitor;
101 ChannelDB
*channeldb
;
102 BC_WindowBase
*parent_window
;
109 ChannelText
*channel_text
;
110 ChannelList
*channel_list
;
111 ChannelButton
*channel_button
;
112 ChannelTumbler
*channel_select
;
113 ArrayList
<BC_ListBoxItem
*> channel_listitems
;
114 BC_Title
*channel_title
;
117 class PrefsChannelPicker
: public ChannelPicker
120 PrefsChannelPicker(MWindow
*mwindow
,
122 ChannelDB
*channeldb
,
125 ~PrefsChannelPicker();
127 BC_WindowBase
* get_subwindow();
129 void load_scan_defaults(Channel
*scan_params
);
130 void save_scan_defaults(Channel
*scan_params
);
131 void handle_channel_edit(int result
);
132 BC_Theme
* get_theme();
133 // Get the current state of the channel
134 Channel
* get_current_channel_struct();
135 int get_current_channel_number();
136 // Set the current state of the channel
137 void set_channel(Channel
*channel
);
138 void set_channel_number(int number
);
140 // Get what inputs the device supports, one Channel structure for every input.
141 ArrayList
<Channel
*>* get_video_inputs();
142 // Get a structure containing what parameters the device supports
143 Channel
* get_channel_usage();
147 // Set current picture state
148 int set_brightness(int value
);
149 int set_hue(int value
);
150 int set_color(int value
);
151 int set_contrast(int value
);
152 int set_whiteness(int value
);
154 // Get the current state of the picture
155 int get_brightness();
161 ArrayList
<Channel
*> input_sources
;
166 class RecordChannelPicker
: public ChannelPicker
169 RecordChannelPicker(MWindow
*mwindow
,
171 RecordMonitor
*record_monitor
,
172 BC_WindowBase
*parent_window
,
173 ChannelDB
*channeldb
,
176 ~RecordChannelPicker();
178 void load_scan_defaults(Channel
*scan_params
);
179 void save_scan_defaults(Channel
*scan_params
);
181 Channel
* get_master_channel();
182 void handle_channel_edit(int result
);
183 BC_Theme
* get_theme();
184 // Get the current state of the channel
185 Channel
* get_current_channel_struct();
186 int get_current_channel_number();
187 // Set the current state of the channel
188 void set_channel_number(int number
);
189 void set_channel(Channel
*channel
);
191 // Get what inputs the device supports, one Channel structure for every input.
192 ArrayList
<Channel
*>* get_video_inputs();
193 // Get a structure containing what parameters the device supports
194 Channel
* get_channel_usage();
196 // Set current picture state
197 int set_brightness(int value
);
198 int set_hue(int value
);
199 int set_color(int value
);
200 int set_contrast(int value
);
201 int set_whiteness(int value
);
202 int set_picture(int device_id
, int value
);
204 // Get the current state of the picture
205 int get_brightness();
211 PictureItem
* get_control(int i
);
212 // Get a structure containing what parameters the device supports
213 PictureConfig
* get_picture_usage();
217 RecordMonitor
*record_monitor
;
220 class ChannelText
: public BC_PopupTextBox
223 ChannelText(ChannelPicker
*channel_picker
, int x
, int y
);
228 ChannelPicker
*channel_picker
;
231 class ChannelList
: public BC_ListBox
234 ChannelList(ChannelPicker
*channel_picker
, int x
, int y
);
238 ChannelPicker
*channel_picker
;
241 class ChannelTumbler
: public BC_Tumbler
244 ChannelTumbler(ChannelPicker
*channel_picker
, int x
, int y
);
246 int handle_up_event();
247 int handle_down_event();
248 int keypress_event();
249 ChannelPicker
*channel_picker
;
252 class ChannelButton
: public BC_Button
255 ChannelButton(ChannelPicker
*channel_picker
, int x
, int y
);
258 ChannelPicker
*channel_picker
;
259 ChannelEditThread
*thread
;