multicam: initial implementation
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include "generator/text/textv1.h"
|
||||
#include "generator/text/textv2.h"
|
||||
#include "generator/text/textv3.h"
|
||||
#include "input/multicam/multicamnode.h"
|
||||
#include "input/time/timeinput.h"
|
||||
#include "input/value/valuenode.h"
|
||||
#include "keying/chromakey/chromakey.h"
|
||||
@@ -294,6 +295,8 @@ Node *NodeFactory::CreateFromFactoryIndex(const NodeFactory::InternalID &id)
|
||||
return new DropShadowFilter();
|
||||
case kTimeFormat:
|
||||
return new TimeFormatNode();
|
||||
case kMulticamNode:
|
||||
return new MultiCamNode();
|
||||
|
||||
case kInternalNodeCount:
|
||||
break;
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
kMaskDistort,
|
||||
kDropShadowFilter,
|
||||
kTimeFormat,
|
||||
kMulticamNode,
|
||||
|
||||
// Count value
|
||||
kInternalNodeCount
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
add_subdirectory(multicam)
|
||||
add_subdirectory(time)
|
||||
add_subdirectory(value)
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Olive - Non-Linear Video Editor
|
||||
# Copyright (C) 2022 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/multicam/multicamnode.h
|
||||
node/input/multicam/multicamnode.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -1,6 +1,64 @@
|
||||
#include "multicamnode.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
#define super Node
|
||||
|
||||
const QString MultiCamNode::kCurrentInput = QStringLiteral("current_in");
|
||||
const QString MultiCamNode::kSourcesInput = QStringLiteral("sources_in");
|
||||
|
||||
MultiCamNode::MultiCamNode()
|
||||
{
|
||||
AddInput(kCurrentInput, NodeValue::kInt, InputFlags(kInputFlagStatic));
|
||||
|
||||
AddInput(kSourcesInput, NodeValue::kNone, InputFlags(kInputFlagNotKeyframable | kInputFlagArray));
|
||||
}
|
||||
|
||||
QString MultiCamNode::Name() const
|
||||
{
|
||||
return tr("Multi-Cam");
|
||||
}
|
||||
|
||||
QString MultiCamNode::id() const
|
||||
{
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.multicam");
|
||||
}
|
||||
|
||||
QVector<Node::CategoryID> MultiCamNode::Category() const
|
||||
{
|
||||
return {kCategoryTimeline};
|
||||
}
|
||||
|
||||
QString MultiCamNode::Description() const
|
||||
{
|
||||
return tr("Allows easy switching between multiple sources.");
|
||||
}
|
||||
|
||||
Node::ActiveElements MultiCamNode::GetActiveElementsAtTime(const QString &input, const TimeRange &r) const
|
||||
{
|
||||
if (input == kSourcesInput) {
|
||||
Node::ActiveElements a;
|
||||
a.add(GetStandardValue(kCurrentInput).toInt());
|
||||
return a;
|
||||
} else {
|
||||
return super::GetActiveElementsAtTime(input, r);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiCamNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
{
|
||||
NodeValueArray arr = value[kSourcesInput].toArray();
|
||||
if (!arr.empty()) {
|
||||
table->Push(arr.begin()->second);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiCamNode::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
|
||||
SetInputName(kCurrentInput, tr("Current"));
|
||||
SetInputName(kSourcesInput, tr("Sources"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,34 @@
|
||||
#ifndef MULTICAMNODE_H
|
||||
#define MULTICAMNODE_H
|
||||
|
||||
#include "node/node.h"
|
||||
|
||||
class MultiCamNode
|
||||
namespace olive {
|
||||
|
||||
class MultiCamNode : public Node
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MultiCamNode();
|
||||
|
||||
NODE_DEFAULT_FUNCTIONS(MultiCamNode)
|
||||
|
||||
virtual QString Name() const override;
|
||||
virtual QString id() const override;
|
||||
virtual QVector<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual ActiveElements GetActiveElementsAtTime(const QString &input, const TimeRange &r) const override;
|
||||
|
||||
virtual void Value(const NodeValueRow& value, const NodeGlobals &globals, NodeValueTable *table) const override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
static const QString kCurrentInput;
|
||||
static const QString kSourcesInput;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // MULTICAMNODE_H
|
||||
|
||||
Reference in New Issue
Block a user