libobs: Add obs_source_enum_full_tree()

Allows the ability to enumerate all sources and subsources in a source's
hierarchy, regardless of whether they're active or not.
This commit is contained in:
jp9000 2021-04-06 11:50:35 -07:00
parent e39fa5e902
commit 0ecf24d0ed
2 changed files with 8 additions and 4 deletions

View file

@ -4003,14 +4003,14 @@ static void enum_source_full_tree_callback(obs_source_t *parent,
data->enum_callback(parent, child, data->param);
}
static void obs_source_enum_full_tree(obs_source_t *source,
obs_source_enum_proc_t enum_callback,
void *param)
void obs_source_enum_full_tree(obs_source_t *source,
obs_source_enum_proc_t enum_callback,
void *param)
{
struct source_enum_data data = {enum_callback, param};
bool is_transition;
if (!data_valid(source, "obs_source_enum_active_tree"))
if (!data_valid(source, "obs_source_enum_full_tree"))
return;
is_transition = source->info.type == OBS_SOURCE_TYPE_TRANSITION;

View file

@ -1031,6 +1031,10 @@ EXPORT void obs_source_enum_active_tree(obs_source_t *source,
obs_source_enum_proc_t enum_callback,
void *param);
EXPORT void obs_source_enum_full_tree(obs_source_t *source,
obs_source_enum_proc_t enum_callback,
void *param);
/** Returns true if active, false if not */
EXPORT bool obs_source_active(const obs_source_t *source);