add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / 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         int get_h();
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_firewire_objs();
74         int create_dv1394_objs();
75         int create_v4l2_objs();
76         int create_v4l2jpeg_objs();
77         int create_v4l2mpeg_objs();
78         int create_screencap_objs();
79         int create_x11_objs();
80         void create_dvb_objs();
81
82         VDriverMenu *menu;
83
84         BC_Title *device_title;
85         BC_Title *port_title;
86         BC_CheckBox *follow_video_config;
87         BC_CheckBox *use_direct_x11;
88         BC_Title *channel_title;
89         BC_Title *output_title;
90         BC_Title *syt_title;
91         BC_Title *fields_title;
92         BC_Title *dvb_adapter_title;
93
94         VDeviceTextBox *device_text;
95         VDeviceIntBox *firewire_port;
96         VDeviceIntBox *firewire_channel;
97         VDeviceIntBox *firewire_channels;
98         VDeviceIntBox *firewire_syt;
99         VDeviceTextBox *firewire_path;
100         VDeviceTumbleBox *device_fields;
101         VDeviceTumbleBox *dvb_adapter_device;
102
103         int driver, mode;
104         int x;
105         int y;
106 };
107
108 class VDeviceTextBox : public BC_TextBox
109 {
110 public:
111         VDeviceTextBox(int x, int y, char *output);
112
113         int handle_event();
114         char *output;
115 };
116
117 class VDeviceIntBox : public BC_TextBox
118 {
119 public:
120         VDeviceIntBox(int x, int y, int *output);
121
122         int handle_event();
123         int *output;
124 };
125
126 class VDeviceTumbleBox : public BC_TumbleTextBox
127 {
128 public:
129         VDeviceTumbleBox(VDevicePrefs *prefs,
130                 int x, int y, int *output, int min, int max, int text_w=60);
131
132         int handle_event();
133         int *output;
134 };
135
136 class VDeviceCheckBox : public BC_CheckBox
137 {
138 public:
139         VDeviceCheckBox(int x, int y, int *output, char *text);
140
141         int handle_event();
142         int *output;
143 };
144
145
146 class VDriverMenu : public BC_PopupMenu
147 {
148 public:
149         VDriverMenu(int x,
150                 int y,
151                 VDevicePrefs *device_prefs,
152                 int do_input,
153                 int *output);
154         ~VDriverMenu();
155
156         char* driver_to_string(int driver);
157         void create_objects();
158
159         VDevicePrefs *device_prefs;
160         int do_input;
161         int *output;
162         char string[BCTEXTLEN];
163 };
164
165
166 class VDriverItem : public BC_MenuItem
167 {
168 public:
169         VDriverItem(VDriverMenu *popup, const char *text, int driver);
170         ~VDriverItem();
171
172         int handle_event();
173
174         VDriverMenu *popup;
175         int driver;
176 };
177
178
179 class VScalingEquation : public BC_PopupMenu
180 {
181 public:
182         VScalingEquation(int x, int y, int *output);
183         ~VScalingEquation();
184
185         const char* interpolation_to_string(int type);
186         void create_objects();
187         int *output;
188 };
189
190 class VScalingItem : public BC_MenuItem
191 {
192 public:
193         VScalingItem(VScalingEquation *popup, int interpolation);
194         ~VScalingItem();
195
196         VScalingEquation *popup;
197         int handle_event();
198         int interpolation;
199 };
200
201
202 #endif