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

Method SetJson

src/audio_effects/Compressor.cpp:140–154  ·  view source on GitHub ↗

Load JSON string into this object

Source from the content-addressed store, hash-verified

138
139// Load JSON string into this object
140void Compressor::SetJson(const std::string value) {
141
142 // Parse JSON string into JSON objects
143 try
144 {
145 const Json::Value root = openshot::stringToJson(value);
146 // Set all values that match
147 SetJsonValue(root);
148 }
149 catch (const std::exception& e)
150 {
151 // Error parsing JSON (or missing keys)
152 throw InvalidJSON("JSON is invalid (missing keys or invalid data types)");
153 }
154}
155
156// Load Json::Value into this object
157void Compressor::SetJsonValue(const Json::Value root) {

Callers

nothing calls this directly

Calls 1

InvalidJSONClass · 0.85

Tested by

no test coverage detected