MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / addSettingsHelper

Function addSettingsHelper

plugins/base/utils/source-setting.cpp:96–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96static void addSettingsHelper(obs_property_t *property,
97 std::vector<SourceSetting> &settings,
98 const std::string &prefix = "")
99{
100 do {
101 if (!property) {
102 continue;
103 }
104 const auto type = obs_property_get_type(property);
105 if (type == OBS_PROPERTY_GROUP) {
106 auto group = obs_property_group_content(property);
107 auto description = obs_property_description(property);
108 std::string prefix =
109 description
110 ? std::string("[") + description + "] "
111 : "";
112 addSettingsHelper(obs_properties_first(group), settings,
113 prefix);
114 continue;
115 }
116
117 auto name = obs_property_name(property);
118 if (!name) {
119 continue;
120 }
121 auto description = obs_property_description(property);
122 if (!description) {
123 continue;
124 }
125 std::string descriptionWithPrefixAndSuffix =
126 prefix + description +
127 obs_module_text(getPropertySuffix(type));
128 auto longDescription = obs_property_long_description(property);
129 SourceSetting setting(name, type,
130 descriptionWithPrefixAndSuffix,
131 longDescription ? longDescription : "");
132 settings.emplace_back(setting);
133 } while (obs_property_next(&property));
134}
135
136static std::optional<std::string>
137getDataJsonWithDefaults(const OBSWeakSource &ws)

Callers 1

getSourceSettingsFunction · 0.85

Calls 2

obs_module_textFunction · 0.85
getPropertySuffixFunction · 0.85

Tested by

no test coverage detected