From 32ca251bb008eed48fe69eb7a931c0c593dba877 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 3 Jan 2015 07:36:28 -0800 Subject: [PATCH] libobs: Add obs_property_set_description This allows us to change the visible UI name of a property after it's been created (particularly for a case where I want to change an 'Activate' button to 'Deactivate') --- libobs/obs-properties.c | 5 +++++ libobs/obs-properties.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/libobs/obs-properties.c b/libobs/obs-properties.c index 70ce519b0..5a81ba67d 100644 --- a/libobs/obs-properties.c +++ b/libobs/obs-properties.c @@ -461,6 +461,11 @@ void obs_property_set_enabled(obs_property_t *p, bool enabled) if (p) p->enabled = enabled; } +void obs_property_set_description(obs_property_t *p, const char *description) +{ + if (p) p->desc = description; +} + const char *obs_property_name(obs_property_t *p) { return p ? p->name : NULL; diff --git a/libobs/obs-properties.h b/libobs/obs-properties.h index b58105daf..f623cd2a4 100644 --- a/libobs/obs-properties.h +++ b/libobs/obs-properties.h @@ -193,6 +193,9 @@ EXPORT bool obs_property_button_clicked(obs_property_t *p, void *obj); EXPORT void obs_property_set_visible(obs_property_t *p, bool visible); EXPORT void obs_property_set_enabled(obs_property_t *p, bool enabled); +EXPORT void obs_property_set_description(obs_property_t *p, + const char *description); + EXPORT const char * obs_property_name(obs_property_t *p); EXPORT const char * obs_property_description(obs_property_t *p); EXPORT enum obs_property_type obs_property_get_type(obs_property_t *p);