asset drag/drop to viewers, bluebanana bug, listbox fontlist highlight
[goodguy/history.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         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_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_Title *channel_title;
88         BC_Title *output_title;
89         BC_Title *syt_title;
90         BC_Title *fields_title;
91         BC_Title *dvb_adapter_title;
92
93         VDeviceTextBox *device_text;
94         VDeviceIntBox *firewire_port;
95         VDeviceIntBox *firewire_channel;
96         VDeviceIntBox *firewire_channels;
97         VDeviceIntBox *firewire_syt;
98         VDeviceTextBox *firewire_path;
99         VDeviceTumbleBox *device_fields;
100         VDeviceTumbleBox *dvb_adapter_device;
101
102         int driver, mode;
103         int x;
104         int y;
105 };
106
107 class VDeviceTextBox : public BC_TextBox
108 {
109 public:
110         VDeviceTextBox(int x, int y, char *output);
111
112         int handle_event();
113         char *output;
114 };
115
116 class VDeviceIntBox : public BC_TextBox
117 {
118 public:
119         VDeviceIntBox(int x, int y, int *output);
120
121         int handle_event();
122         int *output;
123 };
124
125 class VDeviceTumbleBox : public BC_TumbleTextBox
126 {
127 public:
128         VDeviceTumbleBox(VDevicePrefs *prefs,
129                 int x, int y, int *output, int min, int max, int text_w=60);
130
131         int handle_event();
132         int *output;
133 };
134
135 class VDeviceCheckBox : public BC_CheckBox
136 {
137 public:
138         VDeviceCheckBox(int x, int y, int *output, char *text);
139
140         int handle_event();
141         int *output;
142 };
143
144
145 class VDriverMenu : public BC_PopupMenu
146 {
147 public:
148         VDriverMenu(int x,
149                 int y,
150                 VDevicePrefs *device_prefs,
151                 int do_input,
152                 int *output);
153         ~VDriverMenu();
154
155         char* driver_to_string(int driver);
156         void create_objects();
157
158         VDevicePrefs *device_prefs;
159         int do_input;
160         int *output;
161         char string[BCTEXTLEN];
162 };
163
164
165 class VDriverItem : public BC_MenuItem
166 {
167 public:
168         VDriverItem(VDriverMenu *popup, const char *text, int driver);
169         ~VDriverItem();
170
171         int handle_event();
172
173         VDriverMenu *popup;
174         int driver;
175 };
176
177
178 class VScalingEquation : public BC_PopupMenu
179 {
180 public:
181         VScalingEquation(int x, int y, int *output);
182         ~VScalingEquation();
183
184         const char* interpolation_to_string(int type);
185         void create_objects();
186         int *output;
187 };
188
189 class VScalingItem : public BC_MenuItem
190 {
191 public:
192         VScalingItem(VScalingEquation *popup, int interpolation);
193         ~VScalingItem();
194
195         VScalingEquation *popup;
196         int handle_event();
197         int interpolation;
198 };
199
200
201 #endif