From 11c7e07eac92c74662e27e321685ad6ff5dd2327 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 27 Jul 2014 12:48:14 -0700 Subject: [PATCH] Add extra search path for third party plugins The OBSBasic UI will now allow the use of a subdirectory of the user application data directory for third-party plugins. Though I'm not entirely sure if this ideal or not. Regardless, this is one of the first (of many) steps towards a plugin manager. On windows, this is %appdata%/obs-studio/plugins On linux, this is ~/.obs-studio/plugins On mac, this is ~/Library/Application Support/obs-sudio/plugins --- obs/window-basic-main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 1bad5943b..866f0edb4 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -57,6 +57,16 @@ Q_DECLARE_METATYPE(OBSScene); Q_DECLARE_METATYPE(OBSSceneItem); Q_DECLARE_METATYPE(order_movement); +static void AddExtraModulePaths() +{ + BPtr base_module_dir = os_get_config_path("plugins/%module%"); + if (!base_module_dir) + return; + + string path = (char*)base_module_dir; + obs_add_module_path((path + "/bin").c_str(), (path + "/data").c_str()); +} + OBSBasic::OBSBasic(QWidget *parent) : OBSMainWindow (parent), ui (new Ui::OBSBasic) @@ -534,6 +544,7 @@ void OBSBasic::OBSInit() InitOBSCallbacks(); + AddExtraModulePaths(); obs_load_all_modules(); if (!InitOutputs())