From e96bd5ba9897a3d3b461334f3a68cbfc78141f75 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Wed, 3 Oct 2012 01:55:24 -0500 Subject: [PATCH] Added the initial timeline and clip classes, with some of the initial curves and constructors. --- include/Clip.h | 95 ++++++++++++++++++++++++++++++++++++++++++++++ include/Fraction.h | 2 +- include/KeyFrame.h | 3 ++ include/OpenShot.h | 2 + include/Point.h | 3 ++ include/Timeline.h | 45 ++++++++++++++++++++++ src/CMakeLists.txt | 4 +- src/Clip.cpp | 33 ++++++++++++++++ src/KeyFrame.cpp | 9 +++++ src/Point.cpp | 10 +++++ src/Timeline.cpp | 17 +++++++++ src/openshot.i | 4 ++ 12 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 include/Clip.h create mode 100644 include/Timeline.h create mode 100644 src/Clip.cpp create mode 100644 src/Timeline.cpp diff --git a/include/Clip.h b/include/Clip.h new file mode 100644 index 00000000..0fe2d415 --- /dev/null +++ b/include/Clip.h @@ -0,0 +1,95 @@ +#ifndef OPENSHOT_CLIP_H +#define OPENSHOT_CLIP_H + +/** + * \file + * \brief Header file for Clip class + * \author Copyright (c) 2011 Jonathan Thomas + */ + +#include "KeyFrame.h" + +using namespace std; +using namespace openshot; + +namespace openshot { + + /** + * This enumeration determines how clips are aligned to their parent container. + */ + enum GravityType + { + TOP_LEFT, + TOP, + TOP_RIGHT, + LEFT, + CENTER, + RIGHT, + BOTTOM_LEFT, + BOTTOM, + BOTTOM_RIGHT + }; + + /** + * This enumeration determines how clips are scaled to fit their parent container. + */ + enum ScaleType + { + CROP, + FIT, + STRETCH, + NONE + }; + + /** + * This enumeration determines what parent a clip should be aligned to. + */ + enum AnchorType + { + CANVAS, + VIEWPORT + }; + + /** + * \brief This class represents a clip + * + * Each image, video, or audio file is represented on a layer as a clip. A clip has many + * properties that affect how it behaves on the timeline, such as its size, position, + * transparency, rotation, speed, volume, etc... + */ + class Clip { + private: + float position; ///