diff --git a/libobs/obs-properties.c b/libobs/obs-properties.c index c2d5a99ec..1533bee5f 100644 --- a/libobs/obs-properties.c +++ b/libobs/obs-properties.c @@ -726,6 +726,30 @@ enum obs_combo_format obs_property_list_format(obs_property_t *p) return data ? data->format : OBS_COMBO_FORMAT_INVALID; } +void obs_property_int_set_limits(obs_property_t *p, + int min, int max, int step) +{ + struct int_data *data = get_type_data(p, OBS_PROPERTY_INT); + if (!data) + return; + + data->min = min; + data->max = max; + data->step = step; +} + +void obs_property_float_set_limits(obs_property_t *p, + double min, double max, double step) +{ + struct float_data *data = get_type_data(p, OBS_PROPERTY_INT); + if (!data) + return; + + data->min = min; + data->max = max; + data->step = step; +} + void obs_property_list_clear(obs_property_t *p) { struct list_data *data = get_list_data(p); diff --git a/libobs/obs-properties.h b/libobs/obs-properties.h index c3b744606..e280ab4a6 100644 --- a/libobs/obs-properties.h +++ b/libobs/obs-properties.h @@ -262,6 +262,11 @@ EXPORT const char * obs_property_path_default_path(obs_property_t *p); EXPORT enum obs_combo_type obs_property_list_type(obs_property_t *p); EXPORT enum obs_combo_format obs_property_list_format(obs_property_t *p); +EXPORT void obs_property_int_set_limits(obs_property_t *p, + int min, int max, int step); +EXPORT void obs_property_float_set_limits(obs_property_t *p, + double min, double max, double step); + EXPORT void obs_property_list_clear(obs_property_t *p); EXPORT size_t obs_property_list_add_string(obs_property_t *p,