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

Method JsonValue

src/effects/Tracker.cpp:163–186  ·  view source on GitHub ↗

Generate Json::Value for this object

Source from the content-addressed store, hash-verified

161
162// Generate Json::Value for this object
163Json::Value Tracker::JsonValue() const {
164
165 // Create root json object
166 Json::Value root = EffectBase::JsonValue(); // get parent properties
167
168 // Save the effect's properties on root
169 root["type"] = info.class_name;
170 root["protobuf_data_path"] = protobuf_data_path;
171 root["BaseFPS"]["num"] = BaseFPS.num;
172 root["BaseFPS"]["den"] = BaseFPS.den;
173 root["TimeScale"] = this->TimeScale;
174
175 // Add trackedObjects IDs to JSON
176 Json::Value objects;
177 for (auto const& trackedObject : trackedObjects){
178 Json::Value trackedObjectJSON = trackedObject.second->JsonValue();
179 // add object json
180 objects[trackedObject.second->Id()] = trackedObjectJSON;
181 }
182 root["objects"] = objects;
183
184 // return JsonValue
185 return root;
186}
187
188// Load JSON string into this object
189void Tracker::SetJson(const std::string value) {

Callers

nothing calls this directly

Calls 1

IdMethod · 0.45

Tested by

no test coverage detected