31 #ifndef OPENSHOT_TIMELINE_H 32 #define OPENSHOT_TIMELINE_H 38 #include <QtGui/QImage> 39 #include <QtGui/QPainter> 40 #include <QtCore/QRegularExpression> 172 std::list<openshot::Clip*> clips;
173 std::list<openshot::Clip*> closing_clips;
174 std::map<openshot::Clip*, openshot::Clip*> open_clips;
175 std::list<openshot::EffectBase*> effects;
177 std::set<openshot::FrameMapper*> allocated_frame_mappers;
180 std::mutex get_frame_mutex;
181 int max_concurrent_frames;
183 std::map<std::string, std::shared_ptr<openshot::TrackedObjectBase>> tracked_objects;
186 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);
192 void apply_json_to_clips(Json::Value change);
193 void apply_json_to_effects(Json::Value change);
195 void apply_json_to_timeline(Json::Value change);
206 std::vector<openshot::Clip*> find_intersecting_clips(int64_t requested_frame,
int number_of_frames,
bool include);
212 bool isEqual(
double a,
double b);
221 void update_open_clips(
openshot::Clip *clip,
bool does_clip_intersect);
245 Timeline(
const std::string& projectPath,
bool convert_absolute_paths);
250 void AddTrackedObject(std::shared_ptr<openshot::TrackedObjectBase> trackedObject);
252 std::shared_ptr<openshot::TrackedObjectBase> GetTrackedObject(std::string
id)
const;
254 std::list<std::string> GetTrackedObjectsIds()
const;
257 std::string GetTrackedObjectValues(std::string
id, int64_t frame_number)
const;
269 std::shared_ptr<openshot::Frame> apply_effects(std::shared_ptr<openshot::Frame> frame, int64_t timeline_frame_number,
int layer);
272 void ApplyMapperToClips();
281 void ClearAllCache();
284 std::list<openshot::Clip*>
Clips() {
return clips; };
298 int64_t GetMaxFrame();
301 void Close()
override;
304 std::list<openshot::EffectBase*>
Effects() {
return effects; };
307 std::list<openshot::EffectBase*> ClipEffects()
const;
320 std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame)
override;
331 bool IsOpen()
override {
return is_open; };
334 std::string
Name()
override {
return "Timeline"; };
337 std::string Json()
const override;
338 void SetJson(
const std::string value)
override;
339 Json::Value JsonValue()
const override;
340 void SetJsonValue(
const Json::Value root)
override;
344 void SetMaxSize(
int width,
int height);
350 void ApplyJsonDiff(std::string value);
353 void Open()
override;
366 #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.
std::list< openshot::Clip * > Clips()
Return a list of clips on the timeline.
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)
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...
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.