31 #ifndef OPENSHOT_CLIPBASE_H 32 #define OPENSHOT_CLIPBASE_H 62 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;
77 previous_properties =
"";
93 virtual std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number) = 0;
104 virtual std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) = 0;
107 std::string
Id()
const {
return id; }
116 void Id(std::string value) {
id = value; }
118 void Layer(
int value) { layer = value; }
119 void Start(
float value) { start = value; }
120 void End(
float value) { end = value; }
124 virtual std::string
Json()
const = 0;
125 virtual void SetJson(
const std::string value) = 0;
126 virtual Json::Value
JsonValue()
const = 0;
131 virtual std::string
PropertiesJSON(int64_t requested_frame)
const = 0;
bool operator>(ClipBase &a)
void Layer(int value)
Set layer of clip on timeline (lower number is covered by higher numbers)
bool operator<=(ClipBase &a)
This class represents a timeline (used for building generic timeline implementations) ...
std::string Id() const
Get the Id of this clip object.
virtual void SetJson(const std::string value)=0
Load JSON string into this object.
float Start() const
Get start position (in seconds) of clip (trim start of video)
void Start(float value)
Set start position (in seconds) of clip (trim start of video)
std::string id
ID Property for all derived Clip and Effect classes.
Header file for Point class.
virtual std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number)=0
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
float position
The position on the timeline where this clip should start playing.
virtual std::string Json() const =0
Generate JSON string of this object.
openshot::TimelineBase * timeline
Pointer to the parent timeline instance (if any)
Header file for the Keyframe class.
Header file for CacheMemory class.
int layer
The layer this clip is on. Lower clips are covered up by higher clips.
virtual Json::Value JsonValue() const =0
Generate Json::Value for this object.
virtual void SetJsonValue(const Json::Value root)=0
Load Json::Value into this object.
Header file for Frame class.
virtual std::string PropertiesJSON(int64_t requested_frame) const =0
Header file for JSON class.
Json::Value add_property_choice_json(std::string name, int value, int selected_value) const
Generate JSON choice for a property (dropdown properties)
void Position(float value)
Set the Id of this clip object
void ParentTimeline(openshot::TimelineBase *new_timeline)
Set associated Timeline pointer.
float start
The position in seconds to start playing (used to trim the beginning of a clip)
ClipBase()
Constructor for the base clip.
This abstract class is the base class, used by all clips in libopenshot.
void End(float value)
Set end position (in seconds) of clip (trim end of video)
virtual ~ClipBase()=default
float end
The position in seconds to end playing (used to trim the ending of a clip)
float Duration() const
Get the length of this clip (in seconds)
This namespace is the default namespace for all code in the openshot library.
Header file for Timeline class.
bool operator>=(ClipBase &a)
openshot::TimelineBase * ParentTimeline()
Get the associated Timeline pointer (if any)
float Position() const
Get position on timeline (in seconds)
float End() const
Get end position (in seconds) of clip (trim end of video)
std::string previous_properties
This string contains the previous JSON properties.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...
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.
void Id(std::string value)
This class is a memory-based cache manager for Frame objects.
int Layer() const
Get layer of clip on timeline (lower number is covered by higher numbers)
bool operator<(ClipBase &a)