initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / vdeviceprefs.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #ifndef VDEVICEPREFS_H
23 #define VDEVICEPREFS_H
24
25 // Modes
26 #ifndef MODEPLAY
27 #define MODEPLAY 0
28 #define MODERECORD 1
29 #define MODEDUPLEX 2
30 #endif
31
32 #include "adeviceprefs.inc"
33 #include "channelpicker.inc"
34 #include "guicast.h"
35 #include "playbackconfig.inc"
36 #include "preferencesthread.inc"
37 #include "recordconfig.inc"
38 #include "vdeviceprefs.inc"
39
40 class VDeviceCheckBox;
41 class VDeviceTextBox;
42 class VDeviceIntBox;
43 class VDeviceTumbleBox;
44 class VDriverMenu;
45
46 class VDevicePrefs
47 {
48 public:
49         VDevicePrefs(int x, 
50                 int y, 
51                 PreferencesWindow *pwindow, 
52                 PreferencesDialog *dialog, 
53                 VideoOutConfig *out_config,
54                 VideoInConfig *in_config,
55                 int mode);
56         ~VDevicePrefs();
57
58 // creation - set if this is the first initialize of the object
59 //            to prevent file format from being overwritten
60 //            & window from being flushed
61         int initialize(int creation /* = 0 */);
62         int delete_objects();
63         void reset_objects();
64         static int max(int a,int b) { return a>b ? a : b; }
65
66         PreferencesWindow *pwindow;
67         PreferencesDialog *dialog;
68         VideoOutConfig *out_config;
69         VideoInConfig *in_config;
70         PrefsChannelPicker *channel_picker;
71
72 private:
73         int create_lml_objs();
74         int create_firewire_objs();
75         int create_dv1394_objs();
76         int create_v4l_objs();
77         int create_v4l2_objs();
78         int create_v4l2jpeg_objs();
79         int create_v4l2mpeg_objs();
80         int create_screencap_objs();
81         int create_buz_objs();
82         int create_x11_objs();
83         int create_dvb_objs();
84
85         VDriverMenu *menu;
86
87         BC_Title *device_title;
88         BC_Title *port_title;
89         BC_CheckBox *follow_video_config;
90         BC_Title *channel_title;
91         BC_Title *output_title;
92         BC_Title *syt_title;
93         BC_Title *fields_title;
94         BC_Title *dvb_adapter_title;
95
96         VDeviceTextBox *device_text;
97         VDeviceIntBox *firewire_port;
98         VDeviceIntBox *firewire_channel;
99         VDeviceIntBox *firewire_channels;
100         VDeviceIntBox *firewire_syt;
101         VDeviceTextBox *firewire_path;
102         VDeviceTumbleBox *device_fields;
103         VDeviceTumbleBox *dvb_adapter_device;
104
105         VDeviceCheckBox *buz_swap_channels;
106         int driver, mode;
107         int x;
108         int y;
109 };
110
111 class VDeviceTextBox : public BC_TextBox
112 {
113 public:
114         VDeviceTextBox(int x, int y, char *output);
115
116         int handle_event();
117         char *output;
118 };
119
120 class VDeviceIntBox : public BC_TextBox
121 {
122 public:
123         VDeviceIntBox(int x, int y, int *output);
124
125         int handle_event();
126         int *output;
127 };
128
129 class VDeviceTumbleBox : public BC_TumbleTextBox
130 {
131 public:
132         VDeviceTumbleBox(VDevicePrefs *prefs, 
133                 int x, int y, int *output, int min, int max, int text_w=60);
134
135         int handle_event();
136         int *output;
137 };
138
139 class VDeviceCheckBox : public BC_CheckBox
140 {
141 public:
142         VDeviceCheckBox(int x, int y, int *output, char *text);
143
144         int handle_event();
145         int *output;
146 };
147
148
149 class VDriverMenu : public BC_PopupMenu
150 {
151 public:
152         VDriverMenu(int x, 
153                 int y, 
154                 VDevicePrefs *device_prefs, 
155                 int do_input, 
156                 int *output);
157         ~VDriverMenu();
158         
159         char* driver_to_string(int driver);
160         void create_objects();
161         
162         VDevicePrefs *device_prefs;
163         int do_input;
164         int *output;
165         char string[BCTEXTLEN];
166 };
167
168
169 class VDriverItem : public BC_MenuItem
170 {
171 public:
172         VDriverItem(VDriverMenu *popup, const char *text, int driver);
173         ~VDriverItem();
174         
175         int handle_event();
176
177         VDriverMenu *popup;
178         int driver;
179 };
180
181
182 class VScalingEquation : public BC_PopupMenu
183 {
184 public:
185         VScalingEquation(int x, int y, int *output);
186         ~VScalingEquation();
187
188         const char* interpolation_to_string(int type);
189         void create_objects();
190         int *output;
191 };
192
193 class VScalingItem : public BC_MenuItem
194 {
195 public:
196         VScalingItem(VScalingEquation *popup, int interpolation);
197         ~VScalingItem();
198
199         VScalingEquation *popup;
200         int handle_event();
201         int interpolation;
202 };
203
204
205 #endif