r793: Small API addon, so plugins can 'see' camera and projector automation
[cinelerra_cv/mob.git] / cinelerra / adeviceprefs.h
blobc92cb1d5d4966e644c6478aff4ddf8854f33ad75
1 #ifndef ADEVICEPREFS_H
2 #define ADEVICEPREFS_H
4 // Modes
5 #ifndef MODEPLAY
6 #define MODEPLAY 0
7 #define MODERECORD 1
8 #define MODEDUPLEX 2
9 #endif
11 class OSSEnable;
12 class ALSADevice;
14 #include "bitspopup.inc"
15 #include "guicast.h"
16 #include "playbackconfig.inc"
17 #include "preferencesthread.inc"
18 #include "recordconfig.inc"
20 class ADriverMenu;
21 class ADeviceTextBox;
22 class ADeviceIntBox;
24 class ADevicePrefs
26 public:
27 ADevicePrefs(int x,
28 int y,
29 PreferencesWindow *pwindow,
30 PreferencesDialog *dialog,
31 AudioOutConfig *out_config,
32 AudioInConfig *in_config,
33 int mode);
34 ~ADevicePrefs();
36 void reset();
37 static int get_h();
38 int update(AudioOutConfig *out_config);
39 int initialize();
40 int delete_objects();
42 PreferencesWindow *pwindow;
44 private:
45 int create_oss_objs();
46 int create_esound_objs();
47 int create_firewire_objs();
48 int create_alsa_objs();
50 int delete_oss_objs();
51 int delete_esound_objs();
52 int delete_firewire_objs();
53 int delete_alsa_objs();
55 // The output config resolved from playback strategy and render engine.
56 AudioOutConfig *out_config;
57 AudioInConfig *in_config;
58 PreferencesDialog *dialog;
59 int driver, mode;
60 int x;
61 int y;
62 ADriverMenu *menu;
63 BC_Title *driver_title, *path_title, *bits_title, *channels_title;
64 BC_Title *server_title, *port_title, *channel_title, *syt_title;
65 OSSEnable *oss_enable[MAXDEVICES];
66 ADeviceTextBox *oss_path[MAXDEVICES];
67 BitsPopup *oss_bits;
68 ADeviceIntBox *oss_channels[MAXDEVICES];
69 ADeviceTextBox *esound_server;
70 ADeviceIntBox *esound_port;
71 ADeviceIntBox *firewire_port;
72 ADeviceIntBox *firewire_channel;
73 ADeviceIntBox *firewire_channels;
74 ADeviceTextBox *firewire_path;
75 ADeviceIntBox *firewire_syt;
78 ALSADevice *alsa_device;
79 BitsPopup *alsa_bits;
80 ADeviceIntBox *alsa_channels;
81 BC_CheckBox *alsa_workaround;
83 ArrayList<BC_ListBoxItem*> *alsa_drivers;
86 class ADriverMenu : public BC_PopupMenu
88 public:
89 ADriverMenu(int x,
90 int y,
91 ADevicePrefs *device_prefs,
92 int do_input,
93 int *output);
94 ~ADriverMenu();
96 void create_objects();
97 char* adriver_to_string(int driver);
99 int do_input;
100 int *output;
101 ADevicePrefs *device_prefs;
102 char string[BCTEXTLEN];
105 class ADriverItem : public BC_MenuItem
107 public:
108 ADriverItem(ADriverMenu *popup, char *text, int driver);
109 ~ADriverItem();
110 int handle_event();
111 ADriverMenu *popup;
112 int driver;
115 class OSSEnable : public BC_CheckBox
117 public:
118 OSSEnable(int x, int y, int *output);
119 int handle_event();
120 int *output;
125 class ADeviceTextBox : public BC_TextBox
127 public:
128 ADeviceTextBox(int x, int y, char *output);
129 int handle_event();
130 char *output;
133 class ADeviceIntBox : public BC_TextBox
135 public:
136 ADeviceIntBox(int x, int y, int *output);
137 int handle_event();
138 int *output;
141 class ALSADevice : public BC_PopupTextBox
143 public:
144 ALSADevice(PreferencesDialog *dialog,
145 int x,
146 int y,
147 char *output,
148 ArrayList<BC_ListBoxItem*> *devices);
149 ~ALSADevice();
151 int handle_event();
152 char *output;
155 #endif