From 2a4e86d8daf5776571771146ec47435ab454aa9f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 21 Nov 2021 02:50:41 -0800 Subject: [PATCH] Base: Add more module exports + code cleanup --- data/locale/en-US.ini | 2 ++ src/obs-websocket.cpp | 29 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index e12e3b42..6b97535b 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -1,3 +1,5 @@ +OBSWebSocket.Plugin.Description="Remote-control of OBS Studio through WebSocket" + OBSWebSocket.Settings.DialogTitle="obs-websocket Settings" OBSWebSocket.Settings.PluginSettingsTitle="Plugin Settings" diff --git a/src/obs-websocket.cpp b/src/obs-websocket.cpp index 45fbc46f..661a4109 100644 --- a/src/obs-websocket.cpp +++ b/src/obs-websocket.cpp @@ -17,11 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see */ -#include -#include -#include +#include +#include #include -#include #include #include "obs-websocket.h" @@ -33,6 +31,9 @@ with this program. If not, see OBS_DECLARE_MODULE() OBS_MODULE_USE_DEFAULT_LOCALE("obs-websocket", "en-US") +OBS_MODULE_AUTHOR("OBSProject") +const char *obs_module_name(void) { return "obs-websocket"; } +const char *obs_module_description(void) { return obs_module_text("OBSWebSocket.Plugin.Description"); } ConfigPtr _config; WebSocketApiPtr _webSocketApi; @@ -41,16 +42,6 @@ EventHandlerPtr _eventHandler; SettingsDialog *_settingsDialog = nullptr; os_cpu_usage_info_t* _cpuUsageInfo; -void ___source_dummy_addref(obs_source_t*) {} -void ___scene_dummy_addref(obs_scene_t*) {} -void ___sceneitem_dummy_addref(obs_sceneitem_t*) {} -void ___data_dummy_addref(obs_data_t*) {} -void ___data_array_dummy_addref(obs_data_array_t*) {} -void ___output_dummy_addref(obs_output_t*) {} -void ___data_item_dummy_addref(obs_data_item_t*) {} -void ___data_item_release(obs_data_item_t* dataItem){ obs_data_item_release(&dataItem); } -void ___properties_dummy_addref(obs_properties_t*) {} - void WebSocketApiEventCallback(std::string vendorName, std::string eventType, obs_data_t *obsEventData); bool obs_module_load(void) @@ -149,3 +140,13 @@ void WebSocketApiEventCallback(std::string vendorName, std::string eventType, ob _webSocketServer->BroadcastEvent(EventSubscription::ExternalPlugins, "ExternalPluginEvent", broadcastEventData); } + +void ___source_dummy_addref(obs_source_t*) {} +void ___scene_dummy_addref(obs_scene_t*) {} +void ___sceneitem_dummy_addref(obs_sceneitem_t*) {} +void ___data_dummy_addref(obs_data_t*) {} +void ___data_array_dummy_addref(obs_data_array_t*) {} +void ___output_dummy_addref(obs_output_t*) {} +void ___data_item_dummy_addref(obs_data_item_t*) {} +void ___data_item_release(obs_data_item_t* dataItem){ obs_data_item_release(&dataItem); } +void ___properties_dummy_addref(obs_properties_t*) {}