nodes: remove user input mutexes
These were no longer ever used and thus served no purpose.
This commit is contained in:
+3
-3
@@ -869,7 +869,7 @@ void NodeInput::set_maximum(const QVariant &max)
|
||||
has_maximum_ = true;
|
||||
}
|
||||
|
||||
void NodeInput::CopyValues(NodeInput *source, NodeInput *dest, bool include_connections, bool lock_connections)
|
||||
void NodeInput::CopyValues(NodeInput *source, NodeInput *dest, bool include_connections)
|
||||
{
|
||||
Q_ASSERT(source->id() == dest->id());
|
||||
|
||||
@@ -889,7 +889,7 @@ void NodeInput::CopyValues(NodeInput *source, NodeInput *dest, bool include_conn
|
||||
|
||||
// Copy connections
|
||||
if (include_connections && source->get_connected_output() != nullptr) {
|
||||
ConnectEdge(source->get_connected_output(), dest, lock_connections);
|
||||
ConnectEdge(source->get_connected_output(), dest);
|
||||
}
|
||||
|
||||
// If these inputs are an array, copy the subparams too
|
||||
@@ -897,7 +897,7 @@ void NodeInput::CopyValues(NodeInput *source, NodeInput *dest, bool include_conn
|
||||
NodeInputArray* src_array = static_cast<NodeInputArray*>(source);
|
||||
NodeInputArray* dst_array = static_cast<NodeInputArray*>(dest);
|
||||
|
||||
dst_array->SetSize(src_array->GetSize(), lock_connections);
|
||||
dst_array->SetSize(src_array->GetSize());
|
||||
|
||||
for (int i=0;i<dst_array->GetSize();i++) {
|
||||
CopyValues(src_array->At(i), dst_array->At(i), include_connections);
|
||||
|
||||
+1
-1
@@ -227,7 +227,7 @@ public:
|
||||
/**
|
||||
* @brief Copy all values including keyframe information and connections from another NodeInput
|
||||
*/
|
||||
static void CopyValues(NodeInput* source, NodeInput* dest, bool include_connections = true, bool lock_connections = true);
|
||||
static void CopyValues(NodeInput* source, NodeInput* dest, bool include_connections = true);
|
||||
|
||||
QVector<QVariant> split_normal_value_into_track_values(const QVariant &value) const;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ void NodeInputArray::Prepend()
|
||||
InsertAt(0);
|
||||
}
|
||||
|
||||
void NodeInputArray::SetSize(int size, bool lock)
|
||||
void NodeInputArray::SetSize(int size)
|
||||
{
|
||||
int old_size = GetSize();
|
||||
|
||||
@@ -42,9 +42,6 @@ void NodeInputArray::SetSize(int size, bool lock)
|
||||
}
|
||||
}
|
||||
|
||||
if (lock)
|
||||
parentNode()->LockUserInput();
|
||||
|
||||
sub_params_.resize(size);
|
||||
|
||||
if (size > old_size) {
|
||||
@@ -65,9 +62,6 @@ void NodeInputArray::SetSize(int size, bool lock)
|
||||
}
|
||||
}
|
||||
|
||||
if (lock)
|
||||
parentNode()->UnlockUserInput();
|
||||
|
||||
emit SizeChanged(size);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
void InsertAt(int index);
|
||||
void RemoveLast();
|
||||
void RemoveAt(int index);
|
||||
void SetSize(int size, bool lock = true);
|
||||
void SetSize(int size);
|
||||
|
||||
bool ContainsSubParameter(NodeInput* input) const;
|
||||
int IndexOfSubParameter(NodeInput* input) const;
|
||||
|
||||
+1
-11
@@ -220,16 +220,6 @@ QString Node::ReadFileAsString(const QString &filename)
|
||||
return file_data;
|
||||
}
|
||||
|
||||
void Node::LockUserInput()
|
||||
{
|
||||
user_input_lock_.lock();
|
||||
}
|
||||
|
||||
void Node::UnlockUserInput()
|
||||
{
|
||||
user_input_lock_.unlock();
|
||||
}
|
||||
|
||||
void Node::CopyInputs(Node *source, Node *destination, bool include_connections)
|
||||
{
|
||||
Q_ASSERT(source->id() == destination->id());
|
||||
@@ -245,7 +235,7 @@ void Node::CopyInputs(Node *source, Node *destination, bool include_connections)
|
||||
|
||||
NodeInput* dst = static_cast<NodeInput*>(dst_param.at(i));
|
||||
|
||||
NodeInput::CopyValues(src, dst, include_connections, true);
|
||||
NodeInput::CopyValues(src, dst, include_connections);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,12 +248,6 @@ public:
|
||||
|
||||
virtual TimeRange InputTimeAdjustment(NodeInput* input, const TimeRange& input_time) const;
|
||||
|
||||
/**
|
||||
* @brief User input lock prevents any user changes while a graph is being rendered
|
||||
*/
|
||||
void LockUserInput();
|
||||
void UnlockUserInput();
|
||||
|
||||
/**
|
||||
* @brief Copies inputs from from Node to another including connections
|
||||
*
|
||||
@@ -374,11 +368,6 @@ private:
|
||||
|
||||
QList<NodeParam *> params_;
|
||||
|
||||
/**
|
||||
* @brief Used for thread safety from main thread
|
||||
*/
|
||||
QMutex user_input_lock_;
|
||||
|
||||
/**
|
||||
* @brief Internal variable for whether this Node can be deleted or not
|
||||
*/
|
||||
|
||||
+2
-22
@@ -114,7 +114,7 @@ void NodeParam::DisconnectAll()
|
||||
}
|
||||
}
|
||||
|
||||
NodeEdgePtr NodeParam::ConnectEdge(NodeOutput *output, NodeInput *input, bool lock)
|
||||
NodeEdgePtr NodeParam::ConnectEdge(NodeOutput *output, NodeInput *input)
|
||||
{
|
||||
if (!input->IsConnectable()) {
|
||||
return nullptr;
|
||||
@@ -139,43 +139,23 @@ NodeEdgePtr NodeParam::ConnectEdge(NodeOutput *output, NodeInput *input, bool lo
|
||||
// that's difficult to diagnose. This makes that issue very clear.
|
||||
Q_ASSERT(output->parentNode() != input->parentNode());
|
||||
|
||||
if (lock) {
|
||||
output->parentNode()->LockUserInput();
|
||||
input->parentNode()->LockUserInput();
|
||||
}
|
||||
|
||||
output->edges_.append(edge);
|
||||
input->edges_.append(edge);
|
||||
|
||||
if (lock) {
|
||||
output->parentNode()->UnlockUserInput();
|
||||
input->parentNode()->UnlockUserInput();
|
||||
}
|
||||
|
||||
// Emit a signal than an edge was added (only one signal needs emitting)
|
||||
emit input->EdgeAdded(edge);
|
||||
|
||||
return edge;
|
||||
}
|
||||
|
||||
void NodeParam::DisconnectEdge(NodeEdgePtr edge, bool lock)
|
||||
void NodeParam::DisconnectEdge(NodeEdgePtr edge)
|
||||
{
|
||||
NodeOutput* output = edge->output();
|
||||
NodeInput* input = edge->input();
|
||||
|
||||
if (lock) {
|
||||
output->parentNode()->LockUserInput();
|
||||
input->parentNode()->LockUserInput();
|
||||
}
|
||||
|
||||
output->edges_.removeOne(edge);
|
||||
input->edges_.removeOne(edge);
|
||||
|
||||
if (lock) {
|
||||
output->parentNode()->UnlockUserInput();
|
||||
input->parentNode()->UnlockUserInput();
|
||||
}
|
||||
|
||||
emit input->EdgeRemoved(edge);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -316,7 +316,7 @@ public:
|
||||
*
|
||||
* This function emits EdgeAdded().
|
||||
*/
|
||||
static NodeEdgePtr ConnectEdge(NodeOutput *output, NodeInput *input, bool lock = true);
|
||||
static NodeEdgePtr ConnectEdge(NodeOutput *output, NodeInput *input);
|
||||
|
||||
/**
|
||||
* @brief Disconnect an edge
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
*
|
||||
* Edge to disconnect.
|
||||
*/
|
||||
static void DisconnectEdge(NodeEdgePtr edge, bool lock = true);
|
||||
static void DisconnectEdge(NodeEdgePtr edge);
|
||||
|
||||
/**
|
||||
* @brief Disconnect an edge
|
||||
|
||||
Reference in New Issue
Block a user