From cb75098a93aa04773ef0726037c07cf5d515d8ce Mon Sep 17 00:00:00 2001 From: Sebastian Beckmann Date: Sat, 23 Aug 2025 13:59:10 +0200 Subject: [PATCH] obs-vst: Use v2 of obs_properties_add_button v1 of obs_properties_add_button will be deprecated soon. Also fixes UNUSED_PARAMETER calls in the callbacks for parameters that are not actually unused, and moves the other ones to the top (as in most of the rest of the project). --- plugins/obs-vst/obs-vst.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/obs-vst/obs-vst.cpp b/plugins/obs-vst/obs-vst.cpp index 1a4eebe0e..6aa003d97 100644 --- a/plugins/obs-vst/obs-vst.cpp +++ b/plugins/obs-vst/obs-vst.cpp @@ -37,6 +37,8 @@ MODULE_EXPORT const char *obs_module_description(void) static bool open_editor_button_clicked(obs_properties_t *props, obs_property_t *property, void *data) { + UNUSED_PARAMETER(property); + VSTPlugin *vstPlugin = (VSTPlugin *)data; if (vstPlugin && vstPlugin->vstLoaded()) { @@ -47,15 +49,13 @@ static bool open_editor_button_clicked(obs_properties_t *props, obs_property_t * obs_property_set_visible(obs_properties_get(props, CLOSE_VST_SETTINGS), true); } - UNUSED_PARAMETER(props); - UNUSED_PARAMETER(property); - UNUSED_PARAMETER(data); - return true; } static bool close_editor_button_clicked(obs_properties_t *props, obs_property_t *property, void *data) { + UNUSED_PARAMETER(property); + VSTPlugin *vstPlugin = (VSTPlugin *)data; if (vstPlugin && vstPlugin->vstLoaded() && vstPlugin->isEditorOpen()) { @@ -66,8 +66,6 @@ static bool close_editor_button_clicked(obs_properties_t *props, obs_property_t obs_property_set_visible(obs_properties_get(props, CLOSE_VST_SETTINGS), false); } - UNUSED_PARAMETER(property); - return true; } @@ -302,8 +300,8 @@ static obs_properties_t *vst_properties(void *data) fill_out_plugins(list); - obs_properties_add_button(props, OPEN_VST_SETTINGS, OPEN_VST_TEXT, open_editor_button_clicked); - obs_properties_add_button(props, CLOSE_VST_SETTINGS, CLOSE_VST_TEXT, close_editor_button_clicked); + obs_properties_add_button2(props, OPEN_VST_SETTINGS, OPEN_VST_TEXT, open_editor_button_clicked, data); + obs_properties_add_button2(props, CLOSE_VST_SETTINGS, CLOSE_VST_TEXT, close_editor_button_clicked, data); bool open_settings_vis = true; bool close_settings_vis = false;