OpenShot Library | libopenshot
0.2.5
|
Go to the documentation of this file.
31 #ifndef OPENSHOT_CLIP_H
32 #define OPENSHOT_CLIP_H
36 #include <QtGui/QImage>
47 #include "JuceHeader.h"
102 std::list<openshot::EffectBase*> effects;
106 juce::AudioSampleBuffer *audio_cache;
116 int64_t adjust_frame_number_minimum(int64_t frame_number);
119 std::shared_ptr<openshot::Frame> apply_effects(std::shared_ptr<openshot::Frame> frame);
122 std::string get_file_extension(std::string path);
125 std::shared_ptr<openshot::Frame> GetOrCreateFrame(int64_t number);
128 void get_time_mapped_frame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number);
131 void init_settings();
134 void init_reader_rotation();
140 void reverse_buffer(juce::AudioSampleBuffer* buffer);
154 Clip(std::string path);
171 std::list<openshot::EffectBase*>
Effects() {
return effects; };
177 std::shared_ptr<openshot::Frame>
GetFrame(int64_t requested_frame);
194 std::string
Json()
const override;
195 void SetJson(
const std::string value);
201 std::string
PropertiesJSON(int64_t requested_frame)
const override;
openshot::Keyframe crop_width
Curve representing width in percent (0.0=0%, 1.0=100%)
openshot::Keyframe crop_height
Curve representing height in percent (0.0=0%, 1.0=100%)
This abstract class is the base class, used by all effects in libopenshot.
void Open()
Open the internal reader.
openshot::AnchorType anchor
The anchor determines what parent a clip should snap to.
juce::CriticalSection getFrameCriticalSection
Section lock for multiple threads.
Header file for Fraction class.
openshot::Keyframe crop_y
Curve representing Y offset in percent (-1.0=-100%, 0.0=0%, 1.0=100%)
void Close()
Close the internal reader.
openshot::Keyframe crop_x
Curve representing X offset in percent (-1.0=-100%, 0.0=0%, 1.0=100%)
This namespace is the default namespace for all code in the openshot library.
openshot::Keyframe scale_y
Curve representing the vertical scaling in percent (0 to 1)
std::string PropertiesJSON(int64_t requested_frame) const override
openshot::Keyframe time
Curve representing the frames over time to play (used for speed and direction of video)
This class represents a clip (used to arrange readers on the timeline)
openshot::Keyframe alpha
Curve representing the alpha (1 to 0)
bool Waveform()
Waveform property.
Header file for AudioResampler class.
openshot::Keyframe location_y
Curve representing the relative Y position in percent based on the gravity (-1 to 1)
GravityType
This enumeration determines how clips are aligned to their parent container.
std::list< openshot::EffectBase * > Effects()
Return the list of effects on the timeline.
openshot::Keyframe channel_mapping
A number representing an audio channel to output (only works when filtering a channel)
void AddEffect(openshot::EffectBase *effect)
Add an effect to the clip.
virtual ~Clip()
Destructor.
Header file for EffectBase class.
std::string Json() const override
Get and Set JSON methods.
void Waveform(bool value)
Set the waveform property of this clip.
Header file for the Keyframe class.
This header includes all commonly used effects for libopenshot, for ease-of-use.
int Layer() const
Get layer of clip on timeline (lower number is covered by higher numbers)
This class represents a color (used on the timeline and clips)
openshot::FrameDisplayType display
The format to display the frame number (if any)
openshot::Keyframe perspective_c2_y
Curves representing Y for coordinate 2.
openshot::Keyframe scale_x
Curve representing the horizontal scaling in percent (0 to 1)
This class is used to resample audio data for many sequential frames.
openshot::Keyframe perspective_c3_y
Curves representing Y for coordinate 3.
openshot::Keyframe perspective_c4_y
Curves representing Y for coordinate 4.
openshot::Keyframe has_video
An optional override to determine if this clip has video (-1=undefined, 0=no, 1=yes)
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
openshot::GravityType gravity
The gravity of a clip determines where it snaps to its parent.
Header file for the EffectInfo class.
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
float End() const
Override End() method.
std::shared_ptr< openshot::Frame > GetFrame(int64_t requested_frame)
Get an openshot::Frame object for a specific frame number of this timeline.
openshot::Keyframe perspective_c1_x
Curves representing X for coordinate 1.
void End(float value)
Set end position (in seconds) of clip (trim end of video)
openshot::GravityType crop_gravity
Cropping needs to have a gravity to determine what side we are cropping.
float end
The position in seconds to end playing (used to trim the ending of a clip)
openshot::ReaderBase * Reader()
Get the current reader.
openshot::Keyframe perspective_c2_x
Curves representing X for coordinate 2.
openshot::Keyframe volume
Curve representing the volume (0 to 1)
int Order() const
Get the order that this effect should be executed.
Header file for ReaderBase class.
openshot::Keyframe perspective_c4_x
Curves representing X for coordinate 4.
openshot::Keyframe perspective_c1_y
Curves representing Y for coordinate 1.
openshot::Keyframe channel_filter
Audio channel filter and mappings.
Header file for TextReader class.
Clip()
Default Constructor.
This abstract class is the base class, used by all readers in libopenshot.
float Position() const
Get position on timeline (in seconds)
openshot::ScaleType scale
The scale determines how a clip should be resized to fit its parent.
Header file for Color class.
AnchorType
This enumeration determines what parent a clip should be aligned to.
ScaleType
This enumeration determines how clips are scaled to fit their parent container.
openshot::Keyframe has_audio
Override has_video and has_audio properties of clip (and their readers)
openshot::Keyframe rotation
Curve representing the rotation (0 to 360)
void SetJson(const std::string value)
Load JSON string into this object.
bool operator()(openshot::EffectBase *lhs, openshot::EffectBase *rhs)
Json::Value JsonValue() const override
Generate Json::Value for this object.
openshot::Keyframe perspective_c3_x
Curves representing X for coordinate 3.
This abstract class is the base class, used by all clips in libopenshot.
VolumeMixType
This enumeration determines the strategy when mixing audio with other clips.
Header file for ClipBase class.
openshot::Color wave_color
Curve representing the color of the audio wave form.
openshot::Keyframe shear_y
Curve representing Y shear angle in degrees (-45.0=down, 45.0=up)
void RemoveEffect(openshot::EffectBase *effect)
Remove an effect from the clip.
openshot::VolumeMixType mixing
What strategy should be followed when mixing audio with other clips.
openshot::Keyframe shear_x
Curve representing X shear angle in degrees (-45.0=left, 45.0=right)
openshot::Keyframe location_x
Curve representing the relative X position in percent based on the gravity (-1 to 1)
FrameDisplayType
This enumeration determines the display format of the clip's frame number (if any)....