Skip to content

Commit

Permalink
tiny refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
royshil committed Dec 15, 2023
1 parent 937d542 commit 740869e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/background-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,19 @@ static bool enable_advanced_settings(obs_properties_t *ppts, obs_property_t *p,
const bool enabled = obs_data_get_bool(settings, "advanced");
p = obs_properties_get(ppts, "blur_background");
obs_property_set_visible(p, true);
if (!enabled) {
for (const char *prop_name :
{"threshold_group", "enable_threshold"}) {
p = obs_properties_get(ppts, prop_name);
obs_property_set_visible(p, false);
}
} else {
enable_threshold_modified(ppts, p, settings);
enable_focal_blur(ppts, p, settings);
}

for (const char *prop_name :
{"model_select", "useGPU", "mask_every_x_frames", "numThreads",
"enable_focal_blur", "enable_threshold"}) {
p = obs_properties_get(ppts, prop_name);
obs_property_set_visible(p, enabled);
}

if (enabled) {
enable_threshold_modified(ppts, p, settings);
enable_focal_blur(ppts, p, settings);
}

return true;
}

Expand Down

0 comments on commit 740869e

Please sign in to comment.