13 #ifndef OPENSHOT_TIMELINE_H 14 #define OPENSHOT_TIMELINE_H 20 #include <QtGui/QImage> 21 #include <QtGui/QPainter> 22 #include <QtCore/QRegularExpression> 154 std::list<openshot::Clip*> clips;
155 std::list<openshot::Clip*> closing_clips;
156 std::map<openshot::Clip*, openshot::Clip*> open_clips;
157 std::set<openshot::Clip*> allocated_clips;
158 std::list<openshot::EffectBase*> effects;
159 std::set<openshot::EffectBase*> allocated_effects;
161 std::set<openshot::FrameMapper*> allocated_frame_mappers;
164 int max_concurrent_frames;
167 std::map<std::string, std::shared_ptr<openshot::TrackedObjectBase>> tracked_objects;
170 void add_layer(std::shared_ptr<openshot::Frame> new_frame,
openshot::Clip* source_clip, int64_t clip_frame_number,
bool is_top_clip,
float max_volume);
176 void apply_json_to_clips(Json::Value change);
177 void apply_json_to_effects(Json::Value change);
179 void apply_json_to_timeline(Json::Value change);
182 void calculate_max_duration();
193 std::vector<openshot::Clip*> find_intersecting_clips(int64_t requested_frame,
int number_of_frames,
bool include);
199 bool isEqual(
double a,
double b);
208 void update_open_clips(
openshot::Clip *clip,
bool does_clip_intersect);
232 Timeline(
const std::string& projectPath,
bool convert_absolute_paths);
237 void AddTrackedObject(std::shared_ptr<openshot::TrackedObjectBase> trackedObject);
239 std::shared_ptr<openshot::TrackedObjectBase> GetTrackedObject(std::string
id)
const;
241 std::list<std::string> GetTrackedObjectsIds()
const;
244 std::string GetTrackedObjectValues(std::string
id, int64_t frame_number)
const;
256 std::shared_ptr<openshot::Frame> apply_effects(std::shared_ptr<openshot::Frame> frame, int64_t timeline_frame_number,
int layer);
259 void ApplyMapperToClips();
272 void ClearAllCache(
bool deep=
false);
275 std::list<openshot::Clip*>
Clips()
override {
return clips; };
289 int64_t GetMaxFrame();
292 void Close()
override;
295 std::list<openshot::EffectBase*>
Effects() {
return effects; };
298 std::list<openshot::EffectBase*> ClipEffects()
const;
311 std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame)
override;
322 bool IsOpen()
override {
return is_open; };
325 std::string
Name()
override {
return "Timeline"; };
328 std::string Json()
const override;
329 void SetJson(
const std::string value)
override;
330 Json::Value JsonValue()
const override;
331 void SetJsonValue(
const Json::Value root)
override;
335 void SetMaxSize(
int width,
int height);
341 void ApplyJsonDiff(std::string value);
344 void Open()
override;
361 #endif // OPENSHOT_TIMELINE_H openshot::Color color
Background color of timeline canvas.
openshot::CacheBase * GetCache() override
Get the cache object used by this reader.
bool operator()(const openshot::EffectBase *lhs, const openshot::EffectBase *rhs)
Header file for Fraction class.
This class represents a timeline (used for building generic timeline implementations) ...
This abstract class is the base class, used by all effects in libopenshot.
Header file for ReaderBase class.
bool AutoMapClips()
Determine if clips are automatically mapped to the timeline's framerate and samplerate.
This struct contains info about the current Timeline clip instance.
bool operator()(openshot::Clip *lhs, openshot::Clip *rhs)
std::string Name() override
Return the type name of the class.
This abstract class is the base class, used by all readers in libopenshot.
Header file for the Keyframe class.
This class represents a clip (used to arrange readers on the timeline)
Header file for Frame class.
Header file for Clip class.
This class represents a fraction.
This struct contains info about a media file, such as height, width, frames per second, etc...
All cache managers in libopenshot are based on this CacheBase class.
ChannelLayout
This enumeration determines the audio channel layout (such as stereo, mono, 5 point surround...
openshot::Keyframe viewport_y
Curve representing the y coordinate for the viewport.
bool operator()(openshot::EffectBase *lhs, openshot::EffectBase *rhs)
bool IsOpen() override
Determine if reader is open or closed.
int Order() const
Get the order that this effect should be executed.
Header file for Color class.
openshot::Keyframe viewport_x
Curve representing the x coordinate for the viewport.
void AutoMapClips(bool auto_map)
Automatically map all clips to the timeline's framerate and samplerate.
This class represents a color (used on the timeline and clips)
Header file for the TrackedObjectBBox class.
float Duration() const
Get the length of this clip (in seconds)
std::list< openshot::EffectBase * > Effects()
Return the list of effects on the timeline.
This namespace is the default namespace for all code in the openshot library.
Header file for EffectBase class.
Header file for Timeline class.
openshot::Keyframe viewport_scale
Curve representing the scale of the viewport (0 to 100)
void SortTimeline()
Sort all clips and effects on timeline - which affects the internal order of clips and effects arrays...
Like CompareClipEndFrames, but for effects.
float Position() const
Get position on timeline (in seconds)
Header file for the TrackedObjectBase class.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...
std::list< openshot::Clip * > Clips() override
Return a list of clips on the timeline.
bool operator()(const openshot::Clip *lhs, const openshot::Clip *rhs)
int Layer() const
Get layer of clip on timeline (lower number is covered by higher numbers)
This class represents a timeline.