Add/Move helpers to register OBS websocket vendor requests

Adds websocket vendor requests to start and stop the plugin.
Adds vendor events to indicate when the plugin is started or stopped.

These are ntended to be used for the StreamDeck plugin support.
This commit is contained in:
WarmUpTill
2024-09-01 22:15:25 +02:00
committed by WarmUpTill
parent 624b841ca1
commit 91912f2aa5
6 changed files with 201 additions and 69 deletions

View File

@@ -14,6 +14,7 @@
#include "tab-helpers.hpp"
#include "utility.hpp"
#include "version.h"
#include "websocket-api.hpp"
#include <obs-frontend-api.h>
#include <QAction>
@@ -454,6 +455,8 @@ void SwitcherData::Start()
// Will be overwritten quickly but might be useful
writeToStatusFile("Advanced Scene Switcher running");
SendWebsocketVendorEvent("AdvancedSceneSwitcherStarted",
nullptr);
}
if (showSystemTrayNotifications) {
@@ -481,6 +484,10 @@ void SwitcherData::Stop()
delete th;
th = nullptr;
writeToStatusFile("Advanced Scene Switcher stopped");
if (!obsIsShuttingDown) {
SendWebsocketVendorEvent("AdvancedSceneSwitcherStopped",
nullptr);
}
}
if (showSystemTrayNotifications) {