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

Method SetJsonValue

src/KeyFrame.cpp:372–396  ·  view source on GitHub ↗

Load Json::Value into this object

Source from the content-addressed store, hash-verified

370
371// Load Json::Value into this object
372void Keyframe::SetJsonValue(const Json::Value root) {
373 // Clear existing points
374 Points.clear();
375 Points.shrink_to_fit();
376
377 if (root.isObject() && !root["Points"].isNull()) {
378 // loop through points in JSON Object
379 for (const auto existing_point : root["Points"]) {
380 // Create Point
381 Point p;
382
383 // Load Json into Point
384 p.SetJsonValue(existing_point);
385
386 // Add Point to Keyframe
387 AddPoint(p);
388 }
389 } else if (root.isNumeric()) {
390 // Create Point from Numeric value
391 Point p(root.asFloat());
392
393 // Add Point to Keyframe
394 AddPoint(p);
395 }
396}
397
398// Get the change in Y value (from the previous Y value)
399double Keyframe::GetDelta(int64_t index) const {

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected