UI: Add checkbox for Twitch bandwidth test mode
This commit is contained in:
parent
c55f006058
commit
51bfb9d899
@ -297,7 +297,14 @@ void OAuthStreamKey::OnStreamConfig()
|
||||
|
||||
obs_data_t *settings = obs_service_get_settings(service);
|
||||
|
||||
obs_data_set_string(settings, "key", key_.c_str());
|
||||
bool bwtest = obs_data_get_bool(settings, "bwtest");
|
||||
|
||||
if (bwtest && strcmp(this->service(), "Twitch") == 0)
|
||||
obs_data_set_string(settings, "key",
|
||||
key_.append("?bandwidthtest=true").c_str());
|
||||
else
|
||||
obs_data_set_string(settings, "key", key_.c_str());
|
||||
|
||||
obs_service_update(service, settings);
|
||||
|
||||
obs_data_release(settings);
|
||||
|
@ -628,6 +628,7 @@ Basic.Settings.Stream.StreamType="Stream Type"
|
||||
Basic.Settings.Stream.Custom.UseAuthentication="Use authentication"
|
||||
Basic.Settings.Stream.Custom.Username="Username"
|
||||
Basic.Settings.Stream.Custom.Password="Password"
|
||||
Basic.Settings.Stream.BandwidthTestMode="Enable Bandwidth Test Mode"
|
||||
|
||||
# basic mode 'output' settings
|
||||
Basic.Settings.Output="Output"
|
||||
|
@ -1062,17 +1062,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="useAuth">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.Custom.UseAuthentication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="authUsername"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="authUsernameLabel">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.Custom.Username</string>
|
||||
@ -1082,7 +1082,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="authPwLabel">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.Custom.Password</string>
|
||||
@ -1092,7 +1092,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QWidget" name="authPwWidget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_25">
|
||||
<property name="leftMargin">
|
||||
@ -1124,6 +1124,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="bandwidthTestEnable">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Stream.BandwidthTestMode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -36,6 +36,7 @@ void OBSBasicSettings::InitStreamPage()
|
||||
{
|
||||
ui->connectAccount2->setVisible(false);
|
||||
ui->disconnectAccount->setVisible(false);
|
||||
ui->bandwidthTestEnable->setVisible(false);
|
||||
|
||||
int vertSpacing = ui->topStreamLayout->verticalSpacing();
|
||||
|
||||
@ -90,6 +91,9 @@ void OBSBasicSettings::LoadStream1Settings()
|
||||
idx = 1;
|
||||
}
|
||||
ui->service->setCurrentIndex(idx);
|
||||
|
||||
bool bw_test = obs_data_get_bool(settings, "bwtest");
|
||||
ui->bandwidthTestEnable->setChecked(bw_test);
|
||||
}
|
||||
|
||||
UpdateServerList();
|
||||
@ -151,6 +155,7 @@ void OBSBasicSettings::SaveStream1Settings()
|
||||
}
|
||||
}
|
||||
|
||||
obs_data_set_bool(settings, "bwtest", ui->bandwidthTestEnable->isChecked());
|
||||
obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
|
||||
|
||||
OBSService newService = obs_service_create(service_id,
|
||||
@ -260,6 +265,7 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
|
||||
bool custom = IsCustomService();
|
||||
|
||||
ui->disconnectAccount->setVisible(false);
|
||||
ui->bandwidthTestEnable->setVisible(false);
|
||||
|
||||
#ifdef BROWSER_AVAILABLE
|
||||
if (cef) {
|
||||
@ -411,6 +417,9 @@ void OBSBasicSettings::OnOAuthStreamKeyConnected()
|
||||
ui->streamKeyLabel->setVisible(false);
|
||||
ui->connectAccount2->setVisible(false);
|
||||
ui->disconnectAccount->setVisible(true);
|
||||
|
||||
if (strcmp(a->service(), "Twitch") == 0)
|
||||
ui->bandwidthTestEnable->setVisible(true);
|
||||
}
|
||||
|
||||
ui->streamStackWidget->setCurrentIndex((int)Section::StreamKey);
|
||||
@ -473,6 +482,7 @@ void OBSBasicSettings::on_disconnectAccount_clicked()
|
||||
ui->streamKeyLabel->setVisible(true);
|
||||
ui->connectAccount2->setVisible(true);
|
||||
ui->disconnectAccount->setVisible(false);
|
||||
ui->bandwidthTestEnable->setVisible(false);
|
||||
ui->key->setText("");
|
||||
}
|
||||
|
||||
|
@ -334,6 +334,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user