61 std::cout << std::fixed << std::setprecision(2) << std::boolalpha;
62 std::cout <<
"----------------------------" << std::endl;
63 std::cout <<
"----- Effect Information -----" << std::endl;
64 std::cout <<
"----------------------------" << std::endl;
65 std::cout <<
"--> Name: " <<
info.
name << std::endl;
67 std::cout <<
"--> Has Video: " <<
info.
has_video << std::endl;
68 std::cout <<
"--> Has Audio: " <<
info.
has_audio << std::endl;
69 std::cout <<
"----------------------------" << std::endl;
78 else if (color_value > 255)
103 root[
"order"] =
Order();
119 catch (
const std::exception& e)
122 throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)");
134 std::list<EffectBase*> effects = parentTimeline->
ClipEffects();
139 for (
auto const& effect : effects){
141 if ((effect->info.parent_effect_id == this->Id()) && (effect->Id() != this->
Id()))
142 effect->SetJsonValue(root);
150 my_root[
"id"] = this->
Id();
160 if (!my_root[
"order"].isNull())
161 Order(my_root[
"order"].asInt());
163 if (!my_root[
"parent_effect_id"].isNull()){
208 if (parentEffectPtr){
214 EffectJSON[
"id"] = this->
Id();
virtual void SetJson(const std::string value)
Load JSON string into this object.
This abstract class is the base class, used by all effects in libopenshot.
std::string Id() const
Get the Id of this clip object.
float Start() const
Get start position (in seconds) of clip (trim start of video)
virtual void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
void DisplayInfo()
Display effect information in the standard output stream (stdout)
openshot::ClipBase * clip
Pointer to the parent clip instance (if any)
EffectBase * parentEffect
Parent effect (which properties will set this effect properties)
const Json::Value stringToJson(const std::string value)
virtual Json::Value JsonValue() const
Generate Json::Value for this object.
Header file for Timeline class.
virtual Json::Value JsonValue() const =0
Generate Json::Value for this object.
Json::Value JsonInfo() const
Generate JSON object of meta data / info.
virtual void SetJsonValue(const Json::Value root)=0
Load Json::Value into this object.
bool has_audio
Determines if this effect manipulates the audio of a frame.
Header file for all Exception classes.
openshot::ClipBase * ParentClip()
Parent clip object of this effect (which can be unparented and NULL)
std::string ParentClipId() const
Return the ID of this effect's parent clip.
openshot::EffectBase * GetClipEffect(const std::string &id)
Look up a clip effect by ID.
std::list< openshot::EffectBase * > ClipEffects() const
Return the list of effects on all clips.
This abstract class is the base class, used by all clips in libopenshot.
bool has_tracked_object
Determines if this effect track objects through the clip.
std::string class_name
The class name of the effect.
std::string name
The name of the effect.
int Order() const
Get the order that this effect should be executed.
virtual std::string Json() const
Generate JSON string of this object.
This namespace is the default namespace for all code in the openshot library.
Header file for EffectBase class.
std::string description
The description of this effect and what it does.
bool has_video
Determines if this effect manipulates the image of a frame.
Exception for invalid JSON.
openshot::TimelineBase * ParentTimeline()
Get the associated Timeline pointer (if any)
int constrain(int color_value)
Constrain a color value from 0 to 255.
std::string parent_effect_id
Id of the parent effect (if there is one)
float Position() const
Get position on timeline (in seconds)
float End() const
Get end position (in seconds) of clip (trim end of video)
void SetParentEffect(std::string parentEffect_id)
Set the parent effect from which this properties will be set to.
int Layer() const
Get layer of clip on timeline (lower number is covered by higher numbers)
EffectInfoStruct info
Information about the current effect.
This class represents a timeline.