2024-07-16 15:16:40 +02:00
|
|
|
#include "output-dialog.hpp"
|
|
|
|
|
|
|
|
#include <QDialog>
|
2024-07-16 18:41:19 +02:00
|
|
|
#include <QVBoxLayout>
|
2024-07-18 01:32:30 +02:00
|
|
|
#include <QHBoxLayout>
|
2024-07-16 18:41:19 +02:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QStackedWidget>
|
2024-07-16 23:00:33 +02:00
|
|
|
#include <QPushButton>
|
|
|
|
#include <QAbstractButton>
|
|
|
|
#include <QToolButton>
|
2024-07-18 01:32:30 +02:00
|
|
|
#include <QFormLayout>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QSizePolicy>
|
2024-07-16 20:52:59 +02:00
|
|
|
#include "obs-module.h"
|
2024-07-18 01:32:30 +02:00
|
|
|
#include "util/platform.h"
|
2024-07-31 22:58:25 +02:00
|
|
|
#include "stream-key-input.hpp"
|
2024-07-16 20:52:59 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Reset output values, e.g. when user hits the back button
|
2024-07-23 09:28:13 +02:00
|
|
|
void OutputDialog::resetOutputs()
|
|
|
|
{
|
2024-07-18 01:32:30 +02:00
|
|
|
outputName = QString("");
|
|
|
|
outputServer = QString("");
|
|
|
|
outputKey = QString("");
|
|
|
|
}
|
2024-07-16 15:16:40 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
// For when we're done
|
2024-07-23 09:28:13 +02:00
|
|
|
void OutputDialog::acceptOutputs()
|
|
|
|
{
|
2024-07-18 16:18:56 +02:00
|
|
|
accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
// For validating the current values and then updating the confirm button state
|
2024-07-23 09:28:13 +02:00
|
|
|
void OutputDialog::validateOutputs(QPushButton *confirmButton)
|
|
|
|
{
|
|
|
|
|
2024-07-31 11:08:09 +02:00
|
|
|
if (outputName.isEmpty() || otherNames.contains(outputName)) {
|
2024-07-18 16:18:56 +02:00
|
|
|
confirmButton->setEnabled(false);
|
|
|
|
} else if (outputServer.isEmpty()) {
|
|
|
|
confirmButton->setEnabled(false);
|
|
|
|
} else if (outputKey.isEmpty()) {
|
|
|
|
confirmButton->setEnabled(false);
|
|
|
|
} else {
|
|
|
|
confirmButton->setEnabled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper for generating info QLabels
|
2024-07-23 09:28:13 +02:00
|
|
|
QLabel *generateInfoLabel(std::string text)
|
|
|
|
{
|
2024-07-18 16:18:56 +02:00
|
|
|
auto label = new QLabel;
|
|
|
|
label->setTextFormat(Qt::RichText);
|
|
|
|
label->setOpenExternalLinks(true);
|
2024-07-18 17:06:23 +02:00
|
|
|
label->setText(QString::fromUtf8(obs_module_text(text.c_str())));
|
2024-07-18 16:18:56 +02:00
|
|
|
label->setWordWrap(true);
|
|
|
|
label->setAlignment(Qt::AlignTop);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper for generating form QLabels
|
2024-07-23 09:28:13 +02:00
|
|
|
QLabel *generateFormLabel(std::string text)
|
|
|
|
{
|
2024-07-18 16:18:56 +02:00
|
|
|
auto label = new QLabel(QString::fromUtf8(obs_module_text(text.c_str())));
|
|
|
|
label->setStyleSheet("font-weight: bold;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Helper for generating output name field
|
2024-07-23 09:28:13 +02:00
|
|
|
QLineEdit *OutputDialog::generateOutputNameField(std::string text, QPushButton *confirmButton, bool edit)
|
|
|
|
{
|
2024-07-19 21:19:54 +02:00
|
|
|
auto field = new QLineEdit;
|
|
|
|
field->setText(QString::fromUtf8(obs_module_text(text.c_str())));
|
|
|
|
field->setStyleSheet("padding: 4px 8px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
if (edit) { // edit mode, set field value from output value
|
|
|
|
field->setText(outputName);
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
connect(field, &QLineEdit::textEdited, [this, field, confirmButton] {
|
|
|
|
outputName = field->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
});
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
return field;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper for generating output server field
|
2024-07-23 09:28:13 +02:00
|
|
|
QLineEdit *OutputDialog::generateOutputServerField(QPushButton *confirmButton, bool locked, bool edit)
|
|
|
|
{
|
2024-07-19 21:19:54 +02:00
|
|
|
auto field = new QLineEdit;
|
|
|
|
field->setStyleSheet("padding: 4px 8px;");
|
|
|
|
field->setDisabled(locked);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
if (edit) { // edit mode, set field value from output value
|
|
|
|
field->setText(outputServer);
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!locked) {
|
|
|
|
connect(field, &QLineEdit::textEdited, [this, field, confirmButton] {
|
|
|
|
outputServer = field->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return field;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper for generating QComboBoxes for server selection
|
2024-07-23 09:28:13 +02:00
|
|
|
QComboBox *OutputDialog::generateOutputServerCombo(std::string service, QPushButton *confirmButton, bool edit)
|
|
|
|
{
|
2024-07-19 21:19:54 +02:00
|
|
|
auto combo = new QComboBox;
|
|
|
|
combo->setMinimumHeight(30);
|
|
|
|
combo->setStyleSheet("padding: 4px 8px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-11-01 15:00:39 +01:00
|
|
|
if (service == "Twitch") {
|
|
|
|
auto twitch_cache = obs_module_get_config_path(obs_get_module("rtmp-services"), "twitch_ingests.json");
|
|
|
|
if (twitch_cache) {
|
|
|
|
auto json = obs_data_create_from_json_file(twitch_cache);
|
|
|
|
bfree(twitch_cache);
|
|
|
|
combo->addItem(QString::fromUtf8("Default"), QString::fromUtf8("rtmp://live.twitch.tv/app"));
|
|
|
|
auto ingests = obs_data_get_array(json, "ingests");
|
|
|
|
obs_data_array_enum(
|
|
|
|
ingests,
|
|
|
|
[](obs_data_t *ingest_data, void *param) {
|
|
|
|
auto c = (QComboBox *)param;
|
|
|
|
auto url = QString::fromUtf8(obs_data_get_string(ingest_data, "url_template"));
|
|
|
|
url.replace(QString::fromUtf8("/{stream_key}"), QString::fromUtf8(""));
|
|
|
|
c->addItem(QString::fromUtf8(obs_data_get_string(ingest_data, "name")), url);
|
|
|
|
},
|
|
|
|
combo);
|
|
|
|
obs_data_array_release(ingests);
|
|
|
|
obs_data_release(json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
auto rawOptions = getService(service);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// turn raw options into actual selectable options
|
|
|
|
if (rawOptions != nullptr) {
|
|
|
|
auto servers = obs_data_get_array(rawOptions, "servers");
|
|
|
|
auto totalServers = obs_data_array_count(servers);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
for (size_t idx = 0; idx < totalServers; idx++) {
|
|
|
|
auto item = obs_data_array_item(servers, idx);
|
|
|
|
combo->addItem(obs_data_get_string(item, "name"), obs_data_get_string(item, "url"));
|
|
|
|
}
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 14:30:21 +02:00
|
|
|
// If we're edit, look up the current value for outputServer and try to set the index
|
|
|
|
if (edit) {
|
|
|
|
auto selectionIndex = combo->findData(outputServer);
|
2024-07-23 09:28:13 +02:00
|
|
|
// blog(LOG_WARNING, "[Aitum Multistream] edit selection %i for value %s", selectionIndex, outputServer.toStdString().c_str());
|
2024-07-22 14:30:21 +02:00
|
|
|
if (selectionIndex != -1) {
|
|
|
|
combo->setCurrentIndex(selectionIndex);
|
|
|
|
}
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 14:30:21 +02:00
|
|
|
// Hook event up after
|
|
|
|
connect(combo, &QComboBox::currentIndexChanged, [this, combo, confirmButton] {
|
|
|
|
outputServer = combo->currentData().toString();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
});
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Set default value for server
|
2024-07-22 14:30:21 +02:00
|
|
|
// outputServer = combo->currentData().toString();
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
return combo;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper for generating output key field
|
2024-07-23 09:28:13 +02:00
|
|
|
QLineEdit *OutputDialog::generateOutputKeyField(QPushButton *confirmButton, bool edit)
|
|
|
|
{
|
2024-07-31 22:58:25 +02:00
|
|
|
auto field = new StreamKeyInput;
|
2024-07-19 21:19:54 +02:00
|
|
|
field->setStyleSheet("padding: 4px 8px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
if (edit) { // edit mode, set field value from output value
|
|
|
|
field->setText(outputKey);
|
|
|
|
}
|
2024-11-01 15:00:39 +01:00
|
|
|
|
2024-07-31 22:58:25 +02:00
|
|
|
// Immediately hide
|
|
|
|
field->setEchoMode(StreamKeyInput::EchoMode::Password);
|
2024-11-01 15:00:39 +01:00
|
|
|
|
2024-07-31 22:58:25 +02:00
|
|
|
// On focus, show field
|
2024-11-01 15:00:39 +01:00
|
|
|
connect(field, &StreamKeyInput::focusGained, [this, field] { field->setEchoMode(StreamKeyInput::EchoMode::Normal); });
|
|
|
|
|
2024-07-31 22:58:25 +02:00
|
|
|
// On blur, hide field
|
2024-11-01 15:00:39 +01:00
|
|
|
connect(field, &StreamKeyInput::focusLost, [this, field] { field->setEchoMode(StreamKeyInput::EchoMode::Password); });
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
connect(field, &QLineEdit::textEdited, [this, field, confirmButton] {
|
|
|
|
outputKey = field->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
});
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
return field;
|
|
|
|
}
|
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
// Helper for generating wizard button layout
|
2024-07-23 09:28:13 +02:00
|
|
|
QHBoxLayout *OutputDialog::generateWizardButtonLayout(QPushButton *confirmButton, QPushButton *serviceButton, bool edit)
|
|
|
|
{
|
2024-07-22 16:44:28 +02:00
|
|
|
auto layout = new QHBoxLayout;
|
|
|
|
layout->setSpacing(0);
|
2024-07-23 09:28:13 +02:00
|
|
|
layout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
if (!edit && serviceButton != nullptr) { // Not edit mode and we have a service (back) button
|
|
|
|
layout->addWidget(serviceButton, 1);
|
|
|
|
layout->addStretch(1);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
layout->addWidget(confirmButton, 0, Qt::AlignRight);
|
|
|
|
} else { // edit mode, push the button to the right
|
|
|
|
layout->addWidget(confirmButton, 0, Qt::AlignRight);
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
return layout;
|
|
|
|
}
|
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
// Helper for generating QPushButtons w/ style
|
2024-07-23 09:28:13 +02:00
|
|
|
QPushButton *generateButton(QString text)
|
|
|
|
{
|
2024-07-18 16:18:56 +02:00
|
|
|
auto button = new QPushButton;
|
|
|
|
button->setText(text);
|
|
|
|
button->setStyleSheet("padding: 4px 12px;");
|
|
|
|
button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
// Helper for generating back button
|
2024-07-23 09:28:13 +02:00
|
|
|
QPushButton *OutputDialog::generateBackButton()
|
|
|
|
{
|
2024-07-22 16:44:28 +02:00
|
|
|
auto button = generateButton(QString("< Back"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
connect(button, &QPushButton::clicked, [this] {
|
|
|
|
stackedWidget->setCurrentIndex(0);
|
|
|
|
resetOutputs();
|
|
|
|
});
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-22 16:44:28 +02:00
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QToolButton *OutputDialog::selectionButton(std::string title, QIcon icon, int selectionStep)
|
|
|
|
{
|
2024-07-16 23:00:33 +02:00
|
|
|
auto button = new QToolButton;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 23:00:33 +02:00
|
|
|
button->setText(QString::fromUtf8(title));
|
|
|
|
button->setIcon(icon);
|
|
|
|
button->setIconSize(QSize(32, 32));
|
|
|
|
button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
2024-07-23 09:28:13 +02:00
|
|
|
button->setStyleSheet(
|
|
|
|
"min-width: 110px; max-width: 110px; min-height: 90px; max-height: 90px; padding-top: 16px; font-weight: bold;");
|
|
|
|
|
|
|
|
connect(button, &QPushButton::clicked, [this, selectionStep] { stackedWidget->setCurrentIndex(selectionStep); });
|
|
|
|
|
2024-07-16 23:00:33 +02:00
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Gets a service from the service array matched by name
|
2024-07-23 09:28:13 +02:00
|
|
|
obs_data_t *OutputDialog::getService(std::string serviceName)
|
|
|
|
{
|
2024-07-18 01:32:30 +02:00
|
|
|
auto total = obs_data_array_count(servicesData);
|
|
|
|
|
|
|
|
for (size_t idx = 0; idx < total; idx++) {
|
|
|
|
auto item = obs_data_array_item(servicesData, idx);
|
2024-07-23 09:28:13 +02:00
|
|
|
// blog(LOG_WARNING, "[Aitum Multistream] %s", obs_data_get_string(item, "name"));
|
2024-07-18 01:32:30 +02:00
|
|
|
|
|
|
|
if (serviceName == obs_data_get_string(item, "name")) {
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2024-07-31 11:08:09 +02:00
|
|
|
OutputDialog::OutputDialog(QDialog *parent, QStringList _otherNames) : QDialog(parent), otherNames(_otherNames)
|
2024-07-23 09:28:13 +02:00
|
|
|
{
|
2024-07-18 01:32:30 +02:00
|
|
|
// Load the services from rtmp-services plugin
|
|
|
|
auto servicesPath = obs_module_get_config_path(obs_get_module("rtmp-services"), "services.json");
|
|
|
|
auto absolutePath = os_get_abs_path_ptr(servicesPath);
|
|
|
|
auto allData = obs_data_create_from_json_file(absolutePath);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
servicesData = obs_data_get_array(allData, "services");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
bfree(allData);
|
|
|
|
bfree(servicesPath);
|
|
|
|
bfree(absolutePath);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Blank info
|
|
|
|
resetOutputs();
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
//
|
2024-07-16 20:52:59 +02:00
|
|
|
setModal(true);
|
2024-07-18 01:32:30 +02:00
|
|
|
setContentsMargins(0, 0, 0, 0);
|
|
|
|
setFixedSize(650, 400);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
stackedWidget = new QStackedWidget;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
stackedWidget->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
// Service selection page
|
|
|
|
stackedWidget->addWidget(WizardServicePage());
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
// Pages for each service
|
|
|
|
stackedWidget->addWidget(WizardInfoKick());
|
|
|
|
stackedWidget->addWidget(WizardInfoYouTube());
|
|
|
|
stackedWidget->addWidget(WizardInfoTwitter());
|
|
|
|
stackedWidget->addWidget(WizardInfoUnknown());
|
|
|
|
stackedWidget->addWidget(WizardInfoTwitch());
|
|
|
|
stackedWidget->addWidget(WizardInfoTrovo());
|
|
|
|
stackedWidget->addWidget(WizardInfoTikTok());
|
|
|
|
stackedWidget->addWidget(WizardInfoFacebook());
|
|
|
|
|
|
|
|
stackedWidget->setCurrentIndex(0);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
stackedWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
2024-07-16 20:52:59 +02:00
|
|
|
setWindowTitle(obs_module_text("NewOutputWindowTitle"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
auto stackedLayout = new QVBoxLayout;
|
2024-07-18 01:32:30 +02:00
|
|
|
stackedLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
stackedLayout->addWidget(stackedWidget, 1);
|
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
setLayout(stackedLayout);
|
2024-07-16 15:16:40 +02:00
|
|
|
show();
|
|
|
|
}
|
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Edit mode
|
2024-07-31 11:08:09 +02:00
|
|
|
OutputDialog::OutputDialog(QDialog *parent, QString name, QString server, QString key, QStringList _otherNames)
|
|
|
|
: QDialog(parent),
|
|
|
|
otherNames(_otherNames)
|
2024-07-23 09:28:13 +02:00
|
|
|
{
|
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Load the services from rtmp-services plugin
|
|
|
|
auto servicesPath = obs_module_get_config_path(obs_get_module("rtmp-services"), "services.json");
|
|
|
|
auto absolutePath = os_get_abs_path_ptr(servicesPath);
|
|
|
|
auto allData = obs_data_create_from_json_file(absolutePath);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
servicesData = obs_data_get_array(allData, "services");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
bfree(allData);
|
|
|
|
bfree(servicesPath);
|
|
|
|
bfree(absolutePath);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Blank info
|
|
|
|
resetOutputs();
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Set info from constructor
|
|
|
|
outputName = name;
|
|
|
|
outputServer = server;
|
|
|
|
outputKey = key;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
//
|
|
|
|
setModal(true);
|
|
|
|
setContentsMargins(0, 0, 0, 0);
|
|
|
|
setFixedSize(650, 400);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
auto layout = new QVBoxLayout();
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
// Add the appropriate page to the layout based upon the server url
|
2024-11-01 15:00:39 +01:00
|
|
|
if (outputServer.contains(QString::fromUtf8("ingest.global-contribute.live-video.net")) ||
|
|
|
|
outputServer.contains(QString::fromUtf8(".contribute.live-video.net")) ||
|
2024-07-23 09:28:13 +02:00
|
|
|
outputServer.contains(QString::fromUtf8(".twitch.tv"))) { // twitch
|
2024-07-19 21:19:54 +02:00
|
|
|
layout->addWidget(WizardInfoTwitch(true));
|
|
|
|
} else if (outputServer.contains(QString::fromUtf8(".youtube.com"))) { // youtube
|
|
|
|
layout->addWidget(WizardInfoYouTube(true));
|
|
|
|
} else if (outputServer.contains(QString::fromUtf8("fa723fc1b171.global-contribute.live-video.net"))) { // kick
|
|
|
|
layout->addWidget(WizardInfoKick(true));
|
|
|
|
} else if (outputServer.contains(QString::fromUtf8(".tiktokcdn-"))) { // tiktok
|
|
|
|
layout->addWidget(WizardInfoTikTok(true));
|
|
|
|
} else if (outputServer.contains(QString::fromUtf8(".pscp.tv"))) { // twitter
|
|
|
|
layout->addWidget(WizardInfoTwitter(true));
|
|
|
|
} else if (outputServer.contains(QString::fromUtf8("livepush.trovo.live"))) { // trovo
|
|
|
|
layout->addWidget(WizardInfoTrovo(true));
|
|
|
|
} else if (outputServer.contains(QString::fromUtf8(".facebook.com"))) { // facebook
|
|
|
|
layout->addWidget(WizardInfoFacebook(true));
|
|
|
|
} else { // unknown
|
|
|
|
layout->addWidget(WizardInfoUnknown(true));
|
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
setLayout(layout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-19 21:19:54 +02:00
|
|
|
setWindowTitle(obs_module_text("EditOutputWindowTitle"));
|
|
|
|
|
|
|
|
show();
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardServicePage()
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 01:32:30 +02:00
|
|
|
pageLayout->setAlignment(Qt::AlignTop);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 20:52:59 +02:00
|
|
|
auto description = new QLabel(QString::fromUtf8(obs_module_text("NewOutputSelectService")));
|
2024-07-29 22:16:54 +02:00
|
|
|
description->setWordWrap(true);
|
2024-07-16 23:00:33 +02:00
|
|
|
description->setStyleSheet("margin-bottom: 20px;");
|
2024-07-16 20:52:59 +02:00
|
|
|
pageLayout->addWidget(description);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 20:52:59 +02:00
|
|
|
// layout for service selection
|
|
|
|
auto selectionLayout = new QVBoxLayout;
|
2024-07-18 01:32:30 +02:00
|
|
|
selectionLayout->setAlignment(Qt::AlignCenter);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
auto spacerTest = new QSpacerItem(20, 45, QSizePolicy::Fixed, QSizePolicy::Fixed);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 23:00:33 +02:00
|
|
|
pageLayout->addSpacerItem(spacerTest);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 20:52:59 +02:00
|
|
|
// row 1
|
|
|
|
auto rowOne = new QHBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
rowOne->addWidget(selectionButton("Twitch", platformIconTwitch, 5));
|
|
|
|
rowOne->addWidget(selectionButton("YouTube", platformIconYouTube, 2));
|
|
|
|
rowOne->addWidget(selectionButton("TikTok", platformIconTikTok, 7));
|
|
|
|
rowOne->addWidget(selectionButton("Facebook", platformIconFacebook, 8));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 23:00:33 +02:00
|
|
|
selectionLayout->addLayout(rowOne);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 20:52:59 +02:00
|
|
|
// row 2
|
2024-07-16 23:00:33 +02:00
|
|
|
auto rowTwo = new QHBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
rowTwo->addWidget(selectionButton("Trovo", platformIconTrovo, 6));
|
|
|
|
rowTwo->addWidget(selectionButton("X (Twitter)", platformIconTwitter, 3));
|
|
|
|
rowTwo->addWidget(selectionButton("Kick", platformIconKick, 1));
|
|
|
|
rowTwo->addWidget(selectionButton(obs_module_text("OtherService"), platformIconUnknown, 4));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 23:00:33 +02:00
|
|
|
selectionLayout->addLayout(rowTwo);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 23:00:33 +02:00
|
|
|
//
|
|
|
|
pageLayout->addLayout(selectionLayout);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoKick(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 18:08:16 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 18:08:16 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Heading
|
2024-07-19 21:19:54 +02:00
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text(edit ? "KickServiceInfoEdit" : "KickServiceInfo")));
|
2024-07-18 18:08:16 +02:00
|
|
|
title->setWordWrap(true);
|
|
|
|
title->setTextFormat(Qt::RichText);
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-22 21:26:19 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("KickOutput", confirmButton, edit);
|
2024-07-18 18:08:16 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Server field
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerField(confirmButton, true, edit);
|
2024-07-18 18:08:16 +02:00
|
|
|
serverSelection->setText("rtmps://fa723fc1b171.global-contribute.live-video.net");
|
|
|
|
formLayout->addRow(generateFormLabel("KickServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("KickServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 18:08:16 +02:00
|
|
|
formLayout->addRow(generateFormLabel("KickStreamKey"), outputKeyField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("KickStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:08:16 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 1) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->text();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoYouTube(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 17:06:23 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 17:06:23 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("YouTubeServiceInfo")));
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("YouTubeOutput", confirmButton, edit);
|
2024-07-18 17:06:23 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Server selection
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerCombo("YouTube - RTMPS", confirmButton, edit);
|
2024-07-18 17:06:23 +02:00
|
|
|
formLayout->addRow(generateFormLabel("YouTubeServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("YouTubeServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 17:06:23 +02:00
|
|
|
formLayout->addRow(generateFormLabel("YouTubeStreamKey"), outputKeyField);
|
|
|
|
|
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("YouTubeStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
2024-07-18 17:06:23 +02:00
|
|
|
|
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 2) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->currentData().toString();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoTwitter(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 18:02:40 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 18:02:40 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("TwitterServiceInfo")));
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("TwitterOutput", confirmButton, edit);
|
2024-07-18 18:02:40 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Server selection
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerCombo("Twitter", confirmButton, edit);
|
2024-07-18 18:02:40 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TwitterServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("TwitterServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 18:02:40 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TwitterStreamKey"), outputKeyField);
|
|
|
|
|
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("TwitterStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
2024-07-18 18:02:40 +02:00
|
|
|
|
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:02:40 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 3) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->currentData().toString();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 15:16:40 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoUnknown(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 18:18:50 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 18:18:50 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("CustomServiceInfo")));
|
|
|
|
title->setWordWrap(true);
|
|
|
|
title->setTextFormat(Qt::RichText);
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("CustomOutput", confirmButton, edit);
|
2024-07-18 18:18:50 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Server field
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerField(confirmButton, false, edit);
|
2024-07-18 18:18:50 +02:00
|
|
|
formLayout->addRow(generateFormLabel("CustomServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("CustomServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 18:18:50 +02:00
|
|
|
formLayout->addRow(generateFormLabel("CustomStreamKey"), outputKeyField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("CustomStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 18:18:50 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 4) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->text();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 15:16:40 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoTwitch(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 01:32:30 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
// Layout
|
|
|
|
auto pageLayout = new QVBoxLayout;
|
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("TwitchServiceInfo")));
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("TwitchOutput", confirmButton, edit);
|
2024-07-18 16:18:56 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
// Server selection
|
2024-07-22 14:30:21 +02:00
|
|
|
auto serverSelection = generateOutputServerCombo("Twitch", confirmButton, edit);
|
2024-07-18 16:18:56 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TwitchServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Server info
|
2024-07-18 16:18:56 +02:00
|
|
|
formLayout->addWidget(generateInfoLabel("TwitchServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 16:18:56 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TwitchStreamKey"), outputKeyField);
|
2024-07-18 01:32:30 +02:00
|
|
|
|
|
|
|
// Server key info
|
2024-07-18 16:18:56 +02:00
|
|
|
formLayout->addWidget(generateInfoLabel("TwitchStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 01:32:30 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 16:18:56 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
2024-07-18 01:32:30 +02:00
|
|
|
|
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:06:23 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 5) {
|
|
|
|
blog(LOG_WARNING, "[Aitum Multistream] default outputname %s ",
|
|
|
|
outputNameField->text().toUtf8().constData());
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->currentData().toString();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 15:16:40 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoTrovo(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 17:52:43 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 17:52:43 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("TrovoServiceInfo")));
|
|
|
|
title->setWordWrap(true);
|
|
|
|
title->setTextFormat(Qt::RichText);
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("TrovoOutput", confirmButton, edit);
|
2024-07-18 17:52:43 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Server field
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerField(confirmButton, true, edit);
|
2024-07-18 17:52:43 +02:00
|
|
|
serverSelection->setText("rtmp://livepush.trovo.live/live/");
|
2024-07-19 21:19:54 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TrovoServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("TrovoServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 17:52:43 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TrovoStreamKey"), outputKeyField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("TrovoStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:52:43 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 6) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->text();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoTikTok(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 17:32:38 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 17:32:38 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("TikTokServiceInfo")));
|
|
|
|
title->setWordWrap(true);
|
|
|
|
title->setTextFormat(Qt::RichText);
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("TikTokOutput", confirmButton, edit);
|
2024-07-18 17:32:38 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Server field
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerField(confirmButton, false, edit);
|
2024-07-18 17:32:38 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TikTokServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("TikTokServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 17:32:38 +02:00
|
|
|
formLayout->addRow(generateFormLabel("TikTokStreamKey"), outputKeyField);
|
|
|
|
|
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("TikTokStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
2024-07-18 17:32:38 +02:00
|
|
|
|
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:32:38 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 7) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->text();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
2024-07-23 09:28:13 +02:00
|
|
|
QWidget *OutputDialog::WizardInfoFacebook(bool edit)
|
|
|
|
{
|
2024-07-16 18:41:19 +02:00
|
|
|
auto page = new QWidget(this);
|
2024-07-18 17:47:42 +02:00
|
|
|
page->setStyleSheet("padding: 0px; margin: 0px;");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Layout
|
2024-07-16 18:41:19 +02:00
|
|
|
auto pageLayout = new QVBoxLayout;
|
2024-07-18 17:47:42 +02:00
|
|
|
pageLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Heading
|
|
|
|
auto title = new QLabel(QString::fromUtf8(obs_module_text("FacebookServiceInfo")));
|
|
|
|
title->setWordWrap(true);
|
|
|
|
title->setTextFormat(Qt::RichText);
|
2024-07-16 18:41:19 +02:00
|
|
|
pageLayout->addWidget(title);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Content
|
|
|
|
auto contentLayout = new QVBoxLayout;
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Confirm button - initialised here so we can set state in form input connects
|
2024-07-23 10:01:11 +02:00
|
|
|
auto confirmButton = generateButton(QString(obs_module_text(edit ? "SaveOutput" : "CreateOutput")));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Form
|
|
|
|
auto formLayout = new QFormLayout;
|
|
|
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
|
|
|
formLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
|
|
|
formLayout->setSpacing(12);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Output name
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputNameField = generateOutputNameField("FacebookOutput", confirmButton, edit);
|
2024-07-18 17:47:42 +02:00
|
|
|
formLayout->addRow(generateFormLabel("OutputName"), outputNameField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Server field
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serverSelection = generateOutputServerField(confirmButton, true, edit);
|
2024-07-18 17:47:42 +02:00
|
|
|
serverSelection->setText("rtmps://rtmp-api.facebook.com:443/rtmp/");
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
formLayout->addRow(generateFormLabel("FacebookServer"), serverSelection);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Server info
|
|
|
|
formLayout->addWidget(generateInfoLabel("FacebookServerInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Server key
|
2024-07-22 16:44:28 +02:00
|
|
|
auto outputKeyField = generateOutputKeyField(confirmButton, edit);
|
2024-07-18 17:47:42 +02:00
|
|
|
formLayout->addRow(generateFormLabel("FacebookStreamKey"), outputKeyField);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Server key info
|
|
|
|
formLayout->addWidget(generateInfoLabel("FacebookStreamKeyInfo"));
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
contentLayout->addLayout(formLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// spacing
|
|
|
|
auto spacer = new QSpacerItem(1, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
|
|
|
contentLayout->addSpacerItem(spacer);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
pageLayout->addLayout(contentLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// back button
|
2024-07-22 16:44:28 +02:00
|
|
|
auto serviceButton = edit ? nullptr : generateBackButton();
|
|
|
|
|
|
|
|
// Controls layout
|
|
|
|
auto controlsLayout = generateWizardButtonLayout(confirmButton, serviceButton, edit);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// confirm button (initialised above so we can set state)
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(confirmButton, &QPushButton::clicked, [this] { acceptOutputs(); });
|
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Hook it all together
|
2024-07-22 16:44:28 +02:00
|
|
|
pageLayout->addLayout(controlsLayout, 1);
|
2024-07-16 18:41:19 +02:00
|
|
|
page->setLayout(pageLayout);
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-18 17:47:42 +02:00
|
|
|
// Defaults for when we're changed to
|
2024-07-19 21:19:54 +02:00
|
|
|
if (!edit) {
|
2024-07-23 09:28:13 +02:00
|
|
|
connect(stackedWidget, &QStackedWidget::currentChanged,
|
|
|
|
[this, outputNameField, serverSelection, outputKeyField, confirmButton] {
|
|
|
|
if (stackedWidget->currentIndex() == 8) {
|
|
|
|
outputName = outputNameField->text();
|
|
|
|
outputServer = serverSelection->text();
|
|
|
|
outputKey = outputKeyField->text();
|
|
|
|
validateOutputs(confirmButton);
|
|
|
|
}
|
|
|
|
});
|
2024-07-19 21:19:54 +02:00
|
|
|
}
|
2024-07-23 09:28:13 +02:00
|
|
|
|
2024-07-16 18:41:19 +02:00
|
|
|
return page;
|
|
|
|
}
|