diff --git a/app/node/factory.cpp b/app/node/factory.cpp
index 41d6f55a5..2ac7bc99d 100644
--- a/app/node/factory.cpp
+++ b/app/node/factory.cpp
@@ -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;
diff --git a/app/node/factory.h b/app/node/factory.h
index b6f6037f0..4cad9b984 100644
--- a/app/node/factory.h
+++ b/app/node/factory.h
@@ -76,6 +76,7 @@ public:
kMaskDistort,
kDropShadowFilter,
kTimeFormat,
+ kMulticamNode,
// Count value
kInternalNodeCount
diff --git a/app/node/input/CMakeLists.txt b/app/node/input/CMakeLists.txt
index 6de136173..ab2b3569e 100644
--- a/app/node/input/CMakeLists.txt
+++ b/app/node/input/CMakeLists.txt
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+add_subdirectory(multicam)
add_subdirectory(time)
add_subdirectory(value)
diff --git a/app/node/input/multicam/CMakeLists.txt b/app/node/input/multicam/CMakeLists.txt
new file mode 100644
index 000000000..fca12be16
--- /dev/null
+++ b/app/node/input/multicam/CMakeLists.txt
@@ -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 .
+
+set(OLIVE_SOURCES
+ ${OLIVE_SOURCES}
+ node/input/multicam/multicamnode.h
+ node/input/multicam/multicamnode.cpp
+ PARENT_SCOPE
+)
diff --git a/app/node/input/multicam/multicamnode.cpp b/app/node/input/multicam/multicamnode.cpp
index 0c1273cb5..827d035d8 100644
--- a/app/node/input/multicam/multicamnode.cpp
+++ b/app/node/input/multicam/multicamnode.cpp
@@ -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 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"));
+}
}
diff --git a/app/node/input/multicam/multicamnode.h b/app/node/input/multicam/multicamnode.h
index c21e7f6ca..d8895a7f5 100644
--- a/app/node/input/multicam/multicamnode.h
+++ b/app/node/input/multicam/multicamnode.h
@@ -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 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