began new infrastructure

Yep, this is another one of my "famous" sweeping rewrites. Expect things to break.

Goals for this are:
- Greatly simplify node connections (particularly with arrays) so the code requires less maintenance/is more stable
- Redesign node structure to address issues where UI would stall for lengthy periods of time
- Less reliance on shared ptrs/greater reliance on QObject system for inheritance/memory management
- General code cleanup and improvements
This commit is contained in:
itsmattkc
2021-01-05 11:20:38 +11:00
parent 19eabf2830
commit 181235f6ce
152 changed files with 3932 additions and 8166 deletions
+17 -12
View File
@@ -30,9 +30,7 @@
namespace olive {
class NodeInput;
class NodeKeyframe;
using NodeKeyframePtr = std::shared_ptr<NodeKeyframe>;
class NodeInputImmediate;
/**
* @brief A point of data to be used at a certain time and interpolated with other data
@@ -63,11 +61,11 @@ public:
/**
* @brief NodeKeyframe Constructor
*/
NodeKeyframe(const rational& time, const QVariant& value, const Type& type, const int& track);
NodeKeyframe(const rational& time, const QVariant& value, const Type& type, const int& track, int element, QObject* parent = nullptr);
static NodeKeyframePtr Create(const rational& time, const QVariant& value, const Type& type, const int &track);
NodeKeyframe* copy(QObject* parent = nullptr) const;
NodeKeyframePtr copy() const;
NodeInput* parent() const;
/**
* @brief The time this keyframe is set at
@@ -111,16 +109,21 @@ public:
* For the majority of keyfreames, this will be 0, but for some types, such as kVec2, this will be 0 for X keyframes
* and 1 for Y keyframes, etc.
*/
const int& track() const;
int track() const
{
return track_;
}
int element() const
{
return element_;
}
/**
* @brief Convenience function for getting the opposite handle type (e.g. kInHandle <-> kOutHandle)
*/
static BezierType get_opposing_bezier_type(BezierType type);
NodeInput* parent() const;
void set_parent(NodeInput* parent);
signals:
/**
* @brief Signal emitted when this keyframe's time is changed
@@ -148,8 +151,6 @@ signals:
void BezierControlOutChanged(const QPointF& d);
private:
NodeInput* parent_;
rational time_;
QVariant value_;
@@ -162,8 +163,12 @@ private:
int track_;
int element_;
};
using NodeKeyframeTrack = QVector<NodeKeyframe*>;
}
Q_DECLARE_METATYPE(olive::NodeKeyframe::Type)