mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4bf5fa749 | ||
|
|
eb346da6f4 | ||
|
|
866480cde6 | ||
|
|
10e1c7b3a3 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -63,7 +63,7 @@ jobs:
|
|||||||
echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> UI/frontend-plugins/CMakeLists.txt
|
echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> UI/frontend-plugins/CMakeLists.txt
|
||||||
mkdir ./build
|
mkdir ./build
|
||||||
cd ./build
|
cd ./build
|
||||||
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DDISABLE_PYTHON=ON -DDepsPath="/tmp/obsdeps" -DQTDIR="/tmp/obsdeps" ..
|
cmake -DBUILD_BROWSER=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DDISABLE_PYTHON=ON -DDepsPath="/tmp/obsdeps" -DQTDIR="/tmp/obsdeps" ..
|
||||||
cd -
|
cd -
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ AdvSceneSwitcher.generalTab.priority.video="Video"
|
|||||||
|
|
||||||
; Transition Tab
|
; Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
|
AdvSceneSwitcher.transitionTab.title="Szenenübergänge"
|
||||||
AdvSceneSwitcher.transitionTab.transitionOverride="Szenenübergänge, die im Szenenwechsler konfiguriert werden, haben Vorrang vor Übergangsüberschreibung"
|
AdvSceneSwitcher.transitionTab.setTransitionBy="Beim Ändern des Szenenübergangs:"
|
||||||
|
AdvSceneSwitcher.transitionTab.transitionOverride="Verwende Übergangsüberschreibungen"
|
||||||
|
AdvSceneSwitcher.transitionTab.adjustActiveTransitionType="Wechsle den aktiven Szenenübergangtyp"
|
||||||
|
AdvSceneSwitcher.transitionTab.transitionBehaviorSelectionError="Mindestens eine Option muss aktiv sein:\n\n - Verwende Übergangsüberschreibungen\n\n - Wechsle den aktiven Szenenübergangtyp"
|
||||||
AdvSceneSwitcher.transitionTab.transitionForAToB="Szenenübergänge für automatisierte Szenenwechsel von Szene A zu Szene B"
|
AdvSceneSwitcher.transitionTab.transitionForAToB="Szenenübergänge für automatisierte Szenenwechsel von Szene A zu Szene B"
|
||||||
AdvSceneSwitcher.transitionTab.transitionsHelp="<html><head/><body><p>Diese Einstellungen beeinflussen <span style=\"font-style:italic;\">nur</span> vom Szenenwechsler ausgelöste Szenenübergänge - Siehe <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> um auch manuelle Szenenübergänge zu konfigurieren.<br/>Einstellungen auf diesem Tab haben Vorrang, vor denen welche auf den übrigen Tabs konfiguriert wurden.<br/><br/>Klicke auf das Plus Symbol, um einen neuen Eintrag hinzuzufügen.</p></body></html>"
|
AdvSceneSwitcher.transitionTab.transitionsHelp="<html><head/><body><p>Diese Einstellungen beeinflussen <span style=\"font-style:italic;\">nur</span> vom Szenenwechsler ausgelöste Szenenübergänge - Siehe <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> um auch manuelle Szenenübergänge zu konfigurieren.<br/>Einstellungen auf diesem Tab haben Vorrang, vor denen welche auf den übrigen Tabs konfiguriert wurden.<br/><br/>Klicke auf das Plus Symbol, um einen neuen Eintrag hinzuzufügen.</p></body></html>"
|
||||||
AdvSceneSwitcher.transitionTab.defaultTransition="Ändere den Szenenübergang wenn eine Szene aktiv ist"
|
AdvSceneSwitcher.transitionTab.defaultTransition="Ändere den Szenenübergang wenn eine Szene aktiv ist"
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ AdvSceneSwitcher.generalTab.priority.video="Video"
|
|||||||
|
|
||||||
; Transition Tab
|
; Transition Tab
|
||||||
AdvSceneSwitcher.transitionTab.title="Transition"
|
AdvSceneSwitcher.transitionTab.title="Transition"
|
||||||
AdvSceneSwitcher.transitionTab.transitionOverride="Scene transitions defined in the scene switcher take priority over Transition Overrides defined per scene"
|
AdvSceneSwitcher.transitionTab.setTransitionBy="When changing transitions:"
|
||||||
|
AdvSceneSwitcher.transitionTab.transitionOverride="Set transition overrides"
|
||||||
|
AdvSceneSwitcher.transitionTab.adjustActiveTransitionType="Change active transition type"
|
||||||
|
AdvSceneSwitcher.transitionTab.transitionBehaviorSelectionError="At least one option must be enabled:\n\n - Use transition overrides\n\n - Change active transition type"
|
||||||
AdvSceneSwitcher.transitionTab.transitionForAToB="Use transition for automated scene switch from scene A to scene B"
|
AdvSceneSwitcher.transitionTab.transitionForAToB="Use transition for automated scene switch from scene A to scene B"
|
||||||
AdvSceneSwitcher.transitionTab.transitionsHelp="<html><head/><body><p>These settings <span style=\"font-style:italic;\">only</span> affect transitions caused by the scene switcher - Check out <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> if you want to configure this for manual scene changes.<br/>Settings defined here take priority over transition settings configured elsewhere in the scene switcher.<br/><br/>Click the plus symbol below to add a new entry.</p></body></html>"
|
AdvSceneSwitcher.transitionTab.transitionsHelp="<html><head/><body><p>These settings <span style=\"font-style:italic;\">only</span> affect transitions caused by the scene switcher - Check out <a href=\"https://obsproject.com/forum/resources/transition-table.1174/\"><span style=\" text-decoration: underline; color:#268bd2;\">Transition Table</span></a> if you want to configure this for manual scene changes.<br/>Settings defined here take priority over transition settings configured elsewhere in the scene switcher.<br/><br/>Click the plus symbol below to add a new entry.</p></body></html>"
|
||||||
AdvSceneSwitcher.transitionTab.defaultTransition="Change transition if scene is active"
|
AdvSceneSwitcher.transitionTab.defaultTransition="Change transition if scene is active"
|
||||||
|
|||||||
2
deps/asio
vendored
2
deps/asio
vendored
Submodule deps/asio updated: 93f87fbdbf...b73dc1d2c0
2
deps/websocketpp
vendored
2
deps/websocketpp
vendored
Submodule deps/websocketpp updated: 1b11fd3015...c6d7e295bf
@@ -566,18 +566,42 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="transitionOverridecheckBox">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<property name="text">
|
<item row="1" column="1">
|
||||||
<string>AdvSceneSwitcher.transitionTab.transitionOverride</string>
|
<widget class="QCheckBox" name="adjustActiveTransitionType">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>AdvSceneSwitcher.transitionTab.adjustActiveTransitionType</string>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<widget class="Line" name="line_17">
|
</item>
|
||||||
<property name="orientation">
|
<item row="0" column="0">
|
||||||
<enum>Qt::Horizontal</enum>
|
<widget class="QLabel" name="label_12">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>AdvSceneSwitcher.transitionTab.setTransitionBy</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QCheckBox" name="transitionOverridecheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>AdvSceneSwitcher.transitionTab.transitionOverride</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<spacer name="horizontalSpacer_9">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="transitionsGroup">
|
<widget class="QGroupBox" name="transitionsGroup">
|
||||||
|
|||||||
@@ -552,7 +552,8 @@ void SwitcherData::Thread()
|
|||||||
server.sendMessage(scene, transition);
|
server.sendMessage(scene, transition);
|
||||||
}
|
}
|
||||||
switchScene(scene, transition,
|
switchScene(scene, transition,
|
||||||
tansitionOverrideOverride);
|
tansitionOverrideOverride,
|
||||||
|
adjustActiveTransitionType, verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeSceneInfoToFile();
|
writeSceneInfoToFile();
|
||||||
@@ -619,9 +620,10 @@ bool SwitcherData::checkForMatch(OBSWeakSource &scene,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
|
void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
|
||||||
bool &transitionOverrideOverride)
|
bool transitionOverrideOverride,
|
||||||
|
bool adjustActiveTransitionType, bool verbose)
|
||||||
{
|
{
|
||||||
if (!scene && switcher->verbose) {
|
if (!scene && verbose) {
|
||||||
blog(LOG_INFO, "nothing to switch to");
|
blog(LOG_INFO, "nothing to switch to");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -632,13 +634,14 @@ void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
|
|||||||
if (source && source != currentSource) {
|
if (source && source != currentSource) {
|
||||||
transitionData td;
|
transitionData td;
|
||||||
setNextTransition(scene, currentSource, transition,
|
setNextTransition(scene, currentSource, transition,
|
||||||
transitionOverrideOverride, td);
|
transitionOverrideOverride,
|
||||||
|
adjustActiveTransitionType, td);
|
||||||
obs_frontend_set_current_scene(source);
|
obs_frontend_set_current_scene(source);
|
||||||
if (transitionOverrideOverride) {
|
if (transitionOverrideOverride) {
|
||||||
restoreTransitionOverride(source, td);
|
restoreTransitionOverride(source, td);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switcher->verbose) {
|
if (verbose) {
|
||||||
blog(LOG_INFO, "switched scene");
|
blog(LOG_INFO, "switched scene");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ public slots:
|
|||||||
void on_defaultTransitionsUp_clicked();
|
void on_defaultTransitionsUp_clicked();
|
||||||
void on_defaultTransitionsDown_clicked();
|
void on_defaultTransitionsDown_clicked();
|
||||||
void on_transitionOverridecheckBox_stateChanged(int state);
|
void on_transitionOverridecheckBox_stateChanged(int state);
|
||||||
|
void on_adjustActiveTransitionType_stateChanged(int state);
|
||||||
void defTransitionDelayValueChanged(int value);
|
void defTransitionDelayValueChanged(int value);
|
||||||
|
|
||||||
void on_browseButton_clicked();
|
void on_browseButton_clicked();
|
||||||
@@ -287,12 +288,14 @@ bool isInFocus(const QString &executable);
|
|||||||
|
|
||||||
void setNextTransition(OBSWeakSource &targetScene, obs_source_t *currentSource,
|
void setNextTransition(OBSWeakSource &targetScene, obs_source_t *currentSource,
|
||||||
OBSWeakSource &transition,
|
OBSWeakSource &transition,
|
||||||
bool &transitionOverrideOverride, transitionData &td);
|
bool transitionOverrideOverride,
|
||||||
|
bool adjustActiveTransitionType, transitionData &td);
|
||||||
void overwriteTransitionOverride(obs_weak_source_t *sceneWs,
|
void overwriteTransitionOverride(obs_weak_source_t *sceneWs,
|
||||||
obs_source_t *transition, transitionData &td);
|
obs_source_t *transition, transitionData &td);
|
||||||
void restoreTransitionOverride(obs_source_t *scene, transitionData td);
|
void restoreTransitionOverride(obs_source_t *scene, transitionData td);
|
||||||
void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
|
void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
|
||||||
bool &transitionOverrideOverride);
|
bool transitionOverrideOverride,
|
||||||
|
bool adjustActiveTransitionType, bool verbose);
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Main SwitcherData
|
* Main SwitcherData
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ Most of this code is based on https://github.com/Palakis/obs-websocket
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Due to iussues with asio the network functionality will be disabled on macOS
|
|
||||||
#if !(__APPLE__)
|
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
@@ -16,16 +13,36 @@ Most of this code is based on https://github.com/Palakis/obs-websocket
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
|
||||||
|
#include <websocketpp/config/asio_no_tls_client.hpp>
|
||||||
#include <websocketpp/config/asio_no_tls.hpp>
|
#include <websocketpp/config/asio_no_tls.hpp>
|
||||||
#include <websocketpp/server.hpp>
|
#include <websocketpp/server.hpp>
|
||||||
|
|
||||||
#include <websocketpp/config/asio_no_tls_client.hpp>
|
|
||||||
#include <websocketpp/client.hpp>
|
#include <websocketpp/client.hpp>
|
||||||
|
|
||||||
using websocketpp::connection_hdl;
|
using websocketpp::connection_hdl;
|
||||||
typedef websocketpp::server<websocketpp::config::asio> server;
|
typedef websocketpp::server<websocketpp::config::asio> server;
|
||||||
typedef websocketpp::client<websocketpp::config::asio_client> client;
|
typedef websocketpp::client<websocketpp::config::asio_client> client;
|
||||||
|
|
||||||
|
class NetworkConfig {
|
||||||
|
public:
|
||||||
|
NetworkConfig();
|
||||||
|
void Load(obs_data_t *obj);
|
||||||
|
void Save(obs_data_t *obj);
|
||||||
|
void SetDefaults(obs_data_t *obj);
|
||||||
|
|
||||||
|
std::string GetClientUri();
|
||||||
|
|
||||||
|
// Server
|
||||||
|
bool ServerEnabled;
|
||||||
|
uint64_t ServerPort;
|
||||||
|
bool LockToIPv4;
|
||||||
|
|
||||||
|
// Client
|
||||||
|
bool ClientEnabled;
|
||||||
|
std::string Address;
|
||||||
|
uint64_t ClientPort;
|
||||||
|
bool SendAll;
|
||||||
|
};
|
||||||
|
|
||||||
class WSServer : public QObject {
|
class WSServer : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -52,6 +69,12 @@ private:
|
|||||||
QThreadPool _threadPool;
|
QThreadPool _threadPool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class ServerStatus {
|
||||||
|
NOT_RUNNING,
|
||||||
|
STARTING,
|
||||||
|
RUNNING,
|
||||||
|
};
|
||||||
|
|
||||||
class WSClient : public QObject {
|
class WSClient : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -80,62 +103,6 @@ private:
|
|||||||
std::string _failMsg;
|
std::string _failMsg;
|
||||||
};
|
};
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
class WSServer : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit WSServer(){};
|
|
||||||
virtual ~WSServer(){};
|
|
||||||
void start(quint16 port, bool lockToIPv4){};
|
|
||||||
void stop(){};
|
|
||||||
void sendMessage(OBSWeakSource scene, OBSWeakSource transition){};
|
|
||||||
};
|
|
||||||
|
|
||||||
class WSClient : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit WSClient(){};
|
|
||||||
virtual ~WSClient(){};
|
|
||||||
void connect(std::string uri){};
|
|
||||||
void disconnect(){};
|
|
||||||
std::string getFail() { return _failMsg; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::string _failMsg;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class NetworkConfig {
|
|
||||||
public:
|
|
||||||
NetworkConfig();
|
|
||||||
void Load(obs_data_t *obj);
|
|
||||||
void Save(obs_data_t *obj);
|
|
||||||
void SetDefaults(obs_data_t *obj);
|
|
||||||
|
|
||||||
std::string GetClientUri();
|
|
||||||
|
|
||||||
// Server
|
|
||||||
bool ServerEnabled;
|
|
||||||
uint64_t ServerPort;
|
|
||||||
bool LockToIPv4;
|
|
||||||
|
|
||||||
// Client
|
|
||||||
bool ClientEnabled;
|
|
||||||
std::string Address;
|
|
||||||
uint64_t ClientPort;
|
|
||||||
bool SendAll;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class ServerStatus {
|
|
||||||
NOT_RUNNING,
|
|
||||||
STARTING,
|
|
||||||
RUNNING,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class ClientStatus {
|
enum class ClientStatus {
|
||||||
DISCONNECTED,
|
DISCONNECTED,
|
||||||
CONNECTING,
|
CONNECTING,
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ struct SwitcherData {
|
|||||||
bool disableHints = false;
|
bool disableHints = false;
|
||||||
bool showFrame = false;
|
bool showFrame = false;
|
||||||
bool tansitionOverrideOverride = false;
|
bool tansitionOverrideOverride = false;
|
||||||
|
bool adjustActiveTransitionType = true;
|
||||||
|
|
||||||
int interval = default_interval;
|
int interval = default_interval;
|
||||||
|
|
||||||
|
|||||||
@@ -203,6 +203,10 @@ void GetCurrentWindowTitle(std::string &title)
|
|||||||
&format, &num, &bytes,
|
&format, &num, &bytes,
|
||||||
(uint8_t **)&data);
|
(uint8_t **)&data);
|
||||||
|
|
||||||
|
if (data == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int status = 0;
|
int status = 0;
|
||||||
XTextProperty text;
|
XTextProperty text;
|
||||||
if (xstatus == Success) {
|
if (xstatus == Success) {
|
||||||
@@ -386,4 +390,4 @@ int secondsSinceLastInput()
|
|||||||
XCloseDisplay(display);
|
XCloseDisplay(display);
|
||||||
|
|
||||||
return idle_time;
|
return idle_time;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,12 +24,64 @@ Most of this code is based on https://github.com/Palakis/obs-websocket
|
|||||||
#define SCENE_ENTRY "scene"
|
#define SCENE_ENTRY "scene"
|
||||||
#define TRANSITION_ENTRY "transition"
|
#define TRANSITION_ENTRY "transition"
|
||||||
|
|
||||||
#if !(__APPLE__)
|
|
||||||
|
|
||||||
using websocketpp::lib::placeholders::_1;
|
using websocketpp::lib::placeholders::_1;
|
||||||
using websocketpp::lib::placeholders::_2;
|
using websocketpp::lib::placeholders::_2;
|
||||||
using websocketpp::lib::bind;
|
using websocketpp::lib::bind;
|
||||||
|
|
||||||
|
NetworkConfig::NetworkConfig()
|
||||||
|
: ServerEnabled(false),
|
||||||
|
ServerPort(55555),
|
||||||
|
LockToIPv4(false),
|
||||||
|
ClientEnabled(false),
|
||||||
|
Address(""),
|
||||||
|
ClientPort(55555),
|
||||||
|
SendAll(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkConfig::Load(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
SetDefaults(obj);
|
||||||
|
|
||||||
|
ServerEnabled = obs_data_get_bool(obj, PARAM_SERVER_ENABLE);
|
||||||
|
ServerPort = obs_data_get_int(obj, PARAM_SERVER_PORT);
|
||||||
|
LockToIPv4 = obs_data_get_bool(obj, PARAM_LOCKTOIPV4);
|
||||||
|
|
||||||
|
ClientEnabled = obs_data_get_bool(obj, PARAM_CLIENT_ENABLE);
|
||||||
|
Address = obs_data_get_string(obj, PARAM_ADDRESS);
|
||||||
|
ClientPort = obs_data_get_int(obj, PARAM_CLIENT_PORT);
|
||||||
|
SendAll = obs_data_get_bool(obj, PARAM_CLIENT_SENDALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkConfig::Save(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
obs_data_set_bool(obj, PARAM_SERVER_ENABLE, ServerEnabled);
|
||||||
|
obs_data_set_int(obj, PARAM_SERVER_PORT, ServerPort);
|
||||||
|
obs_data_set_bool(obj, PARAM_LOCKTOIPV4, LockToIPv4);
|
||||||
|
|
||||||
|
obs_data_set_bool(obj, PARAM_CLIENT_ENABLE, ClientEnabled);
|
||||||
|
obs_data_set_string(obj, PARAM_ADDRESS, Address.c_str());
|
||||||
|
obs_data_set_int(obj, PARAM_CLIENT_PORT, ClientPort);
|
||||||
|
obs_data_set_bool(obj, PARAM_CLIENT_SENDALL, SendAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkConfig::SetDefaults(obs_data_t *obj)
|
||||||
|
{
|
||||||
|
obs_data_set_default_bool(obj, PARAM_SERVER_ENABLE, ServerEnabled);
|
||||||
|
obs_data_set_default_int(obj, PARAM_SERVER_PORT, ServerPort);
|
||||||
|
obs_data_set_default_bool(obj, PARAM_LOCKTOIPV4, LockToIPv4);
|
||||||
|
|
||||||
|
obs_data_set_default_bool(obj, PARAM_CLIENT_ENABLE, ClientEnabled);
|
||||||
|
obs_data_set_default_string(obj, PARAM_ADDRESS, Address.c_str());
|
||||||
|
obs_data_set_default_int(obj, PARAM_CLIENT_PORT, ClientPort);
|
||||||
|
obs_data_set_default_bool(obj, PARAM_CLIENT_SENDALL, SendAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string NetworkConfig::GetClientUri()
|
||||||
|
{
|
||||||
|
return "ws://" + Address + ":" + std::to_string(ClientPort);
|
||||||
|
}
|
||||||
|
|
||||||
WSServer::WSServer()
|
WSServer::WSServer()
|
||||||
: QObject(nullptr), _connections(), _clMutex(QMutex::Recursive)
|
: QObject(nullptr), _connections(), _clMutex(QMutex::Recursive)
|
||||||
{
|
{
|
||||||
@@ -216,7 +268,8 @@ std::string processMessage(std::string payload)
|
|||||||
"'";
|
"'";
|
||||||
}
|
}
|
||||||
|
|
||||||
switchScene(scene, transition, switcher->tansitionOverrideOverride);
|
switchScene(scene, transition, switcher->tansitionOverrideOverride,
|
||||||
|
switcher->adjustActiveTransitionType, switcher->verbose);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,62 +453,6 @@ void WSClient::onClose(connection_hdl hdl)
|
|||||||
switcher->clientStatus = ClientStatus::DISCONNECTED;
|
switcher->clientStatus = ClientStatus::DISCONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NetworkConfig::NetworkConfig()
|
|
||||||
: ServerEnabled(false),
|
|
||||||
ServerPort(55555),
|
|
||||||
LockToIPv4(false),
|
|
||||||
ClientEnabled(false),
|
|
||||||
Address(""),
|
|
||||||
ClientPort(55555),
|
|
||||||
SendAll(true)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetworkConfig::Load(obs_data_t *obj)
|
|
||||||
{
|
|
||||||
SetDefaults(obj);
|
|
||||||
|
|
||||||
ServerEnabled = obs_data_get_bool(obj, PARAM_SERVER_ENABLE);
|
|
||||||
ServerPort = obs_data_get_int(obj, PARAM_SERVER_PORT);
|
|
||||||
LockToIPv4 = obs_data_get_bool(obj, PARAM_LOCKTOIPV4);
|
|
||||||
|
|
||||||
ClientEnabled = obs_data_get_bool(obj, PARAM_CLIENT_ENABLE);
|
|
||||||
Address = obs_data_get_string(obj, PARAM_ADDRESS);
|
|
||||||
ClientPort = obs_data_get_int(obj, PARAM_CLIENT_PORT);
|
|
||||||
SendAll = obs_data_get_bool(obj, PARAM_CLIENT_SENDALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetworkConfig::Save(obs_data_t *obj)
|
|
||||||
{
|
|
||||||
obs_data_set_bool(obj, PARAM_SERVER_ENABLE, ServerEnabled);
|
|
||||||
obs_data_set_int(obj, PARAM_SERVER_PORT, ServerPort);
|
|
||||||
obs_data_set_bool(obj, PARAM_LOCKTOIPV4, LockToIPv4);
|
|
||||||
|
|
||||||
obs_data_set_bool(obj, PARAM_CLIENT_ENABLE, ClientEnabled);
|
|
||||||
obs_data_set_string(obj, PARAM_ADDRESS, Address.c_str());
|
|
||||||
obs_data_set_int(obj, PARAM_CLIENT_PORT, ClientPort);
|
|
||||||
obs_data_set_bool(obj, PARAM_CLIENT_SENDALL, SendAll);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetworkConfig::SetDefaults(obs_data_t *obj)
|
|
||||||
{
|
|
||||||
obs_data_set_default_bool(obj, PARAM_SERVER_ENABLE, ServerEnabled);
|
|
||||||
obs_data_set_default_int(obj, PARAM_SERVER_PORT, ServerPort);
|
|
||||||
obs_data_set_default_bool(obj, PARAM_LOCKTOIPV4, LockToIPv4);
|
|
||||||
|
|
||||||
obs_data_set_default_bool(obj, PARAM_CLIENT_ENABLE, ClientEnabled);
|
|
||||||
obs_data_set_default_string(obj, PARAM_ADDRESS, Address.c_str());
|
|
||||||
obs_data_set_default_int(obj, PARAM_CLIENT_PORT, ClientPort);
|
|
||||||
obs_data_set_default_bool(obj, PARAM_CLIENT_SENDALL, SendAll);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string NetworkConfig::GetClientUri()
|
|
||||||
{
|
|
||||||
return "ws://" + Address + ":" + std::to_string(ClientPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SwitcherData::loadNetworkSettings(obs_data_t *obj)
|
void SwitcherData::loadNetworkSettings(obs_data_t *obj)
|
||||||
{
|
{
|
||||||
networkConfig.Load(obj);
|
networkConfig.Load(obj);
|
||||||
@@ -471,13 +468,6 @@ void SwitcherData::saveNetworkSwitches(obs_data_t *obj)
|
|||||||
|
|
||||||
void AdvSceneSwitcher::setupNetworkTab()
|
void AdvSceneSwitcher::setupNetworkTab()
|
||||||
{
|
{
|
||||||
#if __APPLE__
|
|
||||||
ui->clientSettings->setDisabled(true);
|
|
||||||
ui->serverSettings->setDisabled(true);
|
|
||||||
ui->networkTabWarningLabel->setText(
|
|
||||||
obs_module_text("AdvSceneSwitcher.networkTab.DisabledWarning"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ui->serverSettings->setChecked(switcher->networkConfig.ServerEnabled);
|
ui->serverSettings->setChecked(switcher->networkConfig.ServerEnabled);
|
||||||
ui->serverPort->setValue(switcher->networkConfig.ServerPort);
|
ui->serverPort->setValue(switcher->networkConfig.ServerPort);
|
||||||
ui->lockToIPv4->setChecked(switcher->networkConfig.LockToIPv4);
|
ui->lockToIPv4->setChecked(switcher->networkConfig.LockToIPv4);
|
||||||
|
|||||||
@@ -182,12 +182,31 @@ void AdvSceneSwitcher::on_transitionOverridecheckBox_stateChanged(int state)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(switcher->m);
|
if (!state && !switcher->adjustActiveTransitionType) {
|
||||||
if (!state) {
|
DisplayMessage(obs_module_text(
|
||||||
switcher->tansitionOverrideOverride = false;
|
"AdvSceneSwitcher.transitionTab.transitionBehaviorSelectionError"));
|
||||||
} else {
|
ui->adjustActiveTransitionType->setChecked(true);
|
||||||
switcher->tansitionOverrideOverride = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->tansitionOverrideOverride = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdvSceneSwitcher::on_adjustActiveTransitionType_stateChanged(int state)
|
||||||
|
{
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This option only makes sense if we are allowed to use transition overrides
|
||||||
|
if (!state && !switcher->tansitionOverrideOverride) {
|
||||||
|
DisplayMessage(obs_module_text(
|
||||||
|
"AdvSceneSwitcher.transitionTab.transitionBehaviorSelectionError"));
|
||||||
|
ui->transitionOverridecheckBox->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::lock_guard<std::mutex> lock(switcher->m);
|
||||||
|
switcher->adjustActiveTransitionType = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSceneSwitcher::defTransitionDelayValueChanged(int value)
|
void AdvSceneSwitcher::defTransitionDelayValueChanged(int value)
|
||||||
@@ -251,7 +270,8 @@ void restoreTransitionOverride(obs_source_t *scene, transitionData td)
|
|||||||
|
|
||||||
void setNextTransition(OBSWeakSource &targetScene, obs_source_t *currentSource,
|
void setNextTransition(OBSWeakSource &targetScene, obs_source_t *currentSource,
|
||||||
OBSWeakSource &transition,
|
OBSWeakSource &transition,
|
||||||
bool &transitionOverrideOverride, transitionData &td)
|
bool transitionOverrideOverride,
|
||||||
|
bool adjustActiveTransitionType, transitionData &td)
|
||||||
{
|
{
|
||||||
obs_weak_source_t *currentScene =
|
obs_weak_source_t *currentScene =
|
||||||
obs_source_get_weak_source(currentSource);
|
obs_source_get_weak_source(currentSource);
|
||||||
@@ -266,7 +286,7 @@ void setNextTransition(OBSWeakSource &targetScene, obs_source_t *currentSource,
|
|||||||
nextTransition = obs_weak_source_get_source(transition);
|
nextTransition = obs_weak_source_get_source(transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextTransition) {
|
if (nextTransition && adjustActiveTransitionType) {
|
||||||
obs_frontend_set_current_transition(nextTransition);
|
obs_frontend_set_current_transition(nextTransition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,6 +354,8 @@ void SwitcherData::saveSceneTransitions(obs_data_t *obj)
|
|||||||
|
|
||||||
obs_data_set_bool(obj, "tansitionOverrideOverride",
|
obs_data_set_bool(obj, "tansitionOverrideOverride",
|
||||||
switcher->tansitionOverrideOverride);
|
switcher->tansitionOverrideOverride);
|
||||||
|
obs_data_set_bool(obj, "adjustActiveTransitionType",
|
||||||
|
switcher->adjustActiveTransitionType);
|
||||||
obs_data_set_default_int(obj, "defTransitionDelay",
|
obs_data_set_default_int(obj, "defTransitionDelay",
|
||||||
default_def_transition_dealy);
|
default_def_transition_dealy);
|
||||||
obs_data_set_int(obj, "defTransitionDelay",
|
obs_data_set_int(obj, "defTransitionDelay",
|
||||||
@@ -390,6 +412,8 @@ void SwitcherData::loadSceneTransitions(obs_data_t *obj)
|
|||||||
|
|
||||||
switcher->tansitionOverrideOverride =
|
switcher->tansitionOverrideOverride =
|
||||||
obs_data_get_bool(obj, "tansitionOverrideOverride");
|
obs_data_get_bool(obj, "tansitionOverrideOverride");
|
||||||
|
switcher->adjustActiveTransitionType =
|
||||||
|
obs_data_get_bool(obj, "adjustActiveTransitionType");
|
||||||
DefaultSceneTransition::delay =
|
DefaultSceneTransition::delay =
|
||||||
obs_data_get_int(obj, "defTransitionDelay");
|
obs_data_get_int(obj, "defTransitionDelay");
|
||||||
}
|
}
|
||||||
@@ -430,6 +454,8 @@ void AdvSceneSwitcher::setupTransitionsTab()
|
|||||||
|
|
||||||
ui->transitionOverridecheckBox->setChecked(
|
ui->transitionOverridecheckBox->setChecked(
|
||||||
switcher->tansitionOverrideOverride);
|
switcher->tansitionOverrideOverride);
|
||||||
|
ui->adjustActiveTransitionType->setChecked(
|
||||||
|
switcher->adjustActiveTransitionType);
|
||||||
|
|
||||||
QSpinBox *defTransitionDelay = new QSpinBox();
|
QSpinBox *defTransitionDelay = new QSpinBox();
|
||||||
defTransitionDelay->setSuffix("ms");
|
defTransitionDelay->setSuffix("ms");
|
||||||
|
|||||||
Reference in New Issue
Block a user