Add missing param instance types (String, Double3D/Integer3D, Group/Page, Custom/Bytes) and mapping to node inputs. app/pluginSupport/OlivePluginInstance.cpp, app/node/plugins/Plugin.cpp
This commit is contained in:
@@ -196,6 +196,8 @@ NodeParamViewItemBody::NodeParamViewItemBody(
|
||||
QGridLayout *root_layout = new QGridLayout(this);
|
||||
|
||||
int insert_row = 0;
|
||||
QString current_page;
|
||||
QString current_group;
|
||||
|
||||
QVector<Node *> connected_signals;
|
||||
|
||||
@@ -219,6 +221,27 @@ NodeParamViewItemBody::NodeParamViewItemBody(
|
||||
{ n, input });
|
||||
|
||||
if (!(n->GetInputFlags(input) & kInputFlagHidden)) {
|
||||
QString page_label = n->GetInputProperty(input, QStringLiteral("ui_page")).toString();
|
||||
QString group_label = n->GetInputProperty(input, QStringLiteral("ui_group")).toString();
|
||||
if (!page_label.isEmpty() && page_label != current_page) {
|
||||
QLabel *page_title = new QLabel(page_label, this);
|
||||
QFont f = page_title->font();
|
||||
f.setBold(true);
|
||||
page_title->setFont(f);
|
||||
root_layout->addWidget(page_title, insert_row, 0, 1, 10);
|
||||
insert_row++;
|
||||
current_page = page_label;
|
||||
current_group.clear();
|
||||
}
|
||||
if (!group_label.isEmpty() && group_label != current_group) {
|
||||
QLabel *group_title = new QLabel(group_label, this);
|
||||
QFont f = group_title->font();
|
||||
f.setBold(true);
|
||||
group_title->setFont(f);
|
||||
root_layout->addWidget(group_title, insert_row, 0, 1, 10);
|
||||
insert_row++;
|
||||
current_group = group_label;
|
||||
}
|
||||
CreateWidgets(root_layout, n, input, -1, insert_row);
|
||||
|
||||
insert_row++;
|
||||
|
||||
@@ -261,9 +261,16 @@ void NodeParamViewWidgetBridge::WidgetCallback()
|
||||
case NodeValue::kVideoParams:
|
||||
case NodeValue::kAudioParams:
|
||||
case NodeValue::kSubtitleParams:
|
||||
case NodeValue::kBinary:
|
||||
case NodeValue::kDataTypeCount:
|
||||
break;
|
||||
case NodeValue::kBinary: {
|
||||
NodeParamViewTextEdit *line_edit =
|
||||
new NodeParamViewTextEdit(parent);
|
||||
widgets_.append(line_edit);
|
||||
connect(line_edit, &NodeParamViewTextEdit::textEdited, this,
|
||||
&NodeParamViewWidgetBridge::WidgetCallback);
|
||||
break;
|
||||
}
|
||||
case NodeValue::kInt: {
|
||||
// Widget is a IntegerSlider
|
||||
IntegerSlider *slider = static_cast<IntegerSlider *>(sender());
|
||||
@@ -342,6 +349,16 @@ void NodeParamViewWidgetBridge::WidgetCallback()
|
||||
0);
|
||||
break;
|
||||
}
|
||||
case NodeValue::kBinary: {
|
||||
QString text = static_cast<NodeParamViewTextEdit *>(sender())->text();
|
||||
QByteArray raw = text.toUtf8();
|
||||
QByteArray decoded = QByteArray::fromBase64(raw);
|
||||
if (decoded.isEmpty() && !raw.isEmpty()) {
|
||||
decoded = raw;
|
||||
}
|
||||
SetInputValue(decoded, 0);
|
||||
break;
|
||||
}
|
||||
case NodeValue::kBoolean: {
|
||||
// Widget is a QCheckBox
|
||||
SetInputValue(static_cast<QCheckBox *>(sender())->isChecked(), 0);
|
||||
@@ -440,9 +457,15 @@ void NodeParamViewWidgetBridge::UpdateWidgetValues()
|
||||
case NodeValue::kVideoParams:
|
||||
case NodeValue::kAudioParams:
|
||||
case NodeValue::kSubtitleParams:
|
||||
case NodeValue::kBinary:
|
||||
case NodeValue::kDataTypeCount:
|
||||
break;
|
||||
case NodeValue::kBinary: {
|
||||
NodeParamViewTextEdit *e =
|
||||
static_cast<NodeParamViewTextEdit *>(widgets_.first());
|
||||
QByteArray bytes = GetInnerInput().GetValueAtTime(node_time).toByteArray();
|
||||
e->setTextPreservingCursor(QString::fromUtf8(bytes.toBase64()));
|
||||
break;
|
||||
}
|
||||
case NodeValue::kInt: {
|
||||
static_cast<IntegerSlider *>(widgets_.first())
|
||||
->SetValue(GetInnerInput().GetValueAtTime(node_time).toLongLong());
|
||||
|
||||
Reference in New Issue
Block a user