MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetJson

Method SetJson

src/audio_effects/Distortion.cpp:179–193  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

177
178// Load JSON string into this object
179void Distortion::SetJson(const std::string value) {
180
181 // Parse JSON string into JSON objects
182 try
183 {
184 const Json::Value root = openshot::stringToJson(value);
185 // Set all values that match
186 SetJsonValue(root);
187 }
188 catch (const std::exception& e)
189 {
190 // Error parsing JSON (or missing keys)
191 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
192 }
193}
194
195// Load Json::Value into this object
196void Distortion::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected