MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / registerWebsocketVendor

Function registerWebsocketVendor

lib/utils/websocket-api.cpp:51–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static void registerWebsocketVendor()
52{
53 vendor = obs_websocket_register_vendor(VendorName);
54 if (!vendor) {
55 blog(LOG_ERROR,
56 "Vendor registration failed! (obs-websocket should have logged something if installed properly.)");
57 return;
58 }
59
60 auto api_version = obs_websocket_get_api_version();
61 if (api_version == 0) {
62 blog(LOG_ERROR,
63 "Unable to fetch obs-websocket plugin API version.");
64 return;
65 } else if (api_version == 1) {
66 blog(LOG_WARNING,
67 "Unsupported obs-websocket plugin API version for calling requests.");
68 return;
69 }
70
71 registerWebsocketVendorRequest(VendorRequestStart,
72 [](obs_data_t *, obs_data_t *, void *) {
73 StartPlugin();
74 });
75 registerWebsocketVendorRequest(VendorRequestStop,
76 [](obs_data_t *, obs_data_t *, void *) {
77 StopPlugin();
78 });
79 registerWebsocketVendorRequest(
80 VendorRequestStatus,
81 [](obs_data_t *, obs_data_t *response, void *) {
82 obs_data_set_bool(response, "isRunning",
83 PluginIsRunning());
84 });
85}
86
87const char *GetWebsocketVendorName()
88{

Callers

nothing calls this directly

Calls 6

StartPluginFunction · 0.70
StopPluginFunction · 0.70
PluginIsRunningFunction · 0.70

Tested by

no test coverage detected