00001 #ifndef ADEVICEPREFS_H
00002 #define ADEVICEPREFS_H
00003
00004
00005 class OSSEnable;
00006 class ALSADevice;
00007
00008 #include "bitspopup.inc"
00009 #include "guicast.h"
00010 #include "playbackconfig.inc"
00011 #include "preferencesthread.inc"
00012 #include "recordconfig.inc"
00013
00014 class ADriverMenu;
00015 class ADeviceTextBox;
00016 class ADeviceIntBox;
00017
00018 class ADevicePrefs
00019 {
00020 public:
00021 ADevicePrefs(int x,
00022 int y,
00023 PreferencesWindow *pwindow,
00024 PreferencesDialog *dialog,
00025 AudioOutConfig *out_config,
00026 AudioInConfig *in_config,
00027 int mode);
00028 ~ADevicePrefs();
00029
00030 void reset();
00031 static int get_h(int recording = 0);
00032 int update(AudioOutConfig *out_config);
00033
00034
00035 int initialize(int creation = 0);
00036 int delete_objects();
00037
00038 PreferencesWindow *pwindow;
00039
00040 private:
00041 int create_oss_objs();
00042 int create_esound_objs();
00043 int create_firewire_objs();
00044 int create_alsa_objs();
00045 int create_cine_objs();
00046
00047 int delete_oss_objs();
00048 int delete_esound_objs();
00049 int delete_firewire_objs();
00050 int delete_alsa_objs();
00051
00052
00053 AudioOutConfig *out_config;
00054 AudioInConfig *in_config;
00055 PreferencesDialog *dialog;
00056 int driver, mode;
00057 int x;
00058 int y;
00059 ADriverMenu *menu;
00060 BC_Title *driver_title, *path_title, *bits_title;
00061 BC_Title *server_title, *port_title, *channel_title, *syt_title;
00062 OSSEnable *oss_enable[MAXDEVICES];
00063 ADeviceTextBox *oss_path[MAXDEVICES];
00064 BitsPopup *oss_bits;
00065 ADeviceTextBox *esound_server;
00066 ADeviceIntBox *esound_port;
00067 ADeviceIntBox *firewire_port;
00068 ADeviceIntBox *firewire_channel;
00069 ADeviceTextBox *firewire_path;
00070 ADeviceIntBox *firewire_syt;
00071
00072
00073 ALSADevice *alsa_device;
00074 BitsPopup *alsa_bits;
00075 BC_CheckBox *alsa_workaround;
00076 ArrayList<BC_ListBoxItem*> *alsa_drivers;
00077
00078
00079 BitsPopup *cine_bits;
00080 ADeviceTextBox *cine_path;
00081 };
00082
00083 class ADriverMenu : public BC_PopupMenu
00084 {
00085 public:
00086 ADriverMenu(int x,
00087 int y,
00088 ADevicePrefs *device_prefs,
00089 int do_input,
00090 int *output);
00091 ~ADriverMenu();
00092
00093 void create_objects();
00094 char* adriver_to_string(int driver);
00095
00096 int do_input;
00097 int *output;
00098 ADevicePrefs *device_prefs;
00099 char string[BCTEXTLEN];
00100 };
00101
00102 class ADriverItem : public BC_MenuItem
00103 {
00104 public:
00105 ADriverItem(ADriverMenu *popup, char *text, int driver);
00106 ~ADriverItem();
00107 int handle_event();
00108 ADriverMenu *popup;
00109 int driver;
00110 };
00111
00112 class OSSEnable : public BC_CheckBox
00113 {
00114 public:
00115 OSSEnable(int x, int y, int *output);
00116 int handle_event();
00117 int *output;
00118 };
00119
00120
00121
00122 class ADeviceTextBox : public BC_TextBox
00123 {
00124 public:
00125 ADeviceTextBox(int x, int y, char *output);
00126 int handle_event();
00127 char *output;
00128 };
00129
00130 class ADeviceIntBox : public BC_TextBox
00131 {
00132 public:
00133 ADeviceIntBox(int x, int y, int *output);
00134 int handle_event();
00135 int *output;
00136 };
00137
00138 class ALSADevice : public BC_PopupTextBox
00139 {
00140 public:
00141 ALSADevice(PreferencesDialog *dialog,
00142 int x,
00143 int y,
00144 char *output,
00145 ArrayList<BC_ListBoxItem*> *devices);
00146 ~ALSADevice();
00147
00148 int handle_event();
00149 char *output;
00150 };
00151
00152 #endif