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