RafaMar + programmer friend Help button in Batch Render addition
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / adeviceprefs.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 ADEVICEPREFS_H
23 #define ADEVICEPREFS_H
24
25
26 class OSSEnable;
27 class ALSADevice;
28
29 #include "adeviceprefs.inc"
30 #include "bitspopup.inc"
31 #include "guicast.h"
32 #include "playbackconfig.inc"
33 #include "preferencesthread.inc"
34 #include "recordconfig.inc"
35
36 class ADevicePrefs
37 {
38 public:
39         ADevicePrefs(int x,
40                 int y,
41                 PreferencesWindow *pwindow,
42                 PreferencesDialog *dialog,
43                 AudioOutConfig *out_config,
44                 AudioInConfig *in_config,
45                 int mode);
46         ~ADevicePrefs();
47
48         void reset();
49 //      static int get_h(int recording = 0);
50         int get_h(int recording = 0);
51         int update(AudioOutConfig *out_config);
52 // creation - set if this is the first initialize of the object
53 //            to prevent file format from being overwritten
54 //            & window from being flushed
55         int initialize(int creation);
56         int delete_objects();
57
58         PreferencesWindow *pwindow;
59
60 private:
61         friend class ADriverMenu;
62         friend class ADeviceTextBox;
63         friend class ADeviceIntBox;
64         friend class ADeviceTumbleBox;
65
66         int create_oss_objs();
67         int create_esound_objs();
68         int create_firewire_objs();
69         int create_alsa_objs();
70         int create_cine_objs();
71         int create_dvb_objs();
72         int create_v4l2mpeg_objs();
73         int create_pulse_objs();
74
75         int delete_oss_objs();
76         int delete_esound_objs();
77         int delete_firewire_objs();
78         int delete_alsa_objs();
79         int delete_dvb_objs();
80         int delete_v4l2mpeg_objs();
81         int delete_pulse_objs();
82
83 // The output config resolved from playback strategy and render engine.
84         AudioOutConfig *out_config;
85         AudioInConfig *in_config;
86         PreferencesDialog *dialog;
87         int driver, mode;
88         int x;
89         int y;
90         ADriverMenu *menu;
91         BC_Title *driver_title, *path_title, *bits_title;
92         BC_Title *server_title, *port_title, *channel_title, *syt_title;
93         BC_Title *dvb_adapter_title, *dvb_device_title;
94         BC_CheckBox *follow_audio_config;
95         BitsPopup *dvb_bits;
96         BitsPopup *v4l2_bits;
97         OSSEnable *oss_enable[MAXDEVICES];
98         ADeviceTextBox *oss_path[MAXDEVICES];
99         BitsPopup *oss_bits;
100         ADeviceTextBox *server;
101         ADeviceIntBox *port;
102         ADeviceIntBox *firewire_port;
103         ADeviceIntBox *firewire_channel;
104         ADeviceTextBox *firewire_path;
105         ADeviceIntBox *firewire_syt;
106         ADeviceTextBox *dvb_adapter_path;
107         ADeviceTumbleBox *dvb_adapter_device;
108
109
110         ALSADevice *alsa_device;
111         BitsPopup *alsa_bits;
112         BC_CheckBox *alsa_workaround;
113         ArrayList<BC_ListBoxItem*> *alsa_drivers;
114
115
116         BitsPopup *cine_bits;
117         ADeviceTextBox *cine_path;
118 };
119
120 class ADriverMenu : public BC_PopupMenu
121 {
122 public:
123         ADriverMenu(int x,
124                 int y,
125                 ADevicePrefs *device_prefs,
126                 int do_input,
127                 int *output);
128         ~ADriverMenu();
129
130         void create_objects();
131         char* adriver_to_string(int driver);
132
133         int do_input;
134         int *output;
135         ADevicePrefs *device_prefs;
136         char string[BCTEXTLEN];
137 };
138
139 class ADriverItem : public BC_MenuItem
140 {
141 public:
142         ADriverItem(ADriverMenu *popup, const char *text, int driver);
143         ~ADriverItem();
144         int handle_event();
145         ADriverMenu *popup;
146         int driver;
147 };
148
149
150 class OSSEnable : public BC_CheckBox
151 {
152 public:
153         OSSEnable(int x, int y, int *output);
154         int handle_event();
155         int *output;
156 };
157
158
159 class ADeviceTextBox : public BC_TextBox
160 {
161 public:
162         ADeviceTextBox(int x, int y, char *output);
163         int handle_event();
164         char *output;
165 };
166
167 class ADeviceIntBox : public BC_TextBox
168 {
169 public:
170         ADeviceIntBox(int x, int y, int *output);
171         int handle_event();
172         int *output;
173 };
174
175 class ADeviceTumbleBox : public BC_TumbleTextBox
176 {
177 public:
178         ADeviceTumbleBox(ADevicePrefs *prefs,
179                 int x, int y, int *output, int min, int max, int text_w=60);
180
181         int handle_event();
182         int *output;
183 };
184
185 class ALSADevice : public BC_PopupTextBox
186 {
187 public:
188         ALSADevice(PreferencesDialog *dialog,
189                 int x,
190                 int y,
191                 char *output,
192                 ArrayList<BC_ListBoxItem*> *devices);
193         ~ALSADevice();
194
195         int handle_event();
196         char *output;
197 };
198
199 #endif