mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
beadb56b05 | |||
745fb5ea29 | |||
58434cac3b | |||
c34dff17ff |
@ -635,7 +635,7 @@
|
||||
<key>OVERWRITE_PERMISSIONS</key>
|
||||
<false/>
|
||||
<key>VERSION</key>
|
||||
<string>4.3.0</string>
|
||||
<string>4.3.1</string>
|
||||
</dict>
|
||||
<key>PROJECT_COMMENTS</key>
|
||||
<dict>
|
||||
|
@ -2,8 +2,8 @@
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "obs-websocket"
|
||||
#define MyAppVersion "4.3.0"
|
||||
#define MyAppPublisher "St<EFBFBD>phane Lepin"
|
||||
#define MyAppVersion "4.3.1"
|
||||
#define MyAppPublisher "Stephane Lepin"
|
||||
#define MyAppURL "http://github.com/Palakis/obs-websocket"
|
||||
|
||||
[Setup]
|
||||
|
@ -84,8 +84,8 @@ WSEvents::WSEvents(WSServer* srv) {
|
||||
connect(sceneList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
|
||||
this, SLOT(SelectedSceneChanged(QListWidgetItem*, QListWidgetItem*)));
|
||||
|
||||
transitionHandler = nullptr;
|
||||
sceneHandler = nullptr;
|
||||
currentScene = nullptr;
|
||||
currentTransition = nullptr;
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(deferredInitOperations()));
|
||||
|
||||
@ -187,6 +187,8 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private
|
||||
owner->OnStudioModeSwitched(false);
|
||||
}
|
||||
else if (event == OBS_FRONTEND_EVENT_EXIT) {
|
||||
owner->connectSceneSignals(nullptr);
|
||||
owner->connectTransitionSignals(nullptr);
|
||||
owner->OnExit();
|
||||
}
|
||||
}
|
||||
@ -221,42 +223,60 @@ void WSEvents::broadcastUpdate(const char* updateType,
|
||||
}
|
||||
|
||||
void WSEvents::connectTransitionSignals(obs_source_t* transition) {
|
||||
if (transitionHandler) {
|
||||
signal_handler_disconnect(transitionHandler,
|
||||
signal_handler_t* sh = nullptr;
|
||||
|
||||
if (currentTransition) {
|
||||
sh = obs_source_get_signal_handler(currentTransition);
|
||||
signal_handler_disconnect(sh,
|
||||
"transition_start", OnTransitionBegin, this);
|
||||
}
|
||||
|
||||
if (!transitionIsCut(transition)) {
|
||||
transitionHandler = obs_source_get_signal_handler(transition);
|
||||
signal_handler_connect(transitionHandler,
|
||||
"transition_start", OnTransitionBegin, this);
|
||||
} else {
|
||||
transitionHandler = nullptr;
|
||||
currentTransition = transition;
|
||||
|
||||
if (currentTransition) {
|
||||
if (!transitionIsCut(transition)) {
|
||||
currentTransition = transition;
|
||||
|
||||
sh = obs_source_get_signal_handler(currentTransition);
|
||||
signal_handler_connect(sh,
|
||||
"transition_start", OnTransitionBegin, this);
|
||||
}
|
||||
else {
|
||||
currentTransition = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WSEvents::connectSceneSignals(obs_source_t* scene) {
|
||||
if (sceneHandler) {
|
||||
signal_handler_disconnect(sceneHandler,
|
||||
signal_handler_t* sh = nullptr;
|
||||
|
||||
if (currentScene) {
|
||||
sh = obs_source_get_signal_handler(currentScene);
|
||||
|
||||
signal_handler_disconnect(sh,
|
||||
"reorder", OnSceneReordered, this);
|
||||
signal_handler_disconnect(sceneHandler,
|
||||
signal_handler_disconnect(sh,
|
||||
"item_add", OnSceneItemAdd, this);
|
||||
signal_handler_disconnect(sceneHandler,
|
||||
signal_handler_disconnect(sh,
|
||||
"item_remove", OnSceneItemDelete, this);
|
||||
signal_handler_disconnect(sceneHandler,
|
||||
signal_handler_disconnect(sh,
|
||||
"item_visible", OnSceneItemVisibilityChanged, this);
|
||||
}
|
||||
|
||||
// TODO : connect to all scenes, not just the current one.
|
||||
sceneHandler = obs_source_get_signal_handler(scene);
|
||||
signal_handler_connect(sceneHandler,
|
||||
"reorder", OnSceneReordered, this);
|
||||
signal_handler_connect(sceneHandler,
|
||||
"item_add", OnSceneItemAdd, this);
|
||||
signal_handler_connect(sceneHandler,
|
||||
"item_remove", OnSceneItemDelete, this);
|
||||
signal_handler_connect(sceneHandler,
|
||||
"item_visible", OnSceneItemVisibilityChanged, this);
|
||||
currentScene = scene;
|
||||
|
||||
if (currentScene) {
|
||||
// TODO : connect to all scenes, not just the current one.
|
||||
sh = obs_source_get_signal_handler(currentScene);
|
||||
signal_handler_connect(sh,
|
||||
"reorder", OnSceneReordered, this);
|
||||
signal_handler_connect(sh,
|
||||
"item_add", OnSceneItemAdd, this);
|
||||
signal_handler_connect(sh,
|
||||
"item_remove", OnSceneItemDelete, this);
|
||||
signal_handler_connect(sh,
|
||||
"item_visible", OnSceneItemVisibilityChanged, this);
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t WSEvents::GetStreamingTime() {
|
||||
@ -335,8 +355,8 @@ void WSEvents::OnSceneListChange() {
|
||||
void WSEvents::OnSceneCollectionChange() {
|
||||
broadcastUpdate("SceneCollectionChanged");
|
||||
|
||||
sceneHandler = nullptr;
|
||||
transitionHandler = nullptr;
|
||||
currentScene = nullptr;
|
||||
currentTransition = nullptr;
|
||||
|
||||
OnTransitionListChange();
|
||||
OnTransitionChange();
|
||||
|
@ -53,8 +53,8 @@ class WSEvents : public QObject {
|
||||
|
||||
private:
|
||||
WSServer* _srv;
|
||||
signal_handler_t* transitionHandler;
|
||||
signal_handler_t* sceneHandler;
|
||||
OBSSource currentScene;
|
||||
OBSSource currentTransition;
|
||||
|
||||
bool pulse;
|
||||
|
||||
|
@ -39,7 +39,7 @@ using OBSOutputAutoRelease =
|
||||
OBSRef<obs_output_t*, ___output_dummy_addref, obs_output_release>;
|
||||
|
||||
#define PROP_AUTHENTICATED "wsclient_authenticated"
|
||||
#define OBS_WEBSOCKET_VERSION "4.3.0"
|
||||
#define OBS_WEBSOCKET_VERSION "4.3.1"
|
||||
|
||||
#define blog(level, msg, ...) blog(level, "[obs-websocket] " msg, ##__VA_ARGS__)
|
||||
|
||||
|
Reference in New Issue
Block a user