node: implemented convenience functions for transforming time

Implements a function that calculates the time transformation(s) only between
one node and another.
This commit is contained in:
itsmattkc
2020-03-26 00:26:13 +11:00
parent 9f3b9fdc70
commit c5d3c4ff36
4 changed files with 123 additions and 2 deletions
+20
View File
@@ -212,6 +212,11 @@ public:
*/
void DisconnectAll();
/**
* @brief Transforms time from this node through the connections it takes to get to the specified node
*/
QList<TimeRange> TransformTimeTo(const TimeRange& time, Node* target, NodeParam::Type direction);
template<class T>
/**
* @brief Find a node of a certain type that this Node outputs to
@@ -245,8 +250,19 @@ public:
*/
virtual void InvalidateVisible(NodeInput *from);
/**
* @brief Adjusts time that should be sent to nodes connected to certain inputs.
*
* If this node modifies the `time` (i.e. a clip converting sequence time to media time), this function should be
* overridden to do so. Also make sure to override OutputTimeAdjustment() to provide the inverse function.
*/
virtual TimeRange InputTimeAdjustment(NodeInput* input, const TimeRange& input_time) const;
/**
* @brief The inverse of InputTimeAdjustment()
*/
virtual TimeRange OutputTimeAdjustment(NodeInput* input, const TimeRange& input_time) const;
/**
* @brief Copies inputs from from Node to another including connections
*
@@ -315,6 +331,10 @@ public:
static QString ReadFileAsString(const QString& filename);
QList<NodeInput*> GetInputsIncludingArrays() const;
QList<NodeOutput*> GetOutputs() const;
protected:
void AddInput(NodeInput* input);