OpenShot Library | libopenshot
0.2.5
|
Go to the documentation of this file.
31 #ifndef OPENSHOT_TIMELINE_H
32 #define OPENSHOT_TIMELINE_H
37 #include <QtGui/QImage>
38 #include <QtGui/QPainter>
152 std::list<Clip*> clips;
153 std::list<Clip*> closing_clips;
154 std::map<Clip*, Clip*> open_clips;
155 std::list<EffectBase*> effects;
157 std::set<FrameMapper*> allocated_frame_mappers;
161 void add_layer(std::shared_ptr<Frame> new_frame,
Clip* source_clip, int64_t clip_frame_number, int64_t timeline_frame_number,
bool is_top_clip,
float max_volume);
164 void apply_mapper_to_clip(
Clip* clip);
167 void apply_json_to_clips(Json::Value change);
168 void apply_json_to_effects(Json::Value change);
169 void apply_json_to_effects(Json::Value change,
EffectBase* existing_effect);
170 void apply_json_to_timeline(Json::Value change);
173 double calculate_time(int64_t number,
Fraction rate);
181 std::vector<Clip*> find_intersecting_clips(int64_t requested_frame,
int number_of_frames,
bool include);
184 std::shared_ptr<Frame> GetOrCreateFrame(
Clip* clip, int64_t number);
187 std::shared_ptr<Frame> apply_effects(std::shared_ptr<Frame> frame, int64_t timeline_frame_number,
int layer);
190 bool isEqual(
double a,
double b);
199 void update_open_clips(
Clip *clip,
bool does_clip_intersect);
235 std::list<Clip*>
Clips() {
return clips; };
241 std::list<EffectBase*>
Effects() {
return effects; };
254 std::shared_ptr<Frame>
GetFrame(int64_t requested_frame);
268 std::string
Name() {
return "Timeline"; };
271 std::string
Json()
const override;
272 void SetJson(
const std::string value);
Header file for global Settings class.
void SetJson(const std::string value)
Load JSON string into this object.
This abstract class is the base class, used by all effects in libopenshot.
Header file for Point class.
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
void SetMaxSize(int width, int height)
Header file for Clip class.
Header file for Fraction class.
void RemoveEffect(EffectBase *effect)
Remove an effect from the timeline.
void AddClip(Clip *clip)
Add an openshot::Clip to the timeline.
This namespace is the default namespace for all code in the openshot library.
void ApplyJsonDiff(std::string value)
Apply a special formatted JSON object, which represents a change to the timeline (add,...
std::shared_ptr< Frame > GetFrame(int64_t requested_frame)
This class represents a clip (used to arrange readers on the timeline)
Timeline(int width, int height, Fraction fps, int sample_rate, int channels, ChannelLayout channel_layout)
Default Constructor for the timeline (which sets the canvas width and height and FPS)
This class represents a fraction.
void SetCache(CacheBase *new_cache)
Header file for CacheDisk class.
std::list< EffectBase * > Effects()
Return the list of effects on the timeline.
Header file for EffectBase class.
Header file for the Keyframe class.
All cache managers in libopenshot are based on this CacheBase class.
This header includes all commonly used effects for libopenshot, for ease-of-use.
Header file for CacheBase class.
int Layer() const
Get layer of clip on timeline (lower number is covered by higher numbers)
bool operator()(EffectBase *lhs, EffectBase *rhs)
Header file for the FrameMapper class.
Keyframe viewport_scale
Curve representing the scale of the viewport (0 to 100)
This class represents a color (used on the timeline and clips)
void RemoveClip(Clip *clip)
Remove an openshot::Clip from the timeline.
void AutoMapClips(bool auto_map)
Automatically map all clips to the timeline's framerate and samplerate.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Header file for CrashHandler class.
Header file for the EffectInfo class.
This class represents a timeline.
Header file for CacheMemory class.
void Open()
Open the reader (and start consuming resources)
Keyframe viewport_y
Curve representing the y coordinate for the viewport.
Header file for Frame class.
int Order() const
Get the order that this effect should be executed.
void ClearAllCache()
Clear all cache for this timeline instance, and all clips, mappers, and readers under it.
Header file for ReaderBase class.
bool operator()(Clip *lhs, Clip *rhs)
Header file for OpenMPUtilities (set some common macros)
std::string Name()
Return the type name of the class.
This abstract class is the base class, used by all readers in libopenshot.
float Position() const
Get position on timeline (in seconds)
std::string Json() const override
Get and Set JSON methods.
bool AutoMapClips()
Determine if clips are automatically mapped to the timeline's framerate and samplerate.
Header file for Color class.
void ApplyMapperToClips()
Apply the timeline's framerate and samplerate to all clips.
std::list< Clip * > Clips()
Return a list of clips on the timeline.
ChannelLayout
This enumeration determines the audio channel layout (such as stereo, mono, 5 point surround,...
bool IsOpen()
Determine if reader is open or closed.
void AddEffect(EffectBase *effect)
Add an effect to the timeline.
void Close()
Close the timeline reader (and any resources it was consuming)
CacheBase * GetCache()
Get the cache object used by this reader.
Color color
Background color of timeline canvas.
Json::Value JsonValue() const override
Generate Json::Value for this object.
Keyframe viewport_x
Curve representing the x coordinate for the viewport.