mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
General: 80 columns refactor in C/C++ headers
This commit is contained in:
parent
a3cbbf3ea9
commit
386e1f3b46
3
Config.h
3
Config.h
@ -33,7 +33,8 @@ class Config
|
|||||||
void SetPassword(const char *password);
|
void SetPassword(const char *password);
|
||||||
bool CheckAuth(const char *userChallenge);
|
bool CheckAuth(const char *userChallenge);
|
||||||
const char* GenerateSalt();
|
const char* GenerateSalt();
|
||||||
static const char* GenerateSecret(const char *password, const char *salt);
|
static const char* GenerateSecret(
|
||||||
|
const char *password, const char *salt);
|
||||||
|
|
||||||
bool ServerEnabled;
|
bool ServerEnabled;
|
||||||
uint64_t ServerPort;
|
uint64_t ServerPort;
|
||||||
|
8
Utils.h
8
Utils.h
@ -34,7 +34,8 @@ class Utils
|
|||||||
public:
|
public:
|
||||||
static obs_data_array_t* GetSceneItems(obs_source_t *source);
|
static obs_data_array_t* GetSceneItems(obs_source_t *source);
|
||||||
static obs_data_t* GetSceneItemData(obs_scene_item *item);
|
static obs_data_t* GetSceneItemData(obs_scene_item *item);
|
||||||
static obs_sceneitem_t* GetSceneItemFromName(obs_source_t *source, const char *name);
|
static obs_sceneitem_t* GetSceneItemFromName(
|
||||||
|
obs_source_t *source, const char *name);
|
||||||
static obs_source_t* GetTransitionFromName(const char *search_name);
|
static obs_source_t* GetTransitionFromName(const char *search_name);
|
||||||
static obs_source_t* GetSceneFromNameOrCurrent(const char *scene_name);
|
static obs_source_t* GetSceneFromNameOrCurrent(const char *scene_name);
|
||||||
|
|
||||||
@ -67,7 +68,10 @@ class Utils
|
|||||||
static const char* OBSVersionString();
|
static const char* OBSVersionString();
|
||||||
|
|
||||||
static QSystemTrayIcon* GetTrayIcon();
|
static QSystemTrayIcon* GetTrayIcon();
|
||||||
static void SysTrayNotify(QString &text, QSystemTrayIcon::MessageIcon n, QString title = QString("obs-websocket"));
|
static void SysTrayNotify(
|
||||||
|
QString &text,
|
||||||
|
QSystemTrayIcon::MessageIcon n,
|
||||||
|
QString title = QString("obs-websocket"));
|
||||||
|
|
||||||
static QString FormatIPAddress(QHostAddress &addr);
|
static QString FormatIPAddress(QHostAddress &addr);
|
||||||
static const char* GetRecordingFolder();
|
static const char* GetRecordingFolder();
|
||||||
|
@ -31,7 +31,8 @@ class WSEvents : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit WSEvents(WSServer *srv);
|
explicit WSEvents(WSServer *srv);
|
||||||
~WSEvents();
|
~WSEvents();
|
||||||
static void FrontendEventHandler(enum obs_frontend_event event, void *private_data);
|
static void FrontendEventHandler(
|
||||||
|
enum obs_frontend_event event, void *private_data);
|
||||||
void connectTransitionSignals(obs_source_t* transition);
|
void connectTransitionSignals(obs_source_t* transition);
|
||||||
void connectSceneSignals(obs_source_t* scene);
|
void connectSceneSignals(obs_source_t* scene);
|
||||||
static WSEvents* Instance;
|
static WSEvents* Instance;
|
||||||
@ -45,7 +46,8 @@ class WSEvents : public QObject
|
|||||||
void deferredInitOperations();
|
void deferredInitOperations();
|
||||||
void StreamStatus();
|
void StreamStatus();
|
||||||
void TransitionDurationChanged(int ms);
|
void TransitionDurationChanged(int ms);
|
||||||
void SelectedSceneChanged(QListWidgetItem *current, QListWidgetItem *prev);
|
void SelectedSceneChanged(
|
||||||
|
QListWidgetItem *current, QListWidgetItem *prev);
|
||||||
void ModeSwitchClicked(bool checked);
|
void ModeSwitchClicked(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -62,7 +64,8 @@ class WSEvents : public QObject
|
|||||||
uint64_t _lastBytesSent;
|
uint64_t _lastBytesSent;
|
||||||
uint64_t _lastBytesSentTime;
|
uint64_t _lastBytesSentTime;
|
||||||
|
|
||||||
void broadcastUpdate(const char *updateType, obs_data_t *additionalFields);
|
void broadcastUpdate(const char *updateType,
|
||||||
|
obs_data_t *additionalFields);
|
||||||
|
|
||||||
void OnSceneChange();
|
void OnSceneChange();
|
||||||
void OnSceneListChange();
|
void OnSceneListChange();
|
||||||
|
@ -54,22 +54,18 @@ void SettingsDialog::showEvent(QShowEvent *event)
|
|||||||
|
|
||||||
void SettingsDialog::ToggleShowHide()
|
void SettingsDialog::ToggleShowHide()
|
||||||
{
|
{
|
||||||
if (!isVisible()) {
|
if (!isVisible())
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::AuthCheckboxChanged()
|
void SettingsDialog::AuthCheckboxChanged()
|
||||||
{
|
{
|
||||||
if (ui->authRequired->isChecked()) {
|
if (ui->authRequired->isChecked())
|
||||||
ui->password->setEnabled(true);
|
ui->password->setEnabled(true);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
ui->password->setEnabled(false);
|
ui->password->setEnabled(false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::FormAccepted()
|
void SettingsDialog::FormAccepted()
|
||||||
@ -90,13 +86,9 @@ void SettingsDialog::FormAccepted()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(Config::Current()->Secret, "") != 0)
|
if (strcmp(Config::Current()->Secret, "") != 0)
|
||||||
{
|
|
||||||
conf->AuthRequired = true;
|
conf->AuthRequired = true;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
conf->AuthRequired = false;
|
conf->AuthRequired = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -106,13 +98,9 @@ void SettingsDialog::FormAccepted()
|
|||||||
conf->Save();
|
conf->Save();
|
||||||
|
|
||||||
if (conf->ServerEnabled)
|
if (conf->ServerEnabled)
|
||||||
{
|
|
||||||
WSServer::Instance->Start(conf->ServerPort);
|
WSServer::Instance->Start(conf->ServerPort);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
WSServer::Instance->Stop();
|
WSServer::Instance->Stop();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsDialog::~SettingsDialog()
|
SettingsDialog::~SettingsDialog()
|
||||||
|
@ -27,11 +27,11 @@ class SettingsDialog;
|
|||||||
|
|
||||||
class SettingsDialog : public QDialog
|
class SettingsDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SettingsDialog(QWidget *parent = 0);
|
explicit SettingsDialog(QWidget *parent = 0);
|
||||||
~SettingsDialog();
|
~SettingsDialog();
|
||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event);
|
||||||
void ToggleShowHide();
|
void ToggleShowHide();
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ private Q_SLOTS:
|
|||||||
void FormAccepted();
|
void FormAccepted();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SettingsDialog *ui;
|
Ui::SettingsDialog *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGSDIALOG_H
|
#endif // SETTINGSDIALOG_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user