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
+1
View File
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add_subdirectory(media)
add_subdirectory(time)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
+22
View File
@@ -0,0 +1,22 @@
# Olive - Non-Linear Video Editor
# Copyright (C) 2019 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/input/time/timeinput.h
node/input/time/timeinput.cpp
PARENT_SCOPE
)
+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;
}
+23
View File
@@ -0,0 +1,23 @@
#ifndef TIMEINPUT_H
#define TIMEINPUT_H
#include "node/node.h"
class TimeInput : public Node
{
Q_OBJECT
public:
TimeInput();
virtual Node* copy() const override;
virtual QString Name() const override;
virtual QString id() const override;
virtual QString Category() const override;
virtual QString Description() const override;
virtual NodeValueTable Value(const NodeValueDatabase& value) const override;
};
#endif // TIMEINPUT_H