Skip to content

Commit 7062ab0

Browse files
committed
Add setting group support to move action filter
1 parent 3be3a85 commit 7062ab0

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

move-action-filter.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,23 @@ static void add_filter_to_prop_list(obs_source_t *parent, obs_source_t *child, v
631631
obs_property_list_add_string(p, name, name);
632632
}
633633

634+
static void add_properties_to_list(obs_properties_t* ps, obs_property_t* list) {
635+
obs_property_t *p = obs_properties_first(ps);
636+
for (; p != NULL; obs_property_next(&p)) {
637+
enum obs_property_type pt = obs_property_get_type(p);
638+
if (pt == OBS_PROPERTY_GROUP) {
639+
if (obs_property_group_type(p) == OBS_GROUP_CHECKABLE)
640+
obs_property_list_add_string(list, obs_property_description(p), obs_property_name(p));
641+
add_properties_to_list(obs_property_group_content(p), list);
642+
} else if (pt == OBS_PROPERTY_TEXT){
643+
if (obs_property_text_type(p) != OBS_TEXT_INFO)
644+
obs_property_list_add_string(list, obs_property_description(p), obs_property_name(p));
645+
} else {
646+
obs_property_list_add_string(list, obs_property_description(p), obs_property_name(p));
647+
}
648+
}
649+
}
650+
634651
static bool move_action_source_changed(void *data, obs_properties_t *props, obs_property_t *property, obs_data_t *settings)
635652
{
636653
UNUSED_PARAMETER(data);
@@ -649,10 +666,7 @@ static bool move_action_source_changed(void *data, obs_properties_t *props, obs_
649666
f = source;
650667
obs_property_list_add_string(filter, "", "");
651668
obs_properties_t *ps = obs_source_properties(f);
652-
obs_property_t *p = obs_properties_first(ps);
653-
for (; p != NULL; obs_property_next(&p)) {
654-
obs_property_list_add_string(setting, obs_property_description(p), obs_property_name(p));
655-
}
669+
add_properties_to_list(ps, setting);
656670
obs_properties_destroy(ps);
657671
}
658672
if (source)
@@ -792,7 +806,7 @@ static bool move_action_setting_changed(void *data, obs_properties_t *props, obs
792806
obs_properties_destroy(ps);
793807
obs_source_release(source);
794808

795-
obs_property_set_visible(enable, setting_type == OBS_PROPERTY_BOOL);
809+
obs_property_set_visible(enable, setting_type == OBS_PROPERTY_BOOL || setting_type == OBS_PROPERTY_GROUP);
796810
obs_property_set_visible(value_double, setting_type == OBS_PROPERTY_FLOAT);
797811
obs_property_set_visible(value_int, setting_type == OBS_PROPERTY_INT);
798812
obs_property_set_visible(value_color, setting_type == OBS_PROPERTY_COLOR || setting_type == OBS_PROPERTY_COLOR_ALPHA);

0 commit comments

Comments
 (0)