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:
+13
-25
@@ -20,34 +20,37 @@
|
||||
|
||||
#include "keyframe.h"
|
||||
|
||||
#include "input.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
const NodeKeyframe::Type NodeKeyframe::kDefaultType = kLinear;
|
||||
|
||||
NodeKeyframe::NodeKeyframe(const rational &time, const QVariant &value, const NodeKeyframe::Type &type, const int &track) :
|
||||
parent_(nullptr),
|
||||
NodeKeyframe::NodeKeyframe(const rational &time, const QVariant &value, const NodeKeyframe::Type &type, const int &track, int element, QObject *parent) :
|
||||
time_(time),
|
||||
value_(value),
|
||||
type_(type),
|
||||
bezier_control_in_(QPointF(-1.0, 0.0)),
|
||||
bezier_control_out_(QPointF(1.0, 0.0)),
|
||||
track_(track)
|
||||
track_(track),
|
||||
element_(element)
|
||||
{
|
||||
setParent(parent);
|
||||
}
|
||||
|
||||
NodeKeyframePtr NodeKeyframe::Create(const rational &time, const QVariant &value, const NodeKeyframe::Type &type, const int& track)
|
||||
NodeKeyframe *NodeKeyframe::copy(QObject* parent) const
|
||||
{
|
||||
return std::make_shared<NodeKeyframe>(time, value, type, track);
|
||||
}
|
||||
|
||||
NodeKeyframePtr NodeKeyframe::copy() const
|
||||
{
|
||||
NodeKeyframePtr copy = std::make_shared<NodeKeyframe>(time_, value_, type_, track_);
|
||||
NodeKeyframe* copy = new NodeKeyframe(time_, value_, type_, track_, element_, parent);
|
||||
copy->bezier_control_in_ = bezier_control_in_;
|
||||
copy->bezier_control_out_ = bezier_control_out_;
|
||||
return copy;
|
||||
}
|
||||
|
||||
NodeInput *NodeKeyframe::parent() const
|
||||
{
|
||||
return static_cast<NodeInput*>(QObject::parent());
|
||||
}
|
||||
|
||||
const rational &NodeKeyframe::time() const
|
||||
{
|
||||
return time_;
|
||||
@@ -121,11 +124,6 @@ void NodeKeyframe::set_bezier_control(NodeKeyframe::BezierType type, const QPoin
|
||||
}
|
||||
}
|
||||
|
||||
const int &NodeKeyframe::track() const
|
||||
{
|
||||
return track_;
|
||||
}
|
||||
|
||||
NodeKeyframe::BezierType NodeKeyframe::get_opposing_bezier_type(NodeKeyframe::BezierType type)
|
||||
{
|
||||
if (type == kInHandle) {
|
||||
@@ -135,14 +133,4 @@ NodeKeyframe::BezierType NodeKeyframe::get_opposing_bezier_type(NodeKeyframe::Be
|
||||
}
|
||||
}
|
||||
|
||||
NodeInput *NodeKeyframe::parent() const
|
||||
{
|
||||
return parent_;
|
||||
}
|
||||
|
||||
void NodeKeyframe::set_parent(NodeInput *parent)
|
||||
{
|
||||
parent_ = parent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user