r870: Merge 2.1:
[cinelerra_cv.git] / cinelerra / channelpicker.h
blob57446e6b60c01a605ca25c844bd0480ad7b96c04
1 #ifndef CHANNELPICKER_H
2 #define CHANNELPICKER_H
4 #include "guicast.h"
5 #include "channel.inc"
6 #include "channeldb.inc"
7 #include "channeledit.inc"
8 #include "mwindow.inc"
9 #include "picture.inc"
10 #include "record.inc"
11 #include "recordmonitor.inc"
12 #include "vdeviceprefs.inc"
14 class ChannelList;
15 class ChannelText;
16 class ChannelTumbler;
17 class ChannelButton;
18 class UpChannel;
19 class DnChannel;
23 class ChannelPicker
25 public:
27 * ChannelPicker(MWindow *mwindow,
28 * Record *record,
29 * RecordMonitor *record_monitor,
30 * ChannelDB *channeldb,
31 * int x,
32 * int y,
33 * BC_WindowBase *parent_window);
35 ChannelPicker(ChannelDB *channeldb,
36 int x,
37 int y,
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();
88 int create_objects();
89 int reposition();
90 int close_threads();
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
93 int channel_up();
94 int channel_down();
96 int x, y;
97 Channel *current_channel;
98 // MWindow *mwindow;
99 // Record *record;
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
119 public:
120 PrefsChannelPicker(MWindow *mwindow,
121 VDevicePrefs *prefs,
122 ChannelDB *channeldb,
123 int x,
124 int y);
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);
139 int has_signal();
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();
156 int get_hue();
157 int get_color();
158 int get_contrast();
159 int get_whiteness();
161 ArrayList<Channel*> input_sources;
162 MWindow *mwindow;
163 VDevicePrefs *prefs;
166 class RecordChannelPicker : public ChannelPicker
168 public:
169 RecordChannelPicker(MWindow *mwindow,
170 Record *record,
171 RecordMonitor *record_monitor,
172 BC_WindowBase *parent_window,
173 ChannelDB *channeldb,
174 int x,
175 int y);
176 ~RecordChannelPicker();
178 void load_scan_defaults(Channel *scan_params);
179 void save_scan_defaults(Channel *scan_params);
180 int use_select();
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);
190 int has_signal();
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();
206 int get_hue();
207 int get_color();
208 int get_contrast();
209 int get_whiteness();
210 int get_controls();
211 PictureItem* get_control(int i);
212 // Get a structure containing what parameters the device supports
213 PictureConfig* get_picture_usage();
215 MWindow *mwindow;
216 Record *record;
217 RecordMonitor *record_monitor;
220 class ChannelText : public BC_PopupTextBox
222 public:
223 ChannelText(ChannelPicker *channel_picker, int x, int y);
224 ~ChannelText();
226 int handle_event();
228 ChannelPicker *channel_picker;
231 class ChannelList : public BC_ListBox
233 public:
234 ChannelList(ChannelPicker *channel_picker, int x, int y);
235 ~ChannelList();
237 int handle_event();
238 ChannelPicker *channel_picker;
241 class ChannelTumbler : public BC_Tumbler
243 public:
244 ChannelTumbler(ChannelPicker *channel_picker, int x, int y);
245 ~ChannelTumbler();
246 int handle_up_event();
247 int handle_down_event();
248 int keypress_event();
249 ChannelPicker *channel_picker;
252 class ChannelButton : public BC_Button
254 public:
255 ChannelButton(ChannelPicker *channel_picker, int x, int y);
256 ~ChannelButton();
257 int handle_event();
258 ChannelPicker *channel_picker;
259 ChannelEditThread *thread;
262 #endif