4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef ADEVICEPREFS_H
23 #define ADEVICEPREFS_H
29 #include "bitspopup.inc"
31 #include "playbackconfig.inc"
32 #include "preferencesthread.inc"
33 #include "recordconfig.inc"
38 class ADeviceTumbleBox;
45 PreferencesWindow *pwindow,
46 PreferencesDialog *dialog,
47 AudioOutConfig *out_config,
48 AudioInConfig *in_config,
53 static int get_h(int recording = 0);
54 int update(AudioOutConfig *out_config);
55 // creation - set if this is the first initialize of the object
56 // to prevent file format from being overwritten
57 // & window from being flushed
58 int initialize(int creation);
61 PreferencesWindow *pwindow;
64 friend class ADriverMenu;
65 friend class ADeviceTextBox;
66 friend class ADeviceIntBox;
67 friend class ADeviceTumbleBox;
69 int create_oss_objs();
70 int create_esound_objs();
71 int create_firewire_objs();
72 int create_alsa_objs();
73 int create_cine_objs();
74 int create_dvb_objs();
75 int create_v4l2mpeg_objs();
77 int delete_oss_objs();
78 int delete_esound_objs();
79 int delete_firewire_objs();
80 int delete_alsa_objs();
81 int delete_dvb_objs();
82 int delete_v4l2mpeg_objs();
84 // The output config resolved from playback strategy and render engine.
85 AudioOutConfig *out_config;
86 AudioInConfig *in_config;
87 PreferencesDialog *dialog;
92 BC_Title *driver_title, *path_title, *bits_title;
93 BC_Title *server_title, *port_title, *channel_title, *syt_title;
94 BC_Title *dvb_adapter_title, *dvb_device_title;
95 BC_CheckBox *follow_audio_config;
98 OSSEnable *oss_enable[MAXDEVICES];
99 ADeviceTextBox *oss_path[MAXDEVICES];
101 ADeviceTextBox *esound_server;
102 ADeviceIntBox *esound_port;
103 ADeviceIntBox *firewire_port;
104 ADeviceIntBox *firewire_channel;
105 ADeviceTextBox *firewire_path;
106 ADeviceIntBox *firewire_syt;
107 ADeviceTextBox *dvb_adapter_path;
108 ADeviceTumbleBox *dvb_adapter_device;
111 ALSADevice *alsa_device;
112 BitsPopup *alsa_bits;
113 BC_CheckBox *alsa_workaround;
114 ArrayList<BC_ListBoxItem*> *alsa_drivers;
117 BitsPopup *cine_bits;
118 ADeviceTextBox *cine_path;
121 class ADriverMenu : public BC_PopupMenu
126 ADevicePrefs *device_prefs,
131 void create_objects();
132 char* adriver_to_string(int driver);
136 ADevicePrefs *device_prefs;
137 char string[BCTEXTLEN];
140 class ADriverItem : public BC_MenuItem
143 ADriverItem(ADriverMenu *popup, const char *text, int driver);
151 class OSSEnable : public BC_CheckBox
154 OSSEnable(int x, int y, int *output);
160 class ADeviceTextBox : public BC_TextBox
163 ADeviceTextBox(int x, int y, char *output);
168 class ADeviceIntBox : public BC_TextBox
171 ADeviceIntBox(int x, int y, int *output);
176 class ADeviceTumbleBox : public BC_TumbleTextBox
179 ADeviceTumbleBox(ADevicePrefs *prefs,
180 int x, int y, int *output, int min, int max, int text_w=60);
186 class ALSADevice : public BC_PopupTextBox
189 ALSADevice(PreferencesDialog *dialog,
193 ArrayList<BC_ListBoxItem*> *devices);