New upstream version 23.2.1+dfsg1
This commit is contained in:
parent
cdc9a9fc87
commit
b14f9eae6d
1017 changed files with 37232 additions and 11111 deletions
|
|
@ -48,6 +48,7 @@
|
|||
#include "window-projector.hpp"
|
||||
|
||||
#include <util/platform.h>
|
||||
#include "ui-config.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -280,8 +281,12 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
{
|
||||
string path;
|
||||
|
||||
EnableThreadedMessageBoxes(true);
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
main->EnableOutputs(false);
|
||||
|
||||
PopulateAACBitrates({ui->simpleOutputABitrate,
|
||||
|
|
@ -291,10 +296,6 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
|
||||
ui->listWidget->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
auto policy = ui->audioSourceScrollArea->sizePolicy();
|
||||
policy.setVerticalStretch(true);
|
||||
ui->audioSourceScrollArea->setSizePolicy(policy);
|
||||
|
||||
HookWidget(ui->language, COMBO_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->theme, COMBO_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->enableAutoUpdates, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
|
|
@ -316,14 +317,25 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->centerSnapping, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->sourceSnapping, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->snapDistance, DSCROLL_CHANGED,GENERAL_CHANGED);
|
||||
HookWidget(ui->overflowHide, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->overflowAlwaysVisible,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->overflowSelectionHide,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->doubleClickSwitch, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->studioPortraitLayout, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->prevProgLabelToggle, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->multiviewMouseSwitch, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->multiviewDrawNames, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->multiviewDrawAreas, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->multiviewLayout, COMBO_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->service, COMBO_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->server, COMBO_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->customServer, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->key, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->bandwidthTestEnable, CHECK_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->useAuth, CHECK_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->authUsername, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->authPw, EDIT_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->outputMode, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->streamType, COMBO_CHANGED, STREAM1_CHANGED);
|
||||
HookWidget(ui->simpleOutputPath, EDIT_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleNoSpace, CHECK_CHANGED, OUTPUTS_CHANGED);
|
||||
HookWidget(ui->simpleOutRecFormat, COMBO_CHANGED, OUTPUTS_CHANGED);
|
||||
|
|
@ -410,6 +422,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->auxAudioDevice1, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->auxAudioDevice2, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->auxAudioDevice3, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->auxAudioDevice4, COMBO_CHANGED, AUDIO_CHANGED);
|
||||
HookWidget(ui->baseResolution, CBEDIT_CHANGED, VIDEO_RES);
|
||||
HookWidget(ui->outputResolution, CBEDIT_CHANGED, VIDEO_RES);
|
||||
HookWidget(ui->downscaleFilter, COMBO_CHANGED, VIDEO_CHANGED);
|
||||
|
|
@ -447,6 +460,13 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->enableNewSocketLoop, CHECK_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->enableLowLatencyMode, CHECK_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->disableFocusHotkeys, CHECK_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->autoRemux, CHECK_CHANGED, ADV_CHANGED);
|
||||
|
||||
ui->simpleOutputVBitrate->setSingleStep(50);
|
||||
ui->simpleOutputVBitrate->setSuffix(" Kbps");
|
||||
ui->advOutFFVBitrate->setSingleStep(50);
|
||||
ui->advOutFFVBitrate->setSuffix(" Kbps");
|
||||
ui->advOutFFABitrate->setSuffix(" Kbps");
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
delete ui->enableAutoUpdates;
|
||||
|
|
@ -454,8 +474,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__) && !HAVE_PULSEAUDIO
|
||||
delete ui->advAudioGroupBox;
|
||||
ui->advAudioGroupBox = nullptr;
|
||||
delete ui->audioAdvGroupBox;
|
||||
ui->audioAdvGroupBox = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
@ -558,7 +578,6 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
|
||||
installEventFilter(CreateShortcutFilter());
|
||||
|
||||
LoadServiceTypes();
|
||||
LoadEncoderTypes();
|
||||
LoadColorRanges();
|
||||
LoadFormats();
|
||||
|
|
@ -689,6 +708,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
|
||||
obs_properties_destroy(ppts);
|
||||
|
||||
InitStreamPage();
|
||||
LoadSettings(false);
|
||||
|
||||
// Add warning checks to advanced output recording section controls
|
||||
|
|
@ -708,6 +728,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
this, SLOT(AdvOutRecCheckWarnings()));
|
||||
AdvOutRecCheckWarnings();
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Apply)->setIcon(QIcon());
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setIcon(QIcon());
|
||||
ui->buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon());
|
||||
|
||||
SimpleRecordingQualityChanged();
|
||||
|
||||
UpdateAutomaticReplayBufferCheckboxes();
|
||||
|
|
@ -722,6 +746,8 @@ OBSBasicSettings::~OBSBasicSettings()
|
|||
delete ui->filenameFormatting->completer();
|
||||
main->EnableOutputs(true);
|
||||
App()->EnableInFocusHotkeys(!disableHotkeysInFocus);
|
||||
|
||||
EnableThreadedMessageBoxes(false);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveCombo(QComboBox *widget, const char *section,
|
||||
|
|
@ -768,23 +794,6 @@ void OBSBasicSettings::SaveSpinBox(QSpinBox *widget, const char *section,
|
|||
config_set_int(main->Config(), section, value, widget->value());
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadServiceTypes()
|
||||
{
|
||||
const char *type;
|
||||
size_t idx = 0;
|
||||
|
||||
while (obs_enum_service_types(idx++, &type)) {
|
||||
const char *name = obs_service_get_display_name(type);
|
||||
QString qName = QT_UTF8(name);
|
||||
QString qType = QT_UTF8(type);
|
||||
|
||||
ui->streamType->addItem(qName, qType);
|
||||
}
|
||||
|
||||
type = obs_service_get_type(main->GetService());
|
||||
SetComboByValue(ui->streamType, type);
|
||||
}
|
||||
|
||||
#define TEXT_USE_STREAM_ENC \
|
||||
QTStr("Basic.Settings.Output.Adv.Recording.UseStreamEncoder")
|
||||
|
||||
|
|
@ -1001,17 +1010,31 @@ void OBSBasicSettings::LoadThemeList()
|
|||
}
|
||||
}
|
||||
|
||||
QString defaultTheme;
|
||||
defaultTheme += DEFAULT_THEME;
|
||||
defaultTheme += " ";
|
||||
defaultTheme += QTStr("Default");
|
||||
|
||||
/* Check shipped themes. */
|
||||
QDirIterator uIt(QString(themeDir.c_str()), QStringList() << "*.qss",
|
||||
QDir::Files);
|
||||
while (uIt.hasNext()) {
|
||||
uIt.next();
|
||||
QString name = uIt.fileName().section(".",0,0);
|
||||
if (!uniqueSet.contains(name))
|
||||
|
||||
if (name == DEFAULT_THEME)
|
||||
name = defaultTheme;
|
||||
|
||||
if (!uniqueSet.contains(name) && name != "Default")
|
||||
ui->theme->addItem(name);
|
||||
}
|
||||
|
||||
int idx = ui->theme->findText(App()->GetTheme());
|
||||
std::string themeName = App()->GetTheme();
|
||||
|
||||
if (themeName == DEFAULT_THEME)
|
||||
themeName = QT_TO_UTF8(defaultTheme);
|
||||
|
||||
int idx = ui->theme->findText(themeName.c_str());
|
||||
if (idx != -1)
|
||||
ui->theme->setCurrentIndex(idx);
|
||||
}
|
||||
|
|
@ -1100,6 +1123,18 @@ void OBSBasicSettings::LoadGeneralSettings()
|
|||
"BasicWindow", "ProjectorAlwaysOnTop");
|
||||
ui->projectorAlwaysOnTop->setChecked(projectorAlwaysOnTop);
|
||||
|
||||
bool overflowHide = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "OverflowHidden");
|
||||
ui->overflowHide->setChecked(overflowHide);
|
||||
|
||||
bool overflowAlwaysVisible = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "OverflowAlwaysVisible");
|
||||
ui->overflowAlwaysVisible->setChecked(overflowAlwaysVisible);
|
||||
|
||||
bool overflowSelectionHide = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "OverflowSelectionHidden");
|
||||
ui->overflowSelectionHide->setChecked(overflowSelectionHide);
|
||||
|
||||
bool doubleClickSwitch = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "TransitionOnDoubleClick");
|
||||
ui->doubleClickSwitch->setChecked(doubleClickSwitch);
|
||||
|
|
@ -1108,6 +1143,10 @@ void OBSBasicSettings::LoadGeneralSettings()
|
|||
"BasicWindow", "StudioPortraitLayout");
|
||||
ui->studioPortraitLayout->setChecked(studioPortraitLayout);
|
||||
|
||||
bool prevProgLabels = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "StudioModeLabels");
|
||||
ui->prevProgLabelToggle->setChecked(prevProgLabels);
|
||||
|
||||
bool multiviewMouseSwitch = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "MultiviewMouseSwitch");
|
||||
ui->multiviewMouseSwitch->setChecked(multiviewMouseSwitch);
|
||||
|
|
@ -1143,37 +1182,6 @@ void OBSBasicSettings::LoadGeneralSettings()
|
|||
loading = false;
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadStream1Settings()
|
||||
{
|
||||
QLayout *layout = ui->streamContainer->layout();
|
||||
obs_service_t *service = main->GetService();
|
||||
const char *type = obs_service_get_type(service);
|
||||
|
||||
loading = true;
|
||||
|
||||
obs_data_t *settings = obs_service_get_settings(service);
|
||||
|
||||
delete streamProperties;
|
||||
streamProperties = new OBSPropertiesView(settings, type,
|
||||
(PropertiesReloadCallback)obs_get_service_properties,
|
||||
170);
|
||||
|
||||
streamProperties->setProperty("changed", QVariant(false));
|
||||
layout->addWidget(streamProperties);
|
||||
|
||||
QObject::connect(streamProperties, SIGNAL(Changed()),
|
||||
this, STREAM1_CHANGED);
|
||||
|
||||
obs_data_release(settings);
|
||||
|
||||
loading = false;
|
||||
|
||||
if (main->StreamingActive()) {
|
||||
ui->streamType->setEnabled(false);
|
||||
ui->streamContainer->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadRendererList()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
|
@ -1416,7 +1424,7 @@ void OBSBasicSettings::LoadVideoSettings()
|
|||
{
|
||||
loading = true;
|
||||
|
||||
if (video_output_active(obs_get_video())) {
|
||||
if (obs_video_active()) {
|
||||
ui->videoPage->setEnabled(false);
|
||||
ui->videoMsg->setText(
|
||||
QTStr("Basic.Settings.Video.CurrentlyActive"));
|
||||
|
|
@ -1772,8 +1780,8 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
|||
"FFVCustom");
|
||||
int audioBitrate = config_get_int(main->Config(), "AdvOut",
|
||||
"FFABitrate");
|
||||
int audioTrack = config_get_int(main->Config(), "AdvOut",
|
||||
"FFAudioTrack");
|
||||
int audioMixes = config_get_int(main->Config(), "AdvOut",
|
||||
"FFAudioMixes");
|
||||
const char *aEncoder = config_get_string(main->Config(), "AdvOut",
|
||||
"FFAEncoder");
|
||||
int aEncoderId = config_get_int(main->Config(), "AdvOut",
|
||||
|
|
@ -1799,14 +1807,12 @@ void OBSBasicSettings::LoadAdvOutputFFmpegSettings()
|
|||
SelectEncoder(ui->advOutFFAEncoder, aEncoder, aEncoderId);
|
||||
ui->advOutFFACfg->setText(aEncCustom);
|
||||
|
||||
switch (audioTrack) {
|
||||
case 1: ui->advOutFFTrack1->setChecked(true); break;
|
||||
case 2: ui->advOutFFTrack2->setChecked(true); break;
|
||||
case 3: ui->advOutFFTrack3->setChecked(true); break;
|
||||
case 4: ui->advOutFFTrack4->setChecked(true); break;
|
||||
case 5: ui->advOutFFTrack5->setChecked(true); break;
|
||||
case 6: ui->advOutFFTrack6->setChecked(true); break;
|
||||
}
|
||||
ui->advOutFFTrack1->setChecked(audioMixes & (1 << 0));
|
||||
ui->advOutFFTrack2->setChecked(audioMixes & (1 << 1));
|
||||
ui->advOutFFTrack3->setChecked(audioMixes & (1 << 2));
|
||||
ui->advOutFFTrack4->setChecked(audioMixes & (1 << 3));
|
||||
ui->advOutFFTrack5->setChecked(audioMixes & (1 << 4));
|
||||
ui->advOutFFTrack6->setChecked(audioMixes & (1 << 5));
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAdvOutputAudioSettings()
|
||||
|
|
@ -1895,7 +1901,7 @@ void OBSBasicSettings::LoadOutputSettings()
|
|||
LoadAdvOutputFFmpegSettings();
|
||||
LoadAdvOutputAudioSettings();
|
||||
|
||||
if (video_output_active(obs_get_video())) {
|
||||
if (obs_video_active()) {
|
||||
ui->outputMode->setEnabled(false);
|
||||
ui->outputModeLabel->setEnabled(false);
|
||||
ui->simpleRecordingGroupBox->setEnabled(false);
|
||||
|
|
@ -1962,7 +1968,7 @@ void OBSBasicSettings::LoadListValues(QComboBox *widget, obs_property_t *prop,
|
|||
deviceId = obs_data_get_string(settings, "device_id");
|
||||
}
|
||||
|
||||
widget->addItem(QTStr("Disabled"), "disabled");
|
||||
widget->addItem(QTStr("Basic.Settings.Audio.Disabled"), "disabled");
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
const char *name = obs_property_list_item_name(prop, i);
|
||||
|
|
@ -2004,6 +2010,7 @@ void OBSBasicSettings::LoadAudioDevices()
|
|||
LoadListValues(ui->auxAudioDevice1, inputs, 3);
|
||||
LoadListValues(ui->auxAudioDevice2, inputs, 4);
|
||||
LoadListValues(ui->auxAudioDevice3, inputs, 5);
|
||||
LoadListValues(ui->auxAudioDevice4, inputs, 6);
|
||||
obs_properties_destroy(input_props);
|
||||
}
|
||||
|
||||
|
|
@ -2020,17 +2027,21 @@ void OBSBasicSettings::LoadAudioDevices()
|
|||
|
||||
void OBSBasicSettings::LoadAudioSources()
|
||||
{
|
||||
if (ui->audioSourceLayout->rowCount() > 0) {
|
||||
QLayoutItem *forDeletion = ui->audioSourceLayout->takeAt(0);
|
||||
delete forDeletion->widget();
|
||||
delete forDeletion;
|
||||
}
|
||||
auto layout = new QFormLayout();
|
||||
layout->setVerticalSpacing(15);
|
||||
layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||
|
||||
ui->audioSourceScrollArea->takeWidget()->deleteLater();
|
||||
audioSourceSignals.clear();
|
||||
audioSources.clear();
|
||||
|
||||
auto widget = new QWidget();
|
||||
widget->setLayout(layout);
|
||||
ui->audioSourceScrollArea->setWidget(widget);
|
||||
ui->audioSourceLayout->addRow(widget);
|
||||
|
||||
const char *enablePtm = Str("Basic.Settings.Audio.EnablePushToMute");
|
||||
const char *ptmDelay = Str("Basic.Settings.Audio.PushToMuteDelay");
|
||||
|
|
@ -2109,6 +2120,8 @@ void OBSBasicSettings::LoadAudioSources()
|
|||
ptmCB, pttSB, pttCB, pttSB);
|
||||
|
||||
auto label = new OBSSourceLabel(source);
|
||||
label->setMinimumSize(QSize(170, 0));
|
||||
label->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
||||
connect(label, &OBSSourceLabel::Removed,
|
||||
[=]()
|
||||
{
|
||||
|
|
@ -2134,9 +2147,9 @@ void OBSBasicSettings::LoadAudioSources()
|
|||
|
||||
|
||||
if (layout->rowCount() == 0)
|
||||
ui->audioSourceScrollArea->hide();
|
||||
ui->audioHotkeysGroupBox->hide();
|
||||
else
|
||||
ui->audioSourceScrollArea->show();
|
||||
ui->audioHotkeysGroupBox->show();
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAudioSettings()
|
||||
|
|
@ -2234,6 +2247,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
"RecRBTime");
|
||||
int rbSize = config_get_int(main->Config(), "AdvOut",
|
||||
"RecRBSize");
|
||||
bool autoRemux = config_get_bool(main->Config(), "Video",
|
||||
"AutoRemux");
|
||||
|
||||
loading = true;
|
||||
|
||||
|
|
@ -2260,6 +2275,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
ui->streamDelaySec->setValue(delaySec);
|
||||
ui->streamDelayPreserve->setChecked(preserveDelay);
|
||||
ui->streamDelayEnable->setChecked(enableDelay);
|
||||
ui->autoRemux->setChecked(autoRemux);
|
||||
|
||||
|
||||
SetComboByName(ui->colorFormat, videoColorFormat);
|
||||
|
|
@ -2269,7 +2285,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
if (!SetComboByValue(ui->bindToIP, bindIP))
|
||||
SetInvalidValue(ui->bindToIP, bindIP, bindIP);
|
||||
|
||||
if (video_output_active(obs_get_video())) {
|
||||
if (obs_video_active()) {
|
||||
ui->advancedVideoContainer->setEnabled(false);
|
||||
}
|
||||
|
||||
|
|
@ -2313,12 +2329,22 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
loading = false;
|
||||
}
|
||||
|
||||
#define TRUNCATE_TEXT_LENGTH 80
|
||||
|
||||
template <typename Func>
|
||||
static inline void LayoutHotkey(obs_hotkey_id id, obs_hotkey_t *key, Func &&fun,
|
||||
const map<obs_hotkey_id, vector<obs_key_combination_t>> &keys)
|
||||
{
|
||||
auto *label = new OBSHotkeyLabel;
|
||||
label->setText(obs_hotkey_get_description(key));
|
||||
QString text = QT_UTF8(obs_hotkey_get_description(key));
|
||||
|
||||
if (text.length() > TRUNCATE_TEXT_LENGTH) {
|
||||
label->setProperty("fullName", text);
|
||||
text = text.left(TRUNCATE_TEXT_LENGTH);
|
||||
text += "...'";
|
||||
}
|
||||
|
||||
label->setText(text);
|
||||
|
||||
OBSHotkeyWidget *hw = nullptr;
|
||||
|
||||
|
|
@ -2344,7 +2370,19 @@ static QLabel *makeLabel(T &t, Func &&getName)
|
|||
template <typename Func>
|
||||
static QLabel *makeLabel(const OBSSource &source, Func &&)
|
||||
{
|
||||
return new OBSSourceLabel(source);
|
||||
OBSSourceLabel *label = new OBSSourceLabel(source);
|
||||
label->setStyleSheet("font-weight: bold;");
|
||||
QString name = QT_UTF8(obs_source_get_name(source));
|
||||
|
||||
if (name.length() > TRUNCATE_TEXT_LENGTH) {
|
||||
label->setToolTip(name);
|
||||
name = name.left(TRUNCATE_TEXT_LENGTH);
|
||||
name += "...";
|
||||
}
|
||||
|
||||
label->setText(name);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
template <typename Func, typename T>
|
||||
|
|
@ -2356,13 +2394,8 @@ static inline void AddHotkeys(QFormLayout &layout,
|
|||
if (hotkeys.empty())
|
||||
return;
|
||||
|
||||
auto line = new QFrame();
|
||||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
layout.setItem(layout.rowCount(), QFormLayout::SpanningRole,
|
||||
new QSpacerItem(0, 10));
|
||||
layout.addRow(line);
|
||||
|
||||
using tuple_type =
|
||||
std::tuple<T, QPointer<QLabel>, QPointer<QWidget>>;
|
||||
|
|
@ -2423,6 +2456,47 @@ void OBSBasicSettings::LoadHotkeySettings(obs_hotkey_id ignoreKey)
|
|||
widget->setLayout(layout);
|
||||
ui->hotkeyPage->setWidget(widget);
|
||||
|
||||
auto filterLayout = new QGridLayout();
|
||||
auto filterWidget = new QWidget();
|
||||
filterWidget->setLayout(filterLayout);
|
||||
|
||||
auto filterLabel = new QLabel(QTStr("Basic.Settings.Hotkeys.Filter"));
|
||||
auto filter = new QLineEdit();
|
||||
|
||||
auto setRowVisible = [=](int row, bool visible, QLayoutItem *label) {
|
||||
label->widget()->setVisible(visible);
|
||||
|
||||
auto field = layout->itemAt(row, QFormLayout::FieldRole);
|
||||
if (field)
|
||||
field->widget()->setVisible(visible);
|
||||
};
|
||||
|
||||
auto searchFunction = [=](const QString &text) {
|
||||
for (int i = 0; i < layout->rowCount(); i++) {
|
||||
auto label = layout->itemAt(i, QFormLayout::LabelRole);
|
||||
if (label) {
|
||||
OBSHotkeyLabel *item =
|
||||
qobject_cast<OBSHotkeyLabel*>(
|
||||
label->widget());
|
||||
if(item) {
|
||||
if (item->text().toLower()
|
||||
.contains(text.toLower()))
|
||||
setRowVisible(i, true, label);
|
||||
else
|
||||
setRowVisible(i, false, label);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
connect(filter, &QLineEdit::textChanged,
|
||||
this, searchFunction);
|
||||
|
||||
filterLayout->addWidget(filterLabel, 0, 0);
|
||||
filterLayout->addWidget(filter, 0, 1);
|
||||
|
||||
layout->addRow(filterWidget);
|
||||
|
||||
using namespace std;
|
||||
using encoders_elem_t =
|
||||
tuple<OBSEncoder, QPointer<QLabel>, QPointer<QWidget>>;
|
||||
|
|
@ -2582,7 +2656,12 @@ void OBSBasicSettings::LoadHotkeySettings(obs_hotkey_id ignoreKey)
|
|||
auto Update = [&](OBSHotkeyLabel *label, const QString &name,
|
||||
OBSHotkeyLabel *other, const QString &otherName)
|
||||
{
|
||||
label->setToolTip(tt.arg(otherName));
|
||||
QString string = other->property("fullName").value<QString>();
|
||||
|
||||
if (string.isEmpty() || string.isNull())
|
||||
string = otherName;
|
||||
|
||||
label->setToolTip(tt.arg(string));
|
||||
label->setText(name + " *");
|
||||
label->pairPartner = other;
|
||||
};
|
||||
|
|
@ -2627,13 +2706,19 @@ void OBSBasicSettings::SaveGeneralSettings()
|
|||
|
||||
int themeIndex = ui->theme->currentIndex();
|
||||
QString themeData = ui->theme->itemText(themeIndex);
|
||||
string theme = themeData.toStdString();
|
||||
QString defaultTheme;
|
||||
defaultTheme += DEFAULT_THEME;
|
||||
defaultTheme += " ";
|
||||
defaultTheme += QTStr("Default");
|
||||
|
||||
if (themeData == defaultTheme)
|
||||
themeData = DEFAULT_THEME;
|
||||
|
||||
if (WidgetChanged(ui->theme)) {
|
||||
config_set_string(GetGlobalConfig(), "General", "CurrentTheme",
|
||||
theme.c_str());
|
||||
QT_TO_UTF8(themeData));
|
||||
|
||||
App()->SetTheme(theme);
|
||||
App()->SetTheme(themeData.toUtf8().constData());
|
||||
}
|
||||
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
|
|
@ -2666,6 +2751,18 @@ void OBSBasicSettings::SaveGeneralSettings()
|
|||
config_set_double(GetGlobalConfig(), "BasicWindow",
|
||||
"SnapDistance",
|
||||
ui->snapDistance->value());
|
||||
if (WidgetChanged(ui->overflowAlwaysVisible))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"OverflowAlwaysVisible",
|
||||
ui->overflowAlwaysVisible->isChecked());
|
||||
if (WidgetChanged(ui->overflowHide))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"OverflowHidden",
|
||||
ui->overflowHide->isChecked());
|
||||
if (WidgetChanged(ui->overflowSelectionHide))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"OverflowSelectionHidden",
|
||||
ui->overflowSelectionHide->isChecked());
|
||||
if (WidgetChanged(ui->doubleClickSwitch))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"TransitionOnDoubleClick",
|
||||
|
|
@ -2731,6 +2828,14 @@ void OBSBasicSettings::SaveGeneralSettings()
|
|||
main->ResetUI();
|
||||
}
|
||||
|
||||
if (WidgetChanged(ui->prevProgLabelToggle)) {
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"StudioModeLabels",
|
||||
ui->prevProgLabelToggle->isChecked());
|
||||
|
||||
main->ResetUI();
|
||||
}
|
||||
|
||||
bool multiviewChanged = false;
|
||||
if (WidgetChanged(ui->multiviewMouseSwitch)) {
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
|
|
@ -2764,26 +2869,6 @@ void OBSBasicSettings::SaveGeneralSettings()
|
|||
OBSProjector::UpdateMultiviewProjectors();
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveStream1Settings()
|
||||
{
|
||||
QString streamType = GetComboData(ui->streamType);
|
||||
|
||||
obs_service_t *oldService = main->GetService();
|
||||
obs_data_t *hotkeyData = obs_hotkeys_save_service(oldService);
|
||||
|
||||
obs_service_t *newService = obs_service_create(QT_TO_UTF8(streamType),
|
||||
"default_service", streamProperties->GetSettings(),
|
||||
hotkeyData);
|
||||
|
||||
obs_data_release(hotkeyData);
|
||||
if (!newService)
|
||||
return;
|
||||
|
||||
main->SetService(newService);
|
||||
main->SaveService();
|
||||
obs_service_release(newService);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveVideoSettings()
|
||||
{
|
||||
QString baseResolution = ui->baseResolution->currentText();
|
||||
|
|
@ -2892,6 +2977,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
|
|||
SaveSpinBox(ui->reconnectRetryDelay, "Output", "RetryDelay");
|
||||
SaveSpinBox(ui->reconnectMaxRetries, "Output", "MaxRetries");
|
||||
SaveComboData(ui->bindToIP, "Output", "BindIP");
|
||||
SaveCheckBox(ui->autoRemux, "Video", "AutoRemux");
|
||||
|
||||
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
|
||||
QString newDevice = ui->monitoringDevice->currentData().toString();
|
||||
|
|
@ -3085,11 +3171,13 @@ void OBSBasicSettings::SaveOutputSettings()
|
|||
SaveSpinBox(ui->advOutFFABitrate, "AdvOut", "FFABitrate");
|
||||
SaveEncoder(ui->advOutFFAEncoder, "AdvOut", "FFAEncoder");
|
||||
SaveEdit(ui->advOutFFACfg, "AdvOut", "FFACustom");
|
||||
SaveTrackIndex(main->Config(), "AdvOut", "FFAudioTrack",
|
||||
ui->advOutFFTrack1, ui->advOutFFTrack2,
|
||||
ui->advOutFFTrack3, ui->advOutFFTrack4,
|
||||
ui->advOutFFTrack5, ui->advOutFFTrack6);
|
||||
|
||||
config_set_int(main->Config(), "AdvOut", "FFAudioMixes",
|
||||
(ui->advOutFFTrack1->isChecked() ? (1 << 0) : 0) |
|
||||
(ui->advOutFFTrack2->isChecked() ? (1 << 1) : 0) |
|
||||
(ui->advOutFFTrack3->isChecked() ? (1 << 2) : 0) |
|
||||
(ui->advOutFFTrack4->isChecked() ? (1 << 3) : 0) |
|
||||
(ui->advOutFFTrack5->isChecked() ? (1 << 4) : 0) |
|
||||
(ui->advOutFFTrack6->isChecked() ? (1 << 5) : 0));
|
||||
SaveCombo(ui->advOutTrack1Bitrate, "AdvOut", "Track1Bitrate");
|
||||
SaveCombo(ui->advOutTrack2Bitrate, "AdvOut", "Track2Bitrate");
|
||||
SaveCombo(ui->advOutTrack3Bitrate, "AdvOut", "Track3Bitrate");
|
||||
|
|
@ -3225,6 +3313,8 @@ void OBSBasicSettings::SaveAudioSettings()
|
|||
"Basic.AuxDevice2", 4);
|
||||
UpdateAudioDevice(true, ui->auxAudioDevice3,
|
||||
"Basic.AuxDevice3", 5);
|
||||
UpdateAudioDevice(true, ui->auxAudioDevice4,
|
||||
"Basic.AuxDevice4", 6);
|
||||
main->SaveProject();
|
||||
}
|
||||
|
||||
|
|
@ -3357,8 +3447,17 @@ void OBSBasicSettings::closeEvent(QCloseEvent *event)
|
|||
|
||||
void OBSBasicSettings::on_theme_activated(int idx)
|
||||
{
|
||||
string currT = ui->theme->itemText(idx).toStdString();
|
||||
App()->SetTheme(currT);
|
||||
QString currT = ui->theme->itemText(idx);
|
||||
|
||||
QString defaultTheme;
|
||||
defaultTheme += DEFAULT_THEME;
|
||||
defaultTheme += " ";
|
||||
defaultTheme += QTStr("Default");
|
||||
|
||||
if (currT == defaultTheme)
|
||||
currT = DEFAULT_THEME;
|
||||
|
||||
App()->SetTheme(currT.toUtf8().constData());
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_listWidget_itemSelectionChanged()
|
||||
|
|
@ -3395,30 +3494,6 @@ void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button)
|
|||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_streamType_currentIndexChanged(int idx)
|
||||
{
|
||||
if (loading)
|
||||
return;
|
||||
|
||||
QLayout *layout = ui->streamContainer->layout();
|
||||
QString streamType = ui->streamType->itemData(idx).toString();
|
||||
obs_data_t *settings = obs_service_defaults(QT_TO_UTF8(streamType));
|
||||
|
||||
delete streamProperties;
|
||||
streamProperties = new OBSPropertiesView(settings,
|
||||
QT_TO_UTF8(streamType),
|
||||
(PropertiesReloadCallback)obs_get_service_properties,
|
||||
170);
|
||||
|
||||
streamProperties->setProperty("changed", QVariant(true));
|
||||
layout->addWidget(streamProperties);
|
||||
|
||||
QObject::connect(streamProperties, SIGNAL(Changed()),
|
||||
this, STREAM1_CHANGED);
|
||||
|
||||
obs_data_release(settings);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_simpleOutputBrowse_clicked()
|
||||
{
|
||||
QString dir = QFileDialog::getExistingDirectory(this,
|
||||
|
|
@ -3460,35 +3535,50 @@ void OBSBasicSettings::on_advOutFFPathBrowse_clicked()
|
|||
|
||||
void OBSBasicSettings::on_advOutEncoder_currentIndexChanged(int idx)
|
||||
{
|
||||
if (loading)
|
||||
return;
|
||||
|
||||
QString encoder = GetComboData(ui->advOutEncoder);
|
||||
bool loadSettings = encoder == curAdvStreamEncoder;
|
||||
if (!loading) {
|
||||
bool loadSettings = encoder == curAdvStreamEncoder;
|
||||
|
||||
delete streamEncoderProps;
|
||||
streamEncoderProps = CreateEncoderPropertyView(QT_TO_UTF8(encoder),
|
||||
loadSettings ? "streamEncoder.json" : nullptr, true);
|
||||
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps);
|
||||
delete streamEncoderProps;
|
||||
streamEncoderProps = CreateEncoderPropertyView(
|
||||
QT_TO_UTF8(encoder),
|
||||
loadSettings ? "streamEncoder.json" : nullptr,
|
||||
true);
|
||||
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps);
|
||||
}
|
||||
|
||||
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
|
||||
|
||||
if (caps & OBS_ENCODER_CAP_PASS_TEXTURE) {
|
||||
ui->advOutUseRescale->setChecked(false);
|
||||
ui->advOutUseRescale->setVisible(false);
|
||||
ui->advOutRescale->setVisible(false);
|
||||
} else {
|
||||
ui->advOutUseRescale->setVisible(true);
|
||||
ui->advOutRescale->setVisible(true);
|
||||
}
|
||||
|
||||
UNUSED_PARAMETER(idx);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
|
||||
{
|
||||
if (loading)
|
||||
if (!loading) {
|
||||
delete recordEncoderProps;
|
||||
recordEncoderProps = nullptr;
|
||||
}
|
||||
|
||||
if (idx <= 0) {
|
||||
ui->advOutRecUseRescale->setChecked(false);
|
||||
ui->advOutRecUseRescale->setVisible(false);
|
||||
ui->advOutRecRescaleContainer->setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ui->advOutRecUseRescale->setEnabled(idx > 0);
|
||||
ui->advOutRecRescaleContainer->setEnabled(idx > 0);
|
||||
|
||||
delete recordEncoderProps;
|
||||
recordEncoderProps = nullptr;
|
||||
|
||||
if (idx > 0) {
|
||||
QString encoder = GetComboData(ui->advOutRecEncoder);
|
||||
bool loadSettings = encoder == curAdvRecordEncoder;
|
||||
QString encoder = GetComboData(ui->advOutRecEncoder);
|
||||
bool loadSettings = encoder == curAdvRecordEncoder;
|
||||
|
||||
if (!loading) {
|
||||
recordEncoderProps = CreateEncoderPropertyView(
|
||||
QT_TO_UTF8(encoder),
|
||||
loadSettings ? "recordEncoder.json" : nullptr,
|
||||
|
|
@ -3497,6 +3587,17 @@ void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
|
|||
connect(recordEncoderProps, SIGNAL(Changed()),
|
||||
this, SLOT(AdvReplayBufferChanged()));
|
||||
}
|
||||
|
||||
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
|
||||
|
||||
if (caps & OBS_ENCODER_CAP_PASS_TEXTURE) {
|
||||
ui->advOutRecUseRescale->setChecked(false);
|
||||
ui->advOutRecUseRescale->setVisible(false);
|
||||
ui->advOutRecRescaleContainer->setVisible(false);
|
||||
} else {
|
||||
ui->advOutRecUseRescale->setVisible(true);
|
||||
ui->advOutRecRescaleContainer->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int)
|
||||
|
|
@ -3865,10 +3966,18 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
|
|||
warningMsg = QTStr("OutputWarnings.MultiTrackRecording");
|
||||
}
|
||||
|
||||
if (ui->advOutRecFormat->currentText().compare("mp4") == 0) {
|
||||
if (ui->advOutRecFormat->currentText().compare("mp4") == 0 ||
|
||||
ui->advOutRecFormat->currentText().compare("mov") == 0) {
|
||||
if (!warningMsg.isEmpty())
|
||||
warningMsg += "\n\n";
|
||||
warningMsg += QTStr("OutputWarnings.MP4Recording");
|
||||
ui->autoRemux->setText(
|
||||
QTStr("Basic.Settings.Advanced.AutoRemux")
|
||||
+ " " +
|
||||
QTStr("Basic.Settings.Advanced.AutoRemux.MP4"));
|
||||
} else {
|
||||
ui->autoRemux->setText(
|
||||
QTStr("Basic.Settings.Advanced.AutoRemux"));
|
||||
}
|
||||
|
||||
delete advOutRecWarning;
|
||||
|
|
@ -3945,7 +4054,7 @@ void OBSBasicSettings::UpdateStreamDelayEstimate()
|
|||
UpdateAutomaticReplayBufferCheckboxes();
|
||||
}
|
||||
|
||||
static bool EncoderAvailable(const char *encoder)
|
||||
bool EncoderAvailable(const char *encoder)
|
||||
{
|
||||
const char *val;
|
||||
int i = 0;
|
||||
|
|
@ -4243,7 +4352,6 @@ void OBSBasicSettings::AdvReplayBufferChanged()
|
|||
ui->advRBEstimate->setText(QTStr(ESTIMATE_UNKNOWN_STR));
|
||||
|
||||
ui->advReplayBufferGroupBox->setVisible(!lossless && replayBufferEnabled);
|
||||
ui->line_4->setVisible(!lossless && replayBufferEnabled);
|
||||
ui->advReplayBuf->setEnabled(!lossless);
|
||||
|
||||
UpdateAutomaticReplayBufferCheckboxes();
|
||||
|
|
@ -4261,11 +4369,7 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
|
|||
OBSService service;
|
||||
|
||||
if (stream1Changed) {
|
||||
QString streamType = GetComboData(ui->streamType);
|
||||
service = obs_service_create_private(
|
||||
QT_TO_UTF8(streamType), nullptr,
|
||||
streamProperties->GetSettings());
|
||||
obs_service_release(service);
|
||||
service = SpawnTempService();
|
||||
} else {
|
||||
service = main->GetService();
|
||||
}
|
||||
|
|
@ -4321,10 +4425,18 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
|
|||
}
|
||||
}
|
||||
|
||||
if (ui->simpleOutRecFormat->currentText().compare("mp4") == 0) {
|
||||
if (ui->simpleOutRecFormat->currentText().compare("mp4") == 0 ||
|
||||
ui->simpleOutRecFormat->currentText().compare("mov") == 0) {
|
||||
if (!warning.isEmpty())
|
||||
warning += "\n\n";
|
||||
warning += QTStr("OutputWarnings.MP4Recording");
|
||||
ui->autoRemux->setText(
|
||||
QTStr("Basic.Settings.Advanced.AutoRemux")
|
||||
+ " " +
|
||||
QTStr("Basic.Settings.Advanced.AutoRemux.MP4"));
|
||||
} else {
|
||||
ui->autoRemux->setText(
|
||||
QTStr("Basic.Settings.Advanced.AutoRemux"));
|
||||
}
|
||||
|
||||
if (warning.isEmpty())
|
||||
|
|
@ -4421,3 +4533,38 @@ void OBSBasicSettings::on_disableOSXVSync_clicked()
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetGeneralIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(0)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetStreamIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(1)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetOutputIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(2)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetAudioIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(3)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetVideoIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(4)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetHotkeysIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(5)->setIcon(icon);
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SetAdvancedIcon(const QIcon &icon)
|
||||
{
|
||||
ui->listWidget->item(6)->setIcon(icon);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue