| 94 | } |
| 95 | |
| 96 | static 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 | |
| 136 | static std::optional<std::string> |
| 137 | getDataJsonWithDefaults(const OBSWeakSource &ws) |
no test coverage detected