Rework plugin to allow split into module and library part

This is mostly intended to allow easier bundling for MacOS but might
prove to be useful for other areas as well.
This commit is contained in:
WarmUpTill
2022-08-14 02:09:46 +02:00
committed by WarmUpTill
parent aef29d7d82
commit 5ae9e18044
4 changed files with 21 additions and 3 deletions

View File

@@ -14,6 +14,16 @@
#include "headers/utility.hpp"
#include "headers/version.h"
const char *obs_module_text(const char *text)
{
return switcher->translate(text);
}
obs_module_t *obs_current_module()
{
return switcher->modulePtr;
}
SwitcherData *switcher = nullptr;
SwitcherData *GetSwitcher()
{
@@ -673,12 +683,14 @@ void LoadPlugins()
}
}
extern "C" void InitSceneSwitcher()
extern "C" void InitSceneSwitcher(obs_module_t *m, translateFunc t)
{
blog(LOG_INFO, "version: %s", g_GIT_TAG);
blog(LOG_INFO, "version: %s", g_GIT_SHA1);
switcher = new SwitcherData;
switcher->modulePtr = m;
switcher->translate = t;
if (loadCurl() && f_curl_init) {
switcher->curl = f_curl_init();