Load Json::Value into this object
| 422 | |
| 423 | // Load Json::Value into this object |
| 424 | void Caption::SetJsonValue(const Json::Value root) { |
| 425 | |
| 426 | // Set parent data |
| 427 | EffectBase::SetJsonValue(root); |
| 428 | |
| 429 | // Set data from Json (if key is found) |
| 430 | if (!root["color"].isNull()) |
| 431 | color.SetJsonValue(root["color"]); |
| 432 | if (!root["stroke"].isNull()) |
| 433 | stroke.SetJsonValue(root["stroke"]); |
| 434 | if (!root["background"].isNull()) |
| 435 | background.SetJsonValue(root["background"]); |
| 436 | if (!root["background_alpha"].isNull()) |
| 437 | background_alpha.SetJsonValue(root["background_alpha"]); |
| 438 | if (!root["background_corner"].isNull()) |
| 439 | background_corner.SetJsonValue(root["background_corner"]); |
| 440 | if (!root["background_padding"].isNull()) |
| 441 | background_padding.SetJsonValue(root["background_padding"]); |
| 442 | if (!root["stroke_width"].isNull()) |
| 443 | stroke_width.SetJsonValue(root["stroke_width"]); |
| 444 | if (!root["font_size"].isNull()) |
| 445 | font_size.SetJsonValue(root["font_size"]); |
| 446 | if (!root["font_alpha"].isNull()) |
| 447 | font_alpha.SetJsonValue(root["font_alpha"]); |
| 448 | if (!root["fade_in"].isNull()) |
| 449 | fade_in.SetJsonValue(root["fade_in"]); |
| 450 | if (!root["fade_out"].isNull()) |
| 451 | fade_out.SetJsonValue(root["fade_out"]); |
| 452 | if (!root["line_spacing"].isNull()) |
| 453 | line_spacing.SetJsonValue(root["line_spacing"]); |
| 454 | if (!root["left"].isNull()) |
| 455 | left.SetJsonValue(root["left"]); |
| 456 | if (!root["top"].isNull()) |
| 457 | top.SetJsonValue(root["top"]); |
| 458 | if (!root["right"].isNull()) |
| 459 | right.SetJsonValue(root["right"]); |
| 460 | if (!root["caption_text"].isNull()) |
| 461 | caption_text = root["caption_text"].asString(); |
| 462 | if (!root["caption_font"].isNull()) |
| 463 | font_name = root["caption_font"].asString(); |
| 464 | |
| 465 | // Mark effect as dirty to reparse Regex |
| 466 | is_dirty = true; |
| 467 | } |
| 468 | |
| 469 | // Get all properties for a specific frame |
| 470 | std::string Caption::PropertiesJSON(int64_t requested_frame) const { |
nothing calls this directly
no outgoing calls
no test coverage detected