OpenShot Library | libopenshot
0.4.0
|
Go to the documentation of this file.
23 if (ParentTimeline()) {
34 if (ParentTimeline()) {
45 if (ParentTimeline()) {
56 if (ParentTimeline()) {
70 root[
"layer"] =
Layer();
71 root[
"start"] =
Start();
73 root[
"duration"] = Duration();
83 if (!root[
"id"].isNull())
84 Id(root[
"id"].asString());
85 if (!root[
"position"].isNull())
86 Position(root[
"position"].asDouble());
87 if (!root[
"layer"].isNull())
88 Layer(root[
"layer"].asInt());
89 if (!root[
"start"].isNull())
90 Start(root[
"start"].asDouble());
91 if (!root[
"end"].isNull())
92 End(root[
"end"].asDouble());
96 Json::Value
ClipBase::add_property_json(std::string name,
float value, std::string type, std::string memo,
const Keyframe* keyframe,
float min_value,
float max_value,
bool readonly, int64_t requested_frame)
const {
99 const Point requested_point(requested_frame, requested_frame);
102 Json::Value prop = Json::Value(Json::objectValue);
104 prop[
"value"] = value;
107 prop[
"min"] = min_value;
108 prop[
"max"] = max_value;
110 prop[
"keyframe"] = keyframe->
Contains(requested_point);
111 prop[
"points"] = int(keyframe->
GetCount());
114 prop[
"closest_point_x"] = closest_point.
co.
X;
118 prop[
"keyframe"] =
false;
121 prop[
"closest_point_x"] = -1;
122 prop[
"previous_point_x"] = -1;
125 prop[
"readonly"] = readonly;
126 prop[
"choices"] = Json::Value(Json::arrayValue);
135 Json::Value new_choice = Json::Value(Json::objectValue);
136 new_choice[
"name"] = name;
137 new_choice[
"value"] = value;
138 new_choice[
"selected"] = (value == selected_value);
Json::Value add_property_json(std::string name, float value, std::string type, std::string memo, const Keyframe *keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame) const
Generate JSON for a property.
InterpolationType interpolation
This is the interpolation mode.
virtual void End(float value)
Set end position (in seconds) of clip (trim end of video)
This namespace is the default namespace for all code in the openshot library.
Coordinate co
This is the primary coordinate.
Json::Value add_property_choice_json(std::string name, int value, int selected_value) const
Generate JSON choice for a property (dropdown properties)
Header file for Timeline class.
bool Contains(Point p) const
Does this keyframe contain a specific point.
void Position(float value)
Set the Id of this clip object
virtual void SetJsonValue(const Json::Value root)=0
Load Json::Value into this object.
virtual Json::Value JsonValue() const =0
Generate Json::Value for this object.
float position
The position on the timeline where this clip should start playing.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
This class represents a timeline.
float end
The position in seconds to end playing (used to trim the ending of a clip)
void Start(float value)
Set start position (in seconds) of clip (trim start of video)
float start
The position in seconds to start playing (used to trim the beginning of a clip)
Point GetClosestPoint(Point p) const
Get current point (or closest point to the right) from the X coordinate (i.e. the frame number)
int layer
The layer this clip is on. Lower clips are covered up by higher clips.
void SortTimeline()
Sort all clips and effects on timeline - which affects the internal order of clips and effects arrays...
void Id(std::string value)
int64_t GetCount() const
Get the number of points (i.e. # of points)
@ CONSTANT
Constant curves jump from their previous position to a new one (with no interpolation).
Point GetPreviousPoint(Point p) const
Get previous point (.
void Layer(int value)
Set layer of clip on timeline (lower number is covered by higher numbers)
Header file for ClipBase class.
A Point is the basic building block of a key-frame curve.
double X
The X value of the coordinate (usually representing the frame #)