mirror of
https://github.com/Aitum/obs-aitum-multistream.git
synced 2024-11-22 02:12:40 +01:00
clang format
This commit is contained in:
parent
71b0e6e123
commit
4328ce7d91
@ -15,27 +15,29 @@
|
|||||||
#include "obs-frontend-api.h"
|
#include "obs-frontend-api.h"
|
||||||
#include <util/dstr.h>
|
#include <util/dstr.h>
|
||||||
|
|
||||||
|
|
||||||
// Generate buttons for default/custom stuff
|
// Generate buttons for default/custom stuff
|
||||||
QPushButton *ConfigUtils::generateButton(QString buttonText) {
|
QPushButton *ConfigUtils::generateButton(QString buttonText)
|
||||||
|
{
|
||||||
auto styles = QString::fromUtf8("QPushButton[unselected=\"true\"] { background: pink; }");
|
auto styles = QString::fromUtf8("QPushButton[unselected=\"true\"] { background: pink; }");
|
||||||
|
|
||||||
auto button = new QPushButton(buttonText);
|
auto button = new QPushButton(buttonText);
|
||||||
button->setStyleSheet(styles);
|
button->setStyleSheet(styles);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate settings groupbox
|
// Generate settings groupbox
|
||||||
QGroupBox *ConfigUtils::generateSettingsGroupBox(QString headingText) {
|
QGroupBox *ConfigUtils::generateSettingsGroupBox(QString headingText)
|
||||||
|
{
|
||||||
auto group = headingText == nullptr ? new QGroupBox : new QGroupBox(headingText);
|
auto group = headingText == nullptr ? new QGroupBox : new QGroupBox(headingText);
|
||||||
// group->setProperty("altColor", QVariant(true));
|
// group->setProperty("altColor", QVariant(true));
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate menu button
|
// Generate menu button
|
||||||
QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon) {
|
QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon)
|
||||||
|
{
|
||||||
auto button = new QToolButton;
|
auto button = new QToolButton;
|
||||||
|
|
||||||
button->setText(title);
|
button->setText(title);
|
||||||
@ -48,21 +50,19 @@ QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon) {
|
|||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// For setting the active property stuff on buttons
|
// For setting the active property stuff on buttons
|
||||||
void ConfigUtils::updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex) {
|
void ConfigUtils::updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex)
|
||||||
|
{
|
||||||
defaultButton->setProperty("unselected", activeIndex != 0 ? true : false);
|
defaultButton->setProperty("unselected", activeIndex != 0 ? true : false);
|
||||||
customButton->setProperty("unselected", activeIndex != 1 ? true : false);
|
customButton->setProperty("unselected", activeIndex != 1 ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Platform icons deciphered from endpoints
|
// Platform icons deciphered from endpoints
|
||||||
QIcon ConfigUtils::getPlatformIconFromEndpoint(QString endpoint)
|
QIcon ConfigUtils::getPlatformIconFromEndpoint(QString endpoint)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (endpoint.contains(QString::fromUtf8(".contribute.live-video.net")) ||
|
if (endpoint.contains(QString::fromUtf8(".contribute.live-video.net")) ||
|
||||||
endpoint.contains(QString::fromUtf8(".twitch.tv"))) { // twitch
|
endpoint.contains(QString::fromUtf8(".twitch.tv"))) { // twitch
|
||||||
return QIcon(":/aitum/media/twitch.png");
|
return QIcon(":/aitum/media/twitch.png");
|
||||||
} else if (endpoint.contains(QString::fromUtf8(".youtube.com"))) { // youtube
|
} else if (endpoint.contains(QString::fromUtf8(".youtube.com"))) { // youtube
|
||||||
return QIcon(":/aitum/media/youtube.png");
|
return QIcon(":/aitum/media/youtube.png");
|
||||||
|
@ -17,12 +17,8 @@ public:
|
|||||||
static QPushButton *generateButton(QString buttonText);
|
static QPushButton *generateButton(QString buttonText);
|
||||||
static QGroupBox *generateSettingsGroupBox(QString headingText);
|
static QGroupBox *generateSettingsGroupBox(QString headingText);
|
||||||
static QToolButton *generateMenuButton(QString title, QIcon icon);
|
static QToolButton *generateMenuButton(QString title, QIcon icon);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex);
|
|
||||||
|
|
||||||
|
static void updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex);
|
||||||
|
|
||||||
static QIcon getPlatformIconFromEndpoint(QString endpoint);
|
static QIcon getPlatformIconFromEndpoint(QString endpoint);
|
||||||
};
|
};
|
||||||
|
@ -50,7 +50,6 @@ private:
|
|||||||
QIcon streamActiveIcon = QIcon(":/aitum/media/streaming.svg");
|
QIcon streamActiveIcon = QIcon(":/aitum/media/streaming.svg");
|
||||||
QIcon streamInactiveIcon = QIcon(":/aitum/media/stream.svg");
|
QIcon streamInactiveIcon = QIcon(":/aitum/media/stream.svg");
|
||||||
|
|
||||||
|
|
||||||
static void frontend_event(enum obs_frontend_event event, void *private_data);
|
static void frontend_event(enum obs_frontend_event event, void *private_data);
|
||||||
|
|
||||||
static void stream_output_stop(void *data, calldata_t *calldata);
|
static void stream_output_stop(void *data, calldata_t *calldata);
|
||||||
|
Loading…
Reference in New Issue
Block a user