r860: Merge 2.1:
[cinelerra_cv.git] / cinelerra / adeviceprefs.h
blob4d98202147bcab9f37f4f109554b1ff32ae3f71c
1 #ifndef ADEVICEPREFS_H
2 #define ADEVICEPREFS_H
5 class OSSEnable;
6 class ALSADevice;
8 #include "bitspopup.inc"
9 #include "guicast.h"
10 #include "playbackconfig.inc"
11 #include "preferencesthread.inc"
12 #include "recordconfig.inc"
14 class ADriverMenu;
15 class ADeviceTextBox;
16 class ADeviceIntBox;
18 class ADevicePrefs
20 public:
21 ADevicePrefs(int x,
22 int y,
23 PreferencesWindow *pwindow,
24 PreferencesDialog *dialog,
25 AudioOutConfig *out_config,
26 AudioInConfig *in_config,
27 int mode);
28 ~ADevicePrefs();
30 void reset();
31 static int get_h(int recording = 0);
32 int update(AudioOutConfig *out_config);
33 // creation - set if this is the first initialize of the object
34 // to prevent file format from being overwritten
35 int initialize(int creation = 0);
36 int delete_objects();
38 PreferencesWindow *pwindow;
40 private:
41 int create_oss_objs();
42 int create_esound_objs();
43 int create_firewire_objs();
44 int create_alsa_objs();
46 int delete_oss_objs();
47 int delete_esound_objs();
48 int delete_firewire_objs();
49 int delete_alsa_objs();
51 // The output config resolved from playback strategy and render engine.
52 AudioOutConfig *out_config;
53 AudioInConfig *in_config;
54 PreferencesDialog *dialog;
55 int driver, mode;
56 int x;
57 int y;
58 ADriverMenu *menu;
59 BC_Title *driver_title, *path_title, *bits_title;
60 BC_Title *server_title, *port_title, *channel_title, *syt_title;
61 OSSEnable *oss_enable[MAXDEVICES];
62 ADeviceTextBox *oss_path[MAXDEVICES];
63 BitsPopup *oss_bits;
64 ADeviceTextBox *esound_server;
65 ADeviceIntBox *esound_port;
66 ADeviceIntBox *firewire_port;
67 ADeviceIntBox *firewire_channel;
68 ADeviceTextBox *firewire_path;
69 ADeviceIntBox *firewire_syt;
72 ALSADevice *alsa_device;
73 BitsPopup *alsa_bits;
74 BC_CheckBox *alsa_workaround;
75 ArrayList<BC_ListBoxItem*> *alsa_drivers;
78 class ADriverMenu : public BC_PopupMenu
80 public:
81 ADriverMenu(int x,
82 int y,
83 ADevicePrefs *device_prefs,
84 int do_input,
85 int *output);
86 ~ADriverMenu();
88 void create_objects();
89 char* adriver_to_string(int driver);
91 int do_input;
92 int *output;
93 ADevicePrefs *device_prefs;
94 char string[BCTEXTLEN];
97 class ADriverItem : public BC_MenuItem
99 public:
100 ADriverItem(ADriverMenu *popup, char *text, int driver);
101 ~ADriverItem();
102 int handle_event();
103 ADriverMenu *popup;
104 int driver;
107 class OSSEnable : public BC_CheckBox
109 public:
110 OSSEnable(int x, int y, int *output);
111 int handle_event();
112 int *output;
117 class ADeviceTextBox : public BC_TextBox
119 public:
120 ADeviceTextBox(int x, int y, char *output);
121 int handle_event();
122 char *output;
125 class ADeviceIntBox : public BC_TextBox
127 public:
128 ADeviceIntBox(int x, int y, int *output);
129 int handle_event();
130 int *output;
133 class ALSADevice : public BC_PopupTextBox
135 public:
136 ALSADevice(PreferencesDialog *dialog,
137 int x,
138 int y,
139 char *output,
140 ArrayList<BC_ListBoxItem*> *devices);
141 ~ALSADevice();
143 int handle_event();
144 char *output;
147 #endif