#include "adeviceprefs.h"
#include "audioalsa.h"
#include "audiodevice.inc"
+#include "audiopulse.h"
#include "bcsignals.h"
#include "bitspopup.h"
#include "edl.h"
follow_audio_config = 0;
firewire_path = 0;
firewire_syt = 0;
+ channel_title = 0;
+ firewire_port = 0;
+ firewire_channel = 0;
syt_title = 0;
path_title = 0;
cine_bits = 0;
cine_path = 0;
+ server_title = 0;
+ port_title = 0;
+ port = 0;
}
int ADevicePrefs::initialize(int creation)
if(!menu) {
dialog->add_subwindow(menu = new ADriverMenu(x,
- y + 10,
- this,
- (mode == MODERECORD),
- driver));
+ y + yS(10), this, (mode == MODERECORD), driver));
menu->create_objects();
+ menu->context_help_set_keyword("Audio Out section");
}
switch(*driver) {
case AUDIO_ALSA:
create_alsa_objs();
break;
+ case AUDIO_PULSE:
+ create_pulse_objs();
+ break;
case AUDIO_ESOUND:
create_esound_objs();
break;
case AUDIO_ALSA:
delete_alsa_objs();
break;
+ case AUDIO_PULSE:
+ delete_pulse_objs();
+ break;
case AUDIO_ESOUND:
- delete_esound_objs();
+ delete_esound_objs();
break;
case AUDIO_1394:
case AUDIO_DV1394:
int ADevicePrefs::delete_esound_objs()
{
delete server_title;
+ delete server;
delete port_title;
- delete esound_server;
- delete esound_port;
+ delete port;
return 0;
}
return 0;
}
+int ADevicePrefs::delete_pulse_objs()
+{
+#ifdef HAVE_PULSE
+ delete server_title;
+ delete server;
+#endif
+ return 0;
+}
+
int ADevicePrefs::delete_dvb_objs()
{
delete dvb_adapter_title;
BC_Resources *resources = BC_WindowBase::get_resources();
for(int i = 0; i < MAXDEVICES; i++) {
- int x1 = x + menu->get_w() + 5;
+ int x1 = x + menu->get_w() + xS(5);
#if 0
switch(mode) {
case MODEPLAY:
output_int = &out_config->oss_enable[i];
break;
}
- dialog->add_subwindow(oss_enable[i] = new OSSEnable(x1, y1 + 20, output_int));
+ dialog->add_subwindow(oss_enable[i] = new OSSEnable(x1, y1 + yS(20), output_int));
x1 += oss_enable[i]->get_w() + margin;
#endif
switch(mode) {
path_title = new BC_Title(x1, y, _("Device path:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(path_title);
+ path_title->context_help_set_keyword("Audio Out section");
}
oss_path[i] = new ADeviceTextBox(
x1, y1 + path_title->get_h() + margin, output_char);
dialog->add_subwindow(oss_path[i]);
+ oss_path[i]->context_help_set_keyword("Audio Out section");
x1 += oss_path[i]->get_w() + margin;
if(i == 0) {
switch(mode) {
bits_title = new BC_Title(x1, y, _("Bits:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(bits_title);
+ bits_title->context_help_set_keyword("Audio Out section");
oss_bits = new BitsPopup(dialog,
x1, y1 + bits_title->get_h() + margin,
output_int, 0, 0, 0, 0, 1);
ArrayList<char*> *alsa_titles = new ArrayList<char*>;
alsa_titles->set_array_delete();
AudioALSA::list_devices(alsa_titles, 0, mode);
+ AudioALSA::add_pulse_devices(mode, alsa_titles, 0);
alsa_drivers = new ArrayList<BC_ListBoxItem*>;
for(int i = 0; i < alsa_titles->total; i++)
path_title = new BC_Title(x1, y, _("Device:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(path_title);
+ path_title->context_help_set_keyword("Audio Out section");
y1 += path_title->get_h() + margin;
alsa_device = new ALSADevice(dialog,
x1, y1, output_char, alsa_drivers);
alsa_device->create_objects();
int x2 = x1;
- x1 += alsa_device->get_w() + 5;
+ x1 += alsa_device->get_w() + xS(5);
switch(mode) {
case MODEPLAY:
output_int = &out_config->alsa_out_bits;
bits_title = new BC_Title(x1, y, _("Bits:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(bits_title);
+ bits_title->context_help_set_keyword("Audio Out section");
y1 = y + bits_title->get_h() + margin;
alsa_bits = new BitsPopup(dialog,
x1, y1, output_int, 0, 0, 0, 0, 1);
&out_config->interrupt_workaround,
_("Stop playback locks up."));
dialog->add_subwindow(alsa_workaround);
+ alsa_workaround->context_help_set_keyword("Audio Out section");
}
-
#endif
-
return 0;
}
int ADevicePrefs::create_esound_objs()
{
- int x1 = x + menu->get_w() + 5;
+ int x1 = x + menu->get_w() + xS(5);
char *output_char = 0;
int *output_int = 0;
BC_Resources *resources = BC_WindowBase::get_resources();
server_title = new BC_Title(x1, y, _("Server:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(server_title);
- esound_server = new ADeviceTextBox(x1, y + 20, output_char);
- dialog->add_subwindow(esound_server);
+ server_title->context_help_set_keyword("Audio Out section");
+ server = new ADeviceTextBox(x1, y + yS(20), output_char);
+ dialog->add_subwindow(server);
+ server->context_help_set_keyword("Audio Out section");
switch(mode) {
case MODEPLAY:
output_int = &out_config->esound_out_port;
break;
}
- x1 += esound_server->get_w() + 5;
+ x1 += server->get_w() + xS(5);
port_title = new BC_Title(x1, y, _("Port:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(port_title);
- esound_port = new ADeviceIntBox(x1, y + 20, output_int);
- dialog->add_subwindow(esound_port);
+ port_title->context_help_set_keyword("Audio Out section");
+ port = new ADeviceIntBox(x1, y + yS(20), output_int);
+ dialog->add_subwindow(port);
+ port->context_help_set_keyword("Audio Out section");
return 0;
}
int ADevicePrefs::create_firewire_objs()
{
- int x1 = x + menu->get_w() + 5;
+ int xs5 = xS(5);
+ int ys20 = yS(20);
+ int x1 = x + menu->get_w() + xs5;
int *output_int = 0;
char *output_char = 0;
BC_Resources *resources = BC_WindowBase::get_resources();
if(output_char) {
dialog->add_subwindow(path_title = new BC_Title(x1, y, _("Device Path:"), MEDIUMFONT, resources->text_default));
- dialog->add_subwindow(firewire_path = new ADeviceTextBox(x1, y + 20, output_char));
- x1 += firewire_path->get_w() + 5;
+ path_title->context_help_set_keyword("Audio Out section");
+ dialog->add_subwindow(firewire_path = new ADeviceTextBox(x1, y + ys20, output_char));
+ firewire_path->context_help_set_keyword("Audio Out section");
+ x1 += firewire_path->get_w() + xs5;
}
// Firewire port
port_title = new BC_Title(x1, y, _("Port:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(port_title);
- firewire_port = new ADeviceIntBox(x1, y + 20, output_int);
+ port_title->context_help_set_keyword("Audio Out section");
+ firewire_port = new ADeviceIntBox(x1, y + ys20, output_int);
dialog->add_subwindow(firewire_port);
+ firewire_port->context_help_set_keyword("Audio Out section");
- x1 += firewire_port->get_w() + 5;
+ x1 += firewire_port->get_w() + xs5;
// Firewire channel
switch(mode) {
channel_title = new BC_Title(x1, y, _("Channel:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(channel_title);
- firewire_channel = new ADeviceIntBox(x1, y + 20, output_int);
+ channel_title->context_help_set_keyword("Audio Out section");
+ firewire_channel = new ADeviceIntBox(x1, y + ys20, output_int);
dialog->add_subwindow(firewire_channel);
- x1 += firewire_channel->get_w() + 5;
+ firewire_channel->context_help_set_keyword("Audio Out section");
+ x1 += firewire_channel->get_w() + xs5;
// Syt offset
switch(mode) {
syt_title = new BC_Title(x1, y, _("Syt Offset:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(syt_title);
- firewire_syt = new ADeviceIntBox(x1, y + 20, output_int);
+ syt_title->context_help_set_keyword("Audio Out section");
+ firewire_syt = new ADeviceIntBox(x1, y + ys20, output_int);
dialog->add_subwindow(firewire_syt);
- x1 += firewire_syt->get_w() + 5;
+ firewire_syt->context_help_set_keyword("Audio Out section");
+ x1 += firewire_syt->get_w() + xs5;
}
return 0;
int ADevicePrefs::create_dvb_objs()
{
- int x1 = x + menu->get_w() + 30;
- int y1 = y + 10;
+ int x1 = x + menu->get_w() + xS(30);
+ int y1 = y + yS(10);
char *output_char = in_config->dvb_in_adapter;
- int y2 = y1 - BC_Title::calculate_h(dialog, _("DVB Adapter:"), MEDIUMFONT) - 5;
+ int y2 = y1 - BC_Title::calculate_h(dialog, _("DVB Adapter:"), MEDIUMFONT) - yS(5);
BC_Resources *resources = BC_WindowBase::get_resources();
dvb_adapter_title = new BC_Title(x1, y2, _("DVB Adapter:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(dvb_adapter_title);
+ dvb_adapter_title->context_help_set_keyword("Audio Out section");
dvb_adapter_path = new ADeviceTextBox(x1, y1, output_char);
dialog->add_subwindow(dvb_adapter_path);
- int x2 = x1 + dvb_adapter_path->get_w() + 5;
+ dvb_adapter_path->context_help_set_keyword("Audio Out section");
+ int x2 = x1 + dvb_adapter_path->get_w() + xS(5);
dvb_device_title = new BC_Title(x2, y2, _("dev:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(dvb_device_title);
+ dvb_device_title->context_help_set_keyword("Audio Out section");
int *output_int = &in_config->dvb_in_device;
- dvb_adapter_device = new ADeviceTumbleBox(this, x2, y1, output_int, 0, 9, 20);
+ dvb_adapter_device = new ADeviceTumbleBox(this, x2, y1, output_int, 0, 9, xS(20));
dvb_adapter_device->create_objects();
- x2 += dvb_device_title->get_w() + 30;
+ x2 += dvb_device_title->get_w() + xS(30);
bits_title = new BC_Title(x2, y2, _("Bits:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(bits_title);
+ bits_title->context_help_set_keyword("Audio Out section");
output_int = &in_config->dvb_in_bits;
dvb_bits = new BitsPopup(dialog, x2, y1, output_int, 0, 0, 0, 0, 1);
dvb_bits->create_objects();
- x1 += 100; y1 += dvb_adapter_path->get_h() + 5;
+ x1 += xS(100); y1 += dvb_adapter_path->get_h() + yS(5);
output_int = &in_config->follow_audio;
follow_audio_config = new BC_CheckBox(x1, y1, output_int, _("Follow audio config"));
dialog->add_subwindow(follow_audio_config);
+ follow_audio_config->context_help_set_keyword("Audio Out section");
return 0;
}
int ADevicePrefs::create_v4l2mpeg_objs()
{
- int x1 = x + menu->get_w() + 30;
- int y1 = y + 10;
- int y2 = y1 - BC_Title::calculate_h(dialog, _("Bits:"), MEDIUMFONT) - 5;
+ int x1 = x + menu->get_w() + xS(30);
+ int y1 = y + yS(10);
+ int y2 = y1 - BC_Title::calculate_h(dialog, _("Bits:"), MEDIUMFONT) - yS(5);
BC_Resources *resources = BC_WindowBase::get_resources();
bits_title = new BC_Title(x1, y2, _("Bits:"),
MEDIUMFONT, resources->text_default);
dialog->add_subwindow(bits_title);
+ bits_title->context_help_set_keyword("Audio Out section");
int *output_int = &in_config->v4l2_in_bits;
v4l2_bits = new BitsPopup(dialog, x1, y1, output_int, 0, 0, 0, 0, 1);
v4l2_bits->create_objects();
- x1 += v4l2_bits->get_w() + 10;
+ x1 += v4l2_bits->get_w() + xS(10);
follow_audio_config = new BC_CheckBox(x1, y1,
&in_config->follow_audio, _("Follow audio config"));
dialog->add_subwindow(follow_audio_config);
+ follow_audio_config->context_help_set_keyword("Audio Out section");
+ return 0;
+}
+
+
+int ADevicePrefs::create_pulse_objs()
+{
+#ifdef HAVE_PULSE
+ char *output_char = 0;
+ switch(mode) {
+ case MODEPLAY:
+ output_char = out_config->pulse_out_server;
+ break;
+ case MODERECORD:
+ output_char = in_config->pulse_in_server;
+ break;
+ }
+ int x1 = x, y1 = y;
+ x1 += menu->get_w() + xS(5);
+ dialog->add_subwindow(server_title = new BC_Title(x1, y1,
+ _("Server (blank for default):")));
+ server_title->context_help_set_keyword("Audio Out section");
+ y1 += server_title->get_h() + yS(5);
+ dialog->add_subwindow(server = new ADeviceTextBox(x1, y1, output_char));
+ server->context_help_set_keyword("Audio Out section");
+#endif
return 0;
}
ADriverMenu::ADriverMenu(int x, int y, ADevicePrefs *device_prefs,
int do_input, int *output)
- : BC_PopupMenu(x, y, 125, adriver_to_string(*output), 1)
+ : BC_PopupMenu(x, y, xS(125), adriver_to_string(*output), 1)
{
this->output = output;
this->do_input = do_input;
#ifdef HAVE_VIDEO4LINUX2
if(do_input) add_item(new ADriverItem(this, AUDIO_V4L2MPEG_TITLE, AUDIO_V4L2MPEG));
#endif
+#ifdef HAVE_PULSE
+ add_item(new ADriverItem(this, AUDIO_PULSE_TITLE, AUDIO_PULSE));
+#endif
}
char* ADriverMenu::adriver_to_string(int driver)
case AUDIO_ESOUND:
sprintf(string, AUDIO_ESOUND_TITLE);
break;
+ case AUDIO_PULSE:
+ sprintf(string, AUDIO_PULSE_TITLE);
+ break;
case AUDIO_NAS:
sprintf(string, AUDIO_NAS_TITLE);
break;
ADeviceTextBox::ADeviceTextBox(int x, int y, char *output)
- : BC_TextBox(x, y, 150, 1, output)
+ : BC_TextBox(x, y, xS(150), 1, output)
{
this->output = output;
}
}
ADeviceIntBox::ADeviceIntBox(int x, int y, int *output)
- : BC_TextBox(x, y, 80, 1, *output)
+ : BC_TextBox(x, y, xS(80), 1, *output)
{
this->output = output;
}
int y,
char *output,
ArrayList<BC_ListBoxItem*> *devices)
- : BC_PopupTextBox(dialog, devices, output, x, y, 200, 200)
+ : BC_PopupTextBox(dialog, devices, output, x, y, xS(200), yS(200))
{
this->output = output;
}