node socket UI

This commit is contained in:
itsmattkc
2019-04-11 11:48:20 +10:00
parent 358d1ba16a
commit 1285d70c62
14 changed files with 103 additions and 11 deletions
+10
View File
@@ -60,6 +60,11 @@ void EffectRow::AddField(EffectField *field)
fields_.append(field);
}
void EffectRow::AddNodeInput(olive::nodes::DataType type)
{
accepted_datatypes_.append(type);
}
bool EffectRow::IsKeyframing() {
return keyframing_;
}
@@ -102,6 +107,11 @@ void EffectRow::SetEnabled(bool enabled)
}
}
bool EffectRow::CanConnectNodes()
{
return !accepted_datatypes_.isEmpty();
}
void EffectRow::SetKeyframingEnabled(bool enabled) {
if (enabled == keyframing_) {
return;
+28
View File
@@ -211,6 +211,17 @@ public:
*/
void SetEnabled(bool enabled);
/**
* @brief Check if nodes can be connected to this input.
*
* Connecting is enabled by adding an accepted node input using AddNodeInput().
*
* @return
*
* TRUE if nodes can be connected.
*/
bool CanConnectNodes();
protected:
/**
* @brief Add a field to this row
@@ -224,6 +235,18 @@ protected:
*/
void AddField(EffectField* Field);
/**
* @brief Adds a node data type that can be accepted by this input
*
* Allows this input to take a node connection from a data type specified by type. An input can take several data
* types.
*
* @param type
*
* The data type to add
*/
void AddNodeInput(olive::nodes::DataType type);
public slots:
/**
* @brief Go to previous keyframe
@@ -340,6 +363,11 @@ private:
* get freed automatically.
*/
QVector<EffectField*> fields_;
/**
* @brief Internal array of accepted node data types
*/
QVector<olive::nodes::DataType> accepted_datatypes_;
};
#endif // EFFECTROW_H