OpenShot Library | libopenshot  0.2.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
openshot::ClipBase Class Referenceabstract

This abstract class is the base class, used by all clips in libopenshot. More...

#include <ClipBase.h>

Inheritance diagram for openshot::ClipBase:
openshot::Clip openshot::EffectBase openshot::Bars openshot::Blur openshot::Brightness openshot::ChromaKey openshot::ColorShift openshot::Crop openshot::Deinterlace openshot::Hue openshot::Mask openshot::Negate openshot::Pixelate openshot::Saturation openshot::Shift openshot::Wave

Public Member Functions

 ClipBase ()
 Constructor for the base clip. More...
 
void Id (std::string value)
 Set basic properties. More...
 
virtual std::string Json () const =0
 Get and Set JSON methods. More...
 
virtual Json::Value JsonValue () const =0
 Generate Json::Value for this object. More...
 
bool operator< (ClipBase &a)
 
bool operator<= (ClipBase &a)
 
bool operator> (ClipBase &a)
 
bool operator>= (ClipBase &a)
 
virtual std::string PropertiesJSON (int64_t requested_frame) const =0
 
virtual void SetJson (const std::string value)=0
 Load JSON string into this object. More...
 
virtual void SetJsonValue (const Json::Value root)=0
 Load Json::Value into this object. More...
 
virtual ~ClipBase ()=default
 

Protected Member Functions

Json::Value add_property_choice_json (std::string name, int value, int selected_value) const
 Generate JSON choice for a property (dropdown properties) More...
 
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. More...
 

Protected Attributes

float end
 The position in seconds to end playing (used to trim the ending of a clip) More...
 
std::string id
 ID Property for all derived Clip and Effect classes. More...
 
int layer
 The layer this clip is on. Lower clips are covered up by higher clips. More...
 
float position
 The position on the timeline where this clip should start playing. More...
 
std::string previous_properties
 This string contains the previous JSON properties. More...
 
float start
 The position in seconds to start playing (used to trim the beginning of a clip) More...
 

Detailed Description

This abstract class is the base class, used by all clips in libopenshot.

Clips are objects that attach to the timeline and can be layered and positioned together. There are 2 primary types of clips: Effects and Video/Audio Clips.

Definition at line 49 of file ClipBase.h.

Constructor & Destructor Documentation

◆ ClipBase()

openshot::ClipBase::ClipBase ( )
inline

Constructor for the base clip.

Definition at line 67 of file ClipBase.h.

◆ ~ClipBase()

virtual openshot::ClipBase::~ClipBase ( )
virtualdefault

Member Function Documentation

◆ add_property_choice_json()

Json::Value ClipBase::add_property_choice_json ( std::string  name,
int  value,
int  selected_value 
) const
protected

Generate JSON choice for a property (dropdown properties)

Definition at line 104 of file ClipBase.cpp.

Referenced by openshot::Deinterlace::PropertiesJSON(), openshot::Mask::PropertiesJSON(), and openshot::Clip::PropertiesJSON().

◆ add_property_json()

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
protected

◆ Id()

void openshot::ClipBase::Id ( std::string  value)
inline

◆ Json()

virtual std::string openshot::ClipBase::Json ( ) const
pure virtual

◆ JsonValue()

Json::Value ClipBase::JsonValue ( ) const
pure virtual

◆ operator<()

bool openshot::ClipBase::operator< ( ClipBase a)
inline

Definition at line 70 of file ClipBase.h.

◆ operator<=()

bool openshot::ClipBase::operator<= ( ClipBase a)
inline

Definition at line 71 of file ClipBase.h.

◆ operator>()

bool openshot::ClipBase::operator> ( ClipBase a)
inline

Definition at line 72 of file ClipBase.h.

◆ operator>=()

bool openshot::ClipBase::operator>= ( ClipBase a)
inline

Definition at line 73 of file ClipBase.h.

◆ PropertiesJSON()

virtual std::string openshot::ClipBase::PropertiesJSON ( int64_t  requested_frame) const
pure virtual

Get all properties for a specific frame (perfect for a UI to display the current state of all properties at any time)

Implemented in openshot::Clip, openshot::Blur, openshot::Mask, openshot::ColorShift, openshot::Bars, openshot::Brightness, openshot::Crop, openshot::Pixelate, openshot::Wave, openshot::Saturation, openshot::ChromaKey, openshot::Shift, openshot::Deinterlace, openshot::Hue, and openshot::Negate.

◆ SetJson()

virtual void openshot::ClipBase::SetJson ( const std::string  value)
pure virtual

◆ SetJsonValue()

void ClipBase::SetJsonValue ( const Json::Value  root)
pure virtual

Member Data Documentation

◆ end

float openshot::ClipBase::end
protected

The position in seconds to end playing (used to trim the ending of a clip)

Definition at line 55 of file ClipBase.h.

Referenced by openshot::Clip::End(), and openshot::Clip::Open().

◆ id

std::string openshot::ClipBase::id
protected

ID Property for all derived Clip and Effect classes.

Definition at line 51 of file ClipBase.h.

◆ layer

int openshot::ClipBase::layer
protected

The layer this clip is on. Lower clips are covered up by higher clips.

Definition at line 53 of file ClipBase.h.

◆ position

float openshot::ClipBase::position
protected

The position on the timeline where this clip should start playing.

Definition at line 52 of file ClipBase.h.

◆ previous_properties

std::string openshot::ClipBase::previous_properties
protected

This string contains the previous JSON properties.

Definition at line 56 of file ClipBase.h.

◆ start

float openshot::ClipBase::start
protected

The position in seconds to start playing (used to trim the beginning of a clip)

Definition at line 54 of file ClipBase.h.

Referenced by openshot::Deinterlace::GetFrame().


The documentation for this class was generated from the following files: