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

Function getDataJsonWithDefaults

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

Source from the content-addressed store, hash-verified

134}
135
136static std::optional<std::string>
137getDataJsonWithDefaults(const OBSWeakSource &ws)
138{
139 OBSSourceAutoRelease source = obs_weak_source_get_source(ws);
140 OBSDataAutoRelease data = obs_source_get_settings(source);
141 if (!data) {
142 return {};
143 }
144 OBSDataAutoRelease dataWithDefaults = obs_data_get_defaults(data);
145 obs_data_apply(dataWithDefaults, data);
146 auto json = obs_data_get_json(dataWithDefaults);
147 if (!json) {
148 return {};
149 }
150 return json;
151}
152
153std::optional<std::string> GetSourceSettingValue(const OBSWeakSource &source,
154 const SourceSetting &setting)

Callers 2

GetSourceSettingValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected