change: change code style to Linux style except indent.
This commit is contained in:
@@ -2,172 +2,188 @@
|
||||
|
||||
#include "node/project/sequence/sequence.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super Node
|
||||
|
||||
const QString MultiCamNode::kCurrentInput = QStringLiteral("current_in");
|
||||
const QString MultiCamNode::kSourcesInput = QStringLiteral("sources_in");
|
||||
const QString MultiCamNode::kSequenceInput = QStringLiteral("sequence_in");
|
||||
const QString MultiCamNode::kSequenceTypeInput = QStringLiteral("sequence_type_in");
|
||||
const QString MultiCamNode::kSequenceTypeInput =
|
||||
QStringLiteral("sequence_type_in");
|
||||
|
||||
MultiCamNode::MultiCamNode()
|
||||
{
|
||||
AddInput(kCurrentInput, NodeValue::kCombo, InputFlags(kInputFlagStatic));
|
||||
AddInput(kCurrentInput, NodeValue::kCombo, InputFlags(kInputFlagStatic));
|
||||
|
||||
AddInput(kSourcesInput, NodeValue::kNone, InputFlags(kInputFlagNotKeyframable | kInputFlagArray));
|
||||
SetInputProperty(kSourcesInput, QStringLiteral("arraystart"), 1);
|
||||
AddInput(kSourcesInput, NodeValue::kNone,
|
||||
InputFlags(kInputFlagNotKeyframable | kInputFlagArray));
|
||||
SetInputProperty(kSourcesInput, QStringLiteral("arraystart"), 1);
|
||||
|
||||
AddInput(kSequenceInput, NodeValue::kNone, InputFlags(kInputFlagNotKeyframable));
|
||||
AddInput(kSequenceTypeInput, NodeValue::kCombo, InputFlags(kInputFlagStatic | kInputFlagHidden));
|
||||
AddInput(kSequenceInput, NodeValue::kNone,
|
||||
InputFlags(kInputFlagNotKeyframable));
|
||||
AddInput(kSequenceTypeInput, NodeValue::kCombo,
|
||||
InputFlags(kInputFlagStatic | kInputFlagHidden));
|
||||
|
||||
sequence_ = nullptr;
|
||||
sequence_ = nullptr;
|
||||
}
|
||||
|
||||
QString MultiCamNode::Name() const
|
||||
{
|
||||
return tr("Multi-Cam");
|
||||
return tr("Multi-Cam");
|
||||
}
|
||||
|
||||
QString MultiCamNode::id() const
|
||||
{
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.multicam");
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.multicam");
|
||||
}
|
||||
|
||||
QVector<Node::CategoryID> MultiCamNode::Category() const
|
||||
{
|
||||
return {kCategoryTimeline};
|
||||
return { kCategoryTimeline };
|
||||
}
|
||||
|
||||
QString MultiCamNode::Description() const
|
||||
{
|
||||
return tr("Allows easy switching between multiple sources.");
|
||||
return tr("Allows easy switching between multiple sources.");
|
||||
}
|
||||
|
||||
Node::ActiveElements MultiCamNode::GetActiveElementsAtTime(const QString &input, const TimeRange &r) const
|
||||
Node::ActiveElements
|
||||
MultiCamNode::GetActiveElementsAtTime(const QString &input,
|
||||
const TimeRange &r) const
|
||||
{
|
||||
if (input == kSourcesInput) {
|
||||
int src = GetCurrentSource();
|
||||
if (src >= 0 && src < GetSourceCount()) {
|
||||
Node::ActiveElements a;
|
||||
a.add(src);
|
||||
return a;
|
||||
} else {
|
||||
return ActiveElements::kNoElements;
|
||||
}
|
||||
} else {
|
||||
return super::GetActiveElementsAtTime(input, r);
|
||||
}
|
||||
if (input == kSourcesInput) {
|
||||
int src = GetCurrentSource();
|
||||
if (src >= 0 && src < GetSourceCount()) {
|
||||
Node::ActiveElements a;
|
||||
a.add(src);
|
||||
return a;
|
||||
} else {
|
||||
return ActiveElements::kNoElements;
|
||||
}
|
||||
} else {
|
||||
return super::GetActiveElementsAtTime(input, r);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiCamNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
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);
|
||||
}
|
||||
NodeValueArray arr = value[kSourcesInput].toArray();
|
||||
if (!arr.empty()) {
|
||||
table->Push(arr.begin()->second);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiCamNode::IndexToRowCols(int index, int total_rows, int total_cols, int *row, int *col)
|
||||
void MultiCamNode::IndexToRowCols(int index, int total_rows, int total_cols,
|
||||
int *row, int *col)
|
||||
{
|
||||
Q_UNUSED(total_rows)
|
||||
Q_UNUSED(total_rows)
|
||||
|
||||
*col = index%total_cols;
|
||||
*row = index/total_cols;
|
||||
*col = index % total_cols;
|
||||
*row = index / total_cols;
|
||||
}
|
||||
|
||||
Node *MultiCamNode::GetConnectedRenderOutput(const QString &input, int element) const
|
||||
Node *MultiCamNode::GetConnectedRenderOutput(const QString &input,
|
||||
int element) const
|
||||
{
|
||||
if (sequence_ && input == kSourcesInput && element >= 0 && element < GetSourceCount()) {
|
||||
return GetTrackList()->GetTrackAt(element);
|
||||
} else {
|
||||
return Node::GetConnectedRenderOutput(input, element);
|
||||
}
|
||||
if (sequence_ && input == kSourcesInput && element >= 0 &&
|
||||
element < GetSourceCount()) {
|
||||
return GetTrackList()->GetTrackAt(element);
|
||||
} else {
|
||||
return Node::GetConnectedRenderOutput(input, element);
|
||||
}
|
||||
}
|
||||
|
||||
bool MultiCamNode::IsInputConnectedForRender(const QString &input, int element) const
|
||||
bool MultiCamNode::IsInputConnectedForRender(const QString &input,
|
||||
int element) const
|
||||
{
|
||||
if (sequence_ && input == kSourcesInput && element >= 0 && element < GetSourceCount()) {
|
||||
return true;
|
||||
} else {
|
||||
return Node::IsInputConnectedForRender(input, element);
|
||||
}
|
||||
if (sequence_ && input == kSourcesInput && element >= 0 &&
|
||||
element < GetSourceCount()) {
|
||||
return true;
|
||||
} else {
|
||||
return Node::IsInputConnectedForRender(input, element);
|
||||
}
|
||||
}
|
||||
|
||||
QVector<QString> MultiCamNode::IgnoreInputsForRendering() const
|
||||
{
|
||||
return {kSequenceInput};
|
||||
return { kSequenceInput };
|
||||
}
|
||||
|
||||
void MultiCamNode::InputConnectedEvent(const QString &input, int element, Node *output)
|
||||
void MultiCamNode::InputConnectedEvent(const QString &input, int element,
|
||||
Node *output)
|
||||
{
|
||||
if (input == kSequenceInput) {
|
||||
if (Sequence *s = dynamic_cast<Sequence*>(output)) {
|
||||
SetInputFlag(kSequenceTypeInput, kInputFlagHidden, false);
|
||||
sequence_ = s;
|
||||
}
|
||||
}
|
||||
if (input == kSequenceInput) {
|
||||
if (Sequence *s = dynamic_cast<Sequence *>(output)) {
|
||||
SetInputFlag(kSequenceTypeInput, kInputFlagHidden, false);
|
||||
sequence_ = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MultiCamNode::InputDisconnectedEvent(const QString &input, int element, Node *output)
|
||||
void MultiCamNode::InputDisconnectedEvent(const QString &input, int element,
|
||||
Node *output)
|
||||
{
|
||||
if (input == kSequenceInput) {
|
||||
SetInputFlag(kSequenceTypeInput, kInputFlagHidden, true);
|
||||
sequence_ = nullptr;
|
||||
}
|
||||
if (input == kSequenceInput) {
|
||||
SetInputFlag(kSequenceTypeInput, kInputFlagHidden, true);
|
||||
sequence_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
TrackList *MultiCamNode::GetTrackList() const
|
||||
{
|
||||
return sequence_->track_list(static_cast<Track::Type>(GetStandardValue(kSequenceTypeInput).toInt()));
|
||||
return sequence_->track_list(
|
||||
static_cast<Track::Type>(GetStandardValue(kSequenceTypeInput).toInt()));
|
||||
}
|
||||
|
||||
void MultiCamNode::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
super::Retranslate();
|
||||
|
||||
SetInputName(kCurrentInput, tr("Current"));
|
||||
SetInputName(kSourcesInput, tr("Sources"));
|
||||
SetInputName(kSequenceInput, tr("Sequence"));
|
||||
SetInputName(kSequenceTypeInput, tr("Sequence Type"));
|
||||
SetComboBoxStrings(kSequenceTypeInput, {tr("Video"), tr("Audio")});
|
||||
SetInputName(kCurrentInput, tr("Current"));
|
||||
SetInputName(kSourcesInput, tr("Sources"));
|
||||
SetInputName(kSequenceInput, tr("Sequence"));
|
||||
SetInputName(kSequenceTypeInput, tr("Sequence Type"));
|
||||
SetComboBoxStrings(kSequenceTypeInput, { tr("Video"), tr("Audio") });
|
||||
|
||||
QStringList names;
|
||||
int name_count = GetSourceCount();
|
||||
names.reserve(name_count);
|
||||
for (int i=0; i<name_count; i++) {
|
||||
QString src_name;
|
||||
if (Node *n = GetConnectedRenderOutput(kSourcesInput, i)) {
|
||||
src_name = n->Name();
|
||||
}
|
||||
names.append(tr("%1: %2").arg(QString::number(i+1), src_name));
|
||||
}
|
||||
SetComboBoxStrings(kCurrentInput, names);
|
||||
QStringList names;
|
||||
int name_count = GetSourceCount();
|
||||
names.reserve(name_count);
|
||||
for (int i = 0; i < name_count; i++) {
|
||||
QString src_name;
|
||||
if (Node *n = GetConnectedRenderOutput(kSourcesInput, i)) {
|
||||
src_name = n->Name();
|
||||
}
|
||||
names.append(tr("%1: %2").arg(QString::number(i + 1), src_name));
|
||||
}
|
||||
SetComboBoxStrings(kCurrentInput, names);
|
||||
}
|
||||
|
||||
int MultiCamNode::GetSourceCount() const
|
||||
{
|
||||
if (sequence_) {
|
||||
return GetTrackList()->GetTrackCount();
|
||||
} else {
|
||||
return InputArraySize(kSourcesInput);
|
||||
}
|
||||
if (sequence_) {
|
||||
return GetTrackList()->GetTrackCount();
|
||||
} else {
|
||||
return InputArraySize(kSourcesInput);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiCamNode::GetRowsAndColumns(int sources, int *rows_in, int *cols_in)
|
||||
{
|
||||
int &rows = *rows_in;
|
||||
int &cols = *cols_in;
|
||||
int &rows = *rows_in;
|
||||
int &cols = *cols_in;
|
||||
|
||||
rows = 1;
|
||||
cols = 1;
|
||||
while (rows*cols < sources) {
|
||||
if (rows < cols) {
|
||||
rows++;
|
||||
} else {
|
||||
cols++;
|
||||
}
|
||||
}
|
||||
rows = 1;
|
||||
cols = 1;
|
||||
while (rows * cols < sources) {
|
||||
if (rows < cols) {
|
||||
rows++;
|
||||
} else {
|
||||
cols++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,73 +4,80 @@
|
||||
#include "node/node.h"
|
||||
#include "node/output/track/tracklist.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
class Sequence;
|
||||
|
||||
class MultiCamNode : public Node
|
||||
{
|
||||
Q_OBJECT
|
||||
class MultiCamNode : public Node {
|
||||
Q_OBJECT
|
||||
public:
|
||||
MultiCamNode();
|
||||
MultiCamNode();
|
||||
|
||||
NODE_DEFAULT_FUNCTIONS(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 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 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 Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
NodeValueTable *table) const override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
static const QString kCurrentInput;
|
||||
static const QString kSourcesInput;
|
||||
static const QString kSequenceInput;
|
||||
static const QString kSequenceTypeInput;
|
||||
static const QString kCurrentInput;
|
||||
static const QString kSourcesInput;
|
||||
static const QString kSequenceInput;
|
||||
static const QString kSequenceTypeInput;
|
||||
|
||||
int GetCurrentSource() const
|
||||
{
|
||||
return GetStandardValue(kCurrentInput).toInt();
|
||||
}
|
||||
int GetCurrentSource() const
|
||||
{
|
||||
return GetStandardValue(kCurrentInput).toInt();
|
||||
}
|
||||
|
||||
int GetSourceCount() const;
|
||||
int GetSourceCount() const;
|
||||
|
||||
static void GetRowsAndColumns(int sources, int *rows, int *cols);
|
||||
void GetRowsAndColumns(int *rows, int *cols) const
|
||||
{
|
||||
return GetRowsAndColumns(GetSourceCount(), rows, cols);
|
||||
}
|
||||
static void GetRowsAndColumns(int sources, int *rows, int *cols);
|
||||
void GetRowsAndColumns(int *rows, int *cols) const
|
||||
{
|
||||
return GetRowsAndColumns(GetSourceCount(), rows, cols);
|
||||
}
|
||||
|
||||
void SetSequenceType(Track::Type t)
|
||||
{
|
||||
SetStandardValue(kSequenceTypeInput, t);
|
||||
}
|
||||
void SetSequenceType(Track::Type t)
|
||||
{
|
||||
SetStandardValue(kSequenceTypeInput, t);
|
||||
}
|
||||
|
||||
static void IndexToRowCols(int index, int total_rows, int total_cols, int *row, int *col);
|
||||
static void IndexToRowCols(int index, int total_rows, int total_cols,
|
||||
int *row, int *col);
|
||||
|
||||
static int RowsColsToIndex(int row, int col, int total_rows, int total_cols)
|
||||
{
|
||||
return col + row * total_cols;
|
||||
}
|
||||
static int RowsColsToIndex(int row, int col, int total_rows, int total_cols)
|
||||
{
|
||||
return col + row * total_cols;
|
||||
}
|
||||
|
||||
virtual Node *GetConnectedRenderOutput(const QString& input, int element = -1) const override;
|
||||
virtual bool IsInputConnectedForRender(const QString& input, int element = -1) const override;
|
||||
virtual Node *GetConnectedRenderOutput(const QString &input,
|
||||
int element = -1) const override;
|
||||
virtual bool IsInputConnectedForRender(const QString &input,
|
||||
int element = -1) const override;
|
||||
|
||||
virtual QVector<QString> IgnoreInputsForRendering() const override;
|
||||
virtual QVector<QString> IgnoreInputsForRendering() const override;
|
||||
|
||||
protected:
|
||||
virtual void InputConnectedEvent(const QString &input, int element, Node *output) override;
|
||||
virtual void InputDisconnectedEvent(const QString &input, int element, Node *output) override;
|
||||
virtual void InputConnectedEvent(const QString &input, int element,
|
||||
Node *output) override;
|
||||
virtual void InputDisconnectedEvent(const QString &input, int element,
|
||||
Node *output) override;
|
||||
|
||||
private:
|
||||
TrackList *GetTrackList() const;
|
||||
|
||||
Sequence *sequence_;
|
||||
TrackList *GetTrackList() const;
|
||||
|
||||
Sequence *sequence_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
#include "timeinput.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
#define super Node
|
||||
|
||||
@@ -30,31 +31,29 @@ TimeInput::TimeInput()
|
||||
|
||||
QString TimeInput::Name() const
|
||||
{
|
||||
return tr("Time");
|
||||
return tr("Time");
|
||||
}
|
||||
|
||||
QString TimeInput::id() const
|
||||
{
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.time");
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.time");
|
||||
}
|
||||
|
||||
QVector<Node::CategoryID> TimeInput::Category() const
|
||||
{
|
||||
return {kCategoryTime};
|
||||
return { kCategoryTime };
|
||||
}
|
||||
|
||||
QString TimeInput::Description() const
|
||||
{
|
||||
return tr("Generates the time (in seconds) at this frame.");
|
||||
return tr("Generates the time (in seconds) at this frame.");
|
||||
}
|
||||
|
||||
void TimeInput::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
void TimeInput::Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
NodeValueTable *table) const
|
||||
{
|
||||
table->Push(NodeValue::kFloat,
|
||||
globals.time().in().toDouble(),
|
||||
this,
|
||||
false,
|
||||
QStringLiteral("time"));
|
||||
table->Push(NodeValue::kFloat, globals.time().in().toDouble(), this, false,
|
||||
QStringLiteral("time"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,23 +23,23 @@
|
||||
|
||||
#include "node/node.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class TimeInput : public Node
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class TimeInput : public Node {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TimeInput();
|
||||
TimeInput();
|
||||
|
||||
NODE_DEFAULT_FUNCTIONS(TimeInput)
|
||||
NODE_DEFAULT_FUNCTIONS(TimeInput)
|
||||
|
||||
virtual QString Name() const override;
|
||||
virtual QString id() const override;
|
||||
virtual QVector<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual void Value(const NodeValueRow& value, const NodeGlobals &globals, NodeValueTable *table) const override;
|
||||
virtual QString Name() const override;
|
||||
virtual QString id() const override;
|
||||
virtual QVector<CategoryID> Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
NodeValueTable *table) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,63 +20,62 @@
|
||||
|
||||
#include "valuenode.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
const QString ValueNode::kTypeInput = QStringLiteral("type_in");
|
||||
const QString ValueNode::kValueInput = QStringLiteral("value_in");
|
||||
const QVector<NodeValue::Type> ValueNode::kSupportedTypes = {
|
||||
NodeValue::kFloat,
|
||||
NodeValue::kInt,
|
||||
NodeValue::kRational,
|
||||
NodeValue::kVec2,
|
||||
NodeValue::kVec3,
|
||||
NodeValue::kVec4,
|
||||
NodeValue::kColor,
|
||||
NodeValue::kText,
|
||||
NodeValue::kMatrix,
|
||||
NodeValue::kFont,
|
||||
NodeValue::kBoolean,
|
||||
NodeValue::kFloat, NodeValue::kInt, NodeValue::kRational,
|
||||
NodeValue::kVec2, NodeValue::kVec3, NodeValue::kVec4,
|
||||
NodeValue::kColor, NodeValue::kText, NodeValue::kMatrix,
|
||||
NodeValue::kFont, NodeValue::kBoolean,
|
||||
};
|
||||
|
||||
#define super Node
|
||||
|
||||
ValueNode::ValueNode()
|
||||
{
|
||||
AddInput(kTypeInput, NodeValue::kCombo, 0, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
|
||||
AddInput(kTypeInput, NodeValue::kCombo, 0,
|
||||
InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
|
||||
|
||||
AddInput(kValueInput, kSupportedTypes.first(), QVariant(), InputFlags(kInputFlagNotConnectable));
|
||||
AddInput(kValueInput, kSupportedTypes.first(), QVariant(),
|
||||
InputFlags(kInputFlagNotConnectable));
|
||||
}
|
||||
|
||||
void ValueNode::Retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
super::Retranslate();
|
||||
|
||||
SetInputName(kTypeInput, QStringLiteral("Type"));
|
||||
SetInputName(kValueInput, QStringLiteral("Value"));
|
||||
SetInputName(kTypeInput, QStringLiteral("Type"));
|
||||
SetInputName(kValueInput, QStringLiteral("Value"));
|
||||
|
||||
QStringList type_names;
|
||||
type_names.reserve(kSupportedTypes.size());
|
||||
foreach (NodeValue::Type type, kSupportedTypes) {
|
||||
type_names.append(NodeValue::GetPrettyDataTypeName(type));
|
||||
}
|
||||
SetComboBoxStrings(kTypeInput, type_names);
|
||||
QStringList type_names;
|
||||
type_names.reserve(kSupportedTypes.size());
|
||||
foreach (NodeValue::Type type, kSupportedTypes) {
|
||||
type_names.append(NodeValue::GetPrettyDataTypeName(type));
|
||||
}
|
||||
SetComboBoxStrings(kTypeInput, type_names);
|
||||
}
|
||||
|
||||
void ValueNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
|
||||
void ValueNode::Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
NodeValueTable *table) const
|
||||
{
|
||||
Q_UNUSED(globals)
|
||||
Q_UNUSED(globals)
|
||||
|
||||
// Ensure value is pushed onto the table
|
||||
table->Push(value[kValueInput]);
|
||||
// Ensure value is pushed onto the table
|
||||
table->Push(value[kValueInput]);
|
||||
}
|
||||
|
||||
void ValueNode::InputValueChangedEvent(const QString &input, int element)
|
||||
{
|
||||
if (input == kTypeInput) {
|
||||
SetInputDataType(kValueInput, kSupportedTypes.at(GetStandardValue(kTypeInput).toInt()));
|
||||
}
|
||||
if (input == kTypeInput) {
|
||||
SetInputDataType(
|
||||
kValueInput,
|
||||
kSupportedTypes.at(GetStandardValue(kTypeInput).toInt()));
|
||||
}
|
||||
|
||||
super::InputValueChangedEvent(input, element);
|
||||
super::InputValueChangedEvent(input, element);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,49 +23,51 @@
|
||||
|
||||
#include "node/node.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class ValueNode : public Node
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class ValueNode : public Node {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ValueNode();
|
||||
ValueNode();
|
||||
|
||||
NODE_DEFAULT_FUNCTIONS(ValueNode)
|
||||
NODE_DEFAULT_FUNCTIONS(ValueNode)
|
||||
|
||||
virtual QString Name() const override
|
||||
{
|
||||
return tr("Value");
|
||||
}
|
||||
virtual QString Name() const override
|
||||
{
|
||||
return tr("Value");
|
||||
}
|
||||
|
||||
virtual QString id() const override
|
||||
{
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.value");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
return QStringLiteral("org.olivevideoeditor.Olive.value");
|
||||
}
|
||||
|
||||
virtual QVector<CategoryID> Category() const override
|
||||
{
|
||||
return {kCategoryGenerator};
|
||||
}
|
||||
virtual QVector<CategoryID> Category() const override
|
||||
{
|
||||
return { kCategoryGenerator };
|
||||
}
|
||||
|
||||
virtual QString Description() const override
|
||||
{
|
||||
return tr("Create a single value that can be connected to various other inputs.");
|
||||
}
|
||||
virtual QString Description() const override
|
||||
{
|
||||
return tr(
|
||||
"Create a single value that can be connected to various other inputs.");
|
||||
}
|
||||
|
||||
static const QString kTypeInput;
|
||||
static const QString kValueInput;
|
||||
static const QString kTypeInput;
|
||||
static const QString kValueInput;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual void Value(const NodeValueRow& value, const NodeGlobals &globals, NodeValueTable *table) const override;
|
||||
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
NodeValueTable *table) const override;
|
||||
|
||||
protected:
|
||||
virtual void InputValueChangedEvent(const QString &input, int element) override;
|
||||
virtual void InputValueChangedEvent(const QString &input,
|
||||
int element) override;
|
||||
|
||||
private:
|
||||
static const QVector<NodeValue::Type> kSupportedTypes;
|
||||
|
||||
static const QVector<NodeValue::Type> kSupportedTypes;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user