timenode: implemented timenode to allow values to be connected to time

This commit is contained in:
itsmattkc
2020-04-03 23:27:38 +11:00
parent 378c354277
commit 3dd91a1429
7 changed files with 97 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#include "timeinput.h"
TimeInput::TimeInput()
{
}
Node *TimeInput::copy() const
{
return new TimeInput();
}
QString TimeInput::Name() const
{
return tr("Time");
}
QString TimeInput::id() const
{
return QStringLiteral("org.olivevideoeditor.Olive.videoinput");
}
QString TimeInput::Category() const
{
return tr("Input");
}
QString TimeInput::Description() const
{
return tr("Generates the time (in seconds) at this frame");
}
NodeValueTable TimeInput::Value(const NodeValueDatabase &value) const
{
NodeValueTable table = value.Merge();
table.Push(NodeParam::kFloat,
value[QStringLiteral("global")].Get(NodeParam::kFloat, QStringLiteral("time_in")),
QStringLiteral("time"));
return table;
}