added signal for an edge changing that can ripple through the graph
Useful for detecting when a graph needs recompiling, in tandem with the "InvalidateCache()" signal when necessary, this signal ripples through the nodes when any of the connections change which will likely need handling by the renderer.
This commit is contained in:
@@ -117,3 +117,16 @@ rational ViewerOutput::Length()
|
||||
{
|
||||
return length_input_->get_realtime_value_of_connected_output().value<rational>();
|
||||
}
|
||||
|
||||
void ViewerOutput::DependentEdgeChanged(NodeInput *from)
|
||||
{
|
||||
if (from == texture_input_) {
|
||||
emit VideoGraphChanged();
|
||||
} else if (from == samples_input_) {
|
||||
emit AudioGraphChanged();
|
||||
}
|
||||
|
||||
// NOTE: This node technically has no outputs so default behavior is unnecessary, but if this node gets outputs some
|
||||
// day this should be uncommented
|
||||
//Node::DependentEdgeChanged(from);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,9 @@ public:
|
||||
|
||||
rational Length();
|
||||
|
||||
protected:
|
||||
virtual void DependentEdgeChanged(NodeInput* from) override;
|
||||
|
||||
signals:
|
||||
void TimebaseChanged(const rational&);
|
||||
|
||||
@@ -64,6 +67,10 @@ signals:
|
||||
|
||||
void AudioChangedBetween(const rational&, const rational&);
|
||||
|
||||
void VideoGraphChanged();
|
||||
|
||||
void AudioGraphChanged();
|
||||
|
||||
void LengthChanged(const rational& length);
|
||||
|
||||
void SizeChanged(int width, int height);
|
||||
|
||||
Reference in New Issue
Block a user