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