groups: started revision

- Removed UUIDs since we already have ptrs
- Changed input passthroughs from map to list so they'll always be added in the same order
- Fixed group copy on duplication
- Fixed group copy on clip split
This commit is contained in:
itsmattkc
2022-04-03 19:18:39 -07:00
parent 49e622ac0f
commit afaf6bcf92
12 changed files with 174 additions and 82 deletions
+27 -7
View File
@@ -52,9 +52,9 @@ public:
void SetOutputPassthrough(Node *node);
static QString GetGroupInputIDFromInput(const NodeInput &input);
const QHash<QString, NodeInput> &GetInputPassthroughs() const
using InputPassthrough = QPair<QString, NodeInput>;
using InputPassthroughs = QVector<InputPassthrough>;
const InputPassthroughs &GetInputPassthroughs() const
{
return input_passthroughs_;
}
@@ -66,15 +66,35 @@ public:
static NodeInput ResolveInput(NodeInput input);
static bool GetInner(NodeInput *input);
QString GetIDOfPassthrough(const NodeInput &input) const
{
for (auto it=input_passthroughs_.cbegin(); it!=input_passthroughs_.cend(); it++) {
if (it->second == input) {
return it->first;
}
}
return QString();
}
NodeInput GetInputFromID(const QString &id) const
{
for (auto it=input_passthroughs_.cbegin(); it!=input_passthroughs_.cend(); it++) {
if (it->first == id) {
return it->second;
}
}
return NodeInput();
}
signals:
void InputPassthroughAdded(NodeGroup *group, const NodeInput &input);
void InputPassthroughAdded(olive::NodeGroup *group, const olive::NodeInput &input);
void InputPassthroughRemoved(NodeGroup *group, const NodeInput &input);
void InputPassthroughRemoved(olive::NodeGroup *group, const olive::NodeInput &input);
void OutputPassthroughChanged(NodeGroup *group, Node *output);
void OutputPassthroughChanged(olive::NodeGroup *group, olive::Node *output);
private:
QHash<QString, NodeInput> input_passthroughs_;
InputPassthroughs input_passthroughs_;
Node *output_passthrough_;