UI: Add application audio capture to toolbar
parent
769a29bd1a
commit
1610ac04ff
|
@ -273,6 +273,26 @@ void WindowCaptureToolbar::Init()
|
|||
ComboSelectToolbar::Init();
|
||||
}
|
||||
|
||||
ApplicationAudioCaptureToolbar::ApplicationAudioCaptureToolbar(QWidget *parent,
|
||||
OBSSource source)
|
||||
: ComboSelectToolbar(parent, source)
|
||||
{
|
||||
}
|
||||
|
||||
void ApplicationAudioCaptureToolbar::Init()
|
||||
{
|
||||
delete ui->activateButton;
|
||||
ui->activateButton = nullptr;
|
||||
|
||||
obs_module_t *mod = obs_get_module("win-wasapi");
|
||||
const char *device_str = obs_module_get_locale_text(mod, "Window");
|
||||
ui->deviceLabel->setText(device_str);
|
||||
|
||||
prop_name = "window";
|
||||
|
||||
ComboSelectToolbar::Init();
|
||||
}
|
||||
|
||||
DisplayCaptureToolbar::DisplayCaptureToolbar(QWidget *parent, OBSSource source)
|
||||
: ComboSelectToolbar(parent, source)
|
||||
{
|
||||
|
|
|
@ -82,6 +82,14 @@ public:
|
|||
void Init() override;
|
||||
};
|
||||
|
||||
class ApplicationAudioCaptureToolbar : public ComboSelectToolbar {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ApplicationAudioCaptureToolbar(QWidget *parent, OBSSource source);
|
||||
void Init() override;
|
||||
};
|
||||
|
||||
class DisplayCaptureToolbar : public ComboSelectToolbar {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -3110,6 +3110,15 @@ void OBSBasic::UpdateContextBar(bool force)
|
|||
c->Init();
|
||||
ui->emptySpace->layout()->addWidget(c);
|
||||
|
||||
} else if (strcmp(id,
|
||||
"wasapi_process_output_capture") ==
|
||||
0) {
|
||||
ApplicationAudioCaptureToolbar *c =
|
||||
new ApplicationAudioCaptureToolbar(
|
||||
ui->emptySpace, source);
|
||||
c->Init();
|
||||
ui->emptySpace->layout()->addWidget(c);
|
||||
|
||||
} else if (strcmp(id, "window_capture") == 0 ||
|
||||
strcmp(id, "xcomposite_input") == 0) {
|
||||
WindowCaptureToolbar *c =
|
||||
|
|
Loading…
Reference in New Issue