31 #include "../include/EffectBase.h" 53 std::cout << std::fixed << std::setprecision(2) << std::boolalpha;
54 std::cout <<
"----------------------------" << std::endl;
55 std::cout <<
"----- Effect Information -----" << std::endl;
56 std::cout <<
"----------------------------" << std::endl;
57 std::cout <<
"--> Name: " <<
info.
name << std::endl;
59 std::cout <<
"--> Has Video: " <<
info.
has_video << std::endl;
60 std::cout <<
"--> Has Audio: " <<
info.
has_audio << std::endl;
61 std::cout <<
"----------------------------" << std::endl;
70 else if (color_value > 255)
93 root[
"order"] =
Order();
104 Json::CharReaderBuilder rbuilder;
105 Json::CharReader* reader(rbuilder.newCharReader());
108 bool success = reader->parse( value.c_str(),
109 value.c_str() + value.size(), &root, &errors );
114 throw InvalidJSON(
"JSON could not be parsed (or is invalid)");
121 catch (
const std::exception& e)
124 throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)");
135 if (!root[
"order"].isNull())
136 Order(root[
"order"].asInt());
void DisplayInfo()
Display effect information in the standard output stream (stdout)
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)
Json::Value JsonInfo()
Generate JSON object of meta data / info.
virtual Json::Value JsonValue()=0
Generate Json::JsonValue for this object.
bool has_audio
Determines if this effect manipulates the audio of a frame.
virtual void SetJsonValue(Json::Value root)=0
Load Json::JsonValue into this object.
float Position()
Get position on timeline (in seconds)
virtual void SetJsonValue(Json::Value root)=0
Load Json::JsonValue into this object.
std::string class_name
The class name of the effect.
std::string name
The name of the effect.
This namespace is the default namespace for all code in the openshot library.
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.
int constrain(int color_value)
Constrain a color value from 0 to 255.
virtual void SetJson(std::string value)=0
Load JSON string into this object.
virtual Json::Value JsonValue()=0
Generate Json::JsonValue for this object.
int Order()
Get the order that this effect should be executed.
float Start()
Get start position (in seconds) of clip (trim start of video)
EffectInfoStruct info
Information about the current effect.
virtual std::string Json()=0
Get and Set JSON methods.