removed all dependence on NodeOutputs
If Nodes only have the one output, we don't need to do so much differentiation between them. Previous iteration used outputs as like a distinct function within a Node (e.g. length output would return one result, buffer output would produce a different result - each run different code to produce their results). Now in this iteration, it's more accurate to say a Node is just one function (which seems more appropriate for a node system anyway).
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
AudioInput::AudioInput()
|
||||
{
|
||||
samples_output_ = new NodeOutput("samples_out");
|
||||
AddParameter(samples_output_);
|
||||
}
|
||||
|
||||
Node *AudioInput::copy() const
|
||||
@@ -31,11 +29,6 @@ QString AudioInput::Description() const
|
||||
return tr("Import an audio footage stream.");
|
||||
}
|
||||
|
||||
NodeOutput *AudioInput::samples_output()
|
||||
{
|
||||
return samples_output_;
|
||||
}
|
||||
|
||||
NodeValueTable AudioInput::Value(const NodeValueDatabase &value) const
|
||||
{
|
||||
return value[footage_input_];
|
||||
|
||||
@@ -15,13 +15,10 @@ public:
|
||||
virtual QString Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
NodeOutput* samples_output();
|
||||
|
||||
protected:
|
||||
virtual NodeValueTable Value(const NodeValueDatabase& value) const override;
|
||||
|
||||
private:
|
||||
NodeOutput* samples_output_;
|
||||
};
|
||||
|
||||
#endif // AUDIOINPUT_H
|
||||
|
||||
@@ -13,9 +13,6 @@ VideoInput::VideoInput()
|
||||
matrix_input_ = new NodeInput("matrix_in");
|
||||
matrix_input_->set_data_type(NodeInput::kMatrix);
|
||||
AddParameter(matrix_input_);
|
||||
|
||||
texture_output_ = new NodeOutput("tex_out");
|
||||
AddParameter(texture_output_);
|
||||
}
|
||||
|
||||
Node *VideoInput::copy() const
|
||||
@@ -53,27 +50,18 @@ NodeInput *VideoInput::matrix_input() const
|
||||
return matrix_input_;
|
||||
}
|
||||
|
||||
NodeOutput *VideoInput::texture_output() const
|
||||
QString VideoInput::Code() const
|
||||
{
|
||||
return texture_output_;
|
||||
}
|
||||
|
||||
QString VideoInput::Code(NodeOutput *output) const
|
||||
{
|
||||
if (output == texture_output()) {
|
||||
return "#version 110\n"
|
||||
"\n"
|
||||
"varying vec2 v_texcoord;\n"
|
||||
"\n"
|
||||
"uniform sampler2D footage_in;\n"
|
||||
"uniform mat4 matrix_in;\n"
|
||||
"\n"
|
||||
"void main(void) {\n"
|
||||
" gl_FragColor = texture2D(footage_in, vec2(vec4(v_texcoord, 0.0, 1.0) * matrix_in));\n"
|
||||
"}\n";
|
||||
}
|
||||
|
||||
return Node::Code(output);
|
||||
return "#version 110\n"
|
||||
"\n"
|
||||
"varying vec2 v_texcoord;\n"
|
||||
"\n"
|
||||
"uniform sampler2D footage_in;\n"
|
||||
"uniform mat4 matrix_in;\n"
|
||||
"\n"
|
||||
"void main(void) {\n"
|
||||
" gl_FragColor = texture2D(footage_in, vec2(vec4(v_texcoord, 0.0, 1.0) * matrix_in));\n"
|
||||
"}\n";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -22,9 +22,7 @@ public:
|
||||
|
||||
NodeInput* matrix_input() const;
|
||||
|
||||
NodeOutput* texture_output() const;
|
||||
|
||||
virtual QString Code(NodeOutput* output) const override;
|
||||
virtual QString Code() const override;
|
||||
|
||||
//virtual void Hash(QCryptographicHash *hash, NodeOutput* from, const rational &time) override;
|
||||
|
||||
@@ -33,8 +31,6 @@ protected:
|
||||
private:
|
||||
NodeInput* matrix_input_;
|
||||
|
||||
NodeOutput* texture_output_;
|
||||
|
||||
};
|
||||
|
||||
#endif // VIDEOINPUT_H
|
||||
|
||||
Reference in New Issue
Block a user