nodes: implemented core of manual table value selection
This commit is contained in:
@@ -51,27 +51,23 @@ QString TimeInput::Description() const
|
||||
return tr("Generates the time (in seconds) at this frame.");
|
||||
}
|
||||
|
||||
NodeValueTable TimeInput::Value(const QString &output, NodeValueDatabase &value) const
|
||||
void TimeInput::Value(const QString &output, const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
{
|
||||
Q_UNUSED(output)
|
||||
|
||||
NodeValueTable table = value.Merge();
|
||||
|
||||
table.Push(NodeValue::kFloat,
|
||||
value[QStringLiteral("global")].Get(NodeValue::kFloat, QStringLiteral("time_in")),
|
||||
this,
|
||||
false,
|
||||
QStringLiteral("time"));
|
||||
|
||||
return table;
|
||||
table->Push(NodeValue::kFloat,
|
||||
globals.time().in().toDouble(),
|
||||
this,
|
||||
false,
|
||||
QStringLiteral("time"));
|
||||
}
|
||||
|
||||
void TimeInput::Hash(const QString &output, QCryptographicHash &hash, const rational &time, const VideoParams &video_params) const
|
||||
void TimeInput::Hash(const QString &output, QCryptographicHash &hash, const NodeGlobals &globals, const VideoParams &video_params) const
|
||||
{
|
||||
Node::Hash(output, hash, time, video_params);
|
||||
Node::Hash(output, hash, globals, video_params);
|
||||
|
||||
// Make sure time is hashed
|
||||
hash.addData(NodeValue::ValueToBytes(NodeValue::kRational, QVariant::fromValue(time)));
|
||||
hash.addData(NodeValue::ValueToBytes(NodeValue::kFloat, globals.time().in().toDouble()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ public:
|
||||
virtual QVector<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual NodeValueTable Value(const QString& output, NodeValueDatabase& value) const override;
|
||||
virtual void Value(const QString& output, const NodeValueRow& value, const NodeGlobals &globals, NodeValueTable *table) const override;
|
||||
|
||||
virtual void Hash(const QString& output, QCryptographicHash& hash, const rational& time, const VideoParams& video_params) const override;
|
||||
virtual void Hash(const QString& output, QCryptographicHash& hash, const NodeGlobals &globals, const VideoParams& video_params) const override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -59,14 +59,13 @@ void ValueNode::Retranslate()
|
||||
SetComboBoxStrings(kTypeInput, type_names);
|
||||
}
|
||||
|
||||
NodeValueTable ValueNode::Value(const QString &output, NodeValueDatabase &value) const
|
||||
void ValueNode::Value(const QString &output, const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
{
|
||||
Q_UNUSED(globals)
|
||||
Q_UNUSED(output)
|
||||
|
||||
// Pop combobox value off table because no other node will need it
|
||||
value[kTypeInput].Take(NodeValue::kCombo);
|
||||
|
||||
return value.Merge();
|
||||
// Ensure value is pushed onto the table
|
||||
table->Push(value[kValueInput]);
|
||||
}
|
||||
|
||||
void ValueNode::InputValueChangedEvent(const QString &input, int element)
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual NodeValueTable Value(const QString &output, NodeValueDatabase &value) const override;
|
||||
virtual void Value(const QString &output, const NodeValueRow& value, const NodeGlobals &globals, NodeValueTable *table) const override;
|
||||
|
||||
protected:
|
||||
virtual void InputValueChangedEvent(const QString &input, int element) override;
|
||||
|
||||
Reference in New Issue
Block a user