28 #include "../include/ClipBase.h" 39 root[
"layer"] =
Layer();
40 root[
"start"] =
Start();
52 if (!root[
"id"].isNull())
53 Id(root[
"id"].asString());
54 if (!root[
"position"].isNull())
55 Position(root[
"position"].asDouble());
56 if (!root[
"layer"].isNull())
57 Layer(root[
"layer"].asInt());
58 if (!root[
"start"].isNull())
59 Start(root[
"start"].asDouble());
60 if (!root[
"end"].isNull())
61 End(root[
"end"].asDouble());
65 Json::Value
ClipBase::add_property_json(
string name,
float value,
string type,
string memo,
bool contains_point,
int number_of_points,
float min_value,
float max_value,
InterpolationType intepolation,
int closest_point_x,
bool readonly) {
68 Json::Value prop = Json::Value(Json::objectValue);
70 prop[
"value"] = value;
73 prop[
"min"] = min_value;
74 prop[
"max"] = max_value;
75 prop[
"keyframe"] = contains_point;
76 prop[
"points"] = number_of_points;
77 prop[
"readonly"] = readonly;
78 prop[
"interpolation"] = intepolation;
79 prop[
"closest_point_x"] = closest_point_x;
80 prop[
"choices"] = Json::Value(Json::arrayValue);
89 Json::Value new_choice = Json::Value(Json::objectValue);
90 new_choice[
"name"] = name;
91 new_choice[
"value"] = value;
92 new_choice[
"selected"] = (value == selected_value);
float End()
Get end position (in seconds) of clip (trim end of video)
int Layer()
Get layer of clip on timeline (lower number is covered by higher numbers)
virtual void SetJsonValue(Json::Value root)=0
Load Json::JsonValue into this object.
Json::Value add_property_choice_json(string name, int value, int selected_value)
Generate JSON choice for a property (dropdown properties)
Json::Value add_property_json(string name, float value, string type, string memo, bool contains_point, int number_of_points, float min_value, float max_value, InterpolationType intepolation, int closest_point_x, bool readonly)
Generate JSON for a property.
string Id()
Get basic properties.
float Position()
Get position on timeline (in seconds)
InterpolationType
This controls how a Keyframe uses this point to interpolate between two points.
This namespace is the default namespace for all code in the openshot library.
virtual Json::Value JsonValue()=0
Generate Json::JsonValue for this object.
float Duration()
Get the length of this clip (in seconds)
float Start()
Get start position (in seconds) of clip (trim start of video)