Merge branch 'master' into new-audio-cache

This commit is contained in:
itsmattkc
2021-09-27 11:18:03 -07:00
4 changed files with 22 additions and 11 deletions
+4 -4
View File
@@ -95,10 +95,10 @@ void NodeGraph::childEvent(QChildEvent *event)
node_children_.append(node); node_children_.append(node);
// Connect signals // Connect signals
connect(node, &Node::InputConnected, this, &NodeGraph::InputConnected); connect(node, &Node::InputConnected, this, &NodeGraph::InputConnected, Qt::DirectConnection);
connect(node, &Node::InputDisconnected, this, &NodeGraph::InputDisconnected); connect(node, &Node::InputDisconnected, this, &NodeGraph::InputDisconnected, Qt::DirectConnection);
connect(node, &Node::ValueChanged, this, &NodeGraph::ValueChanged); connect(node, &Node::ValueChanged, this, &NodeGraph::ValueChanged, Qt::DirectConnection);
connect(node, &Node::InputValueHintChanged, this, &NodeGraph::InputValueHintChanged); connect(node, &Node::InputValueHintChanged, this, &NodeGraph::InputValueHintChanged, Qt::DirectConnection);
emit NodeAdded(node); emit NodeAdded(node);
emit node->AddedToGraph(this); emit node->AddedToGraph(this);
+6 -6
View File
@@ -887,12 +887,12 @@ void PreviewAutoCacher::SetViewerNode(ViewerOutput *viewer_node)
UpdateLastSyncedValue(); UpdateLastSyncedValue();
// Connect signals for future node additions/deletions // Connect signals for future node additions/deletions
connect(graph, &NodeGraph::NodeAdded, this, &PreviewAutoCacher::NodeAdded); connect(graph, &NodeGraph::NodeAdded, this, &PreviewAutoCacher::NodeAdded, Qt::DirectConnection);
connect(graph, &NodeGraph::NodeRemoved, this, &PreviewAutoCacher::NodeRemoved); connect(graph, &NodeGraph::NodeRemoved, this, &PreviewAutoCacher::NodeRemoved, Qt::DirectConnection);
connect(graph, &NodeGraph::InputConnected, this, &PreviewAutoCacher::EdgeAdded); connect(graph, &NodeGraph::InputConnected, this, &PreviewAutoCacher::EdgeAdded, Qt::DirectConnection);
connect(graph, &NodeGraph::InputDisconnected, this, &PreviewAutoCacher::EdgeRemoved); connect(graph, &NodeGraph::InputDisconnected, this, &PreviewAutoCacher::EdgeRemoved, Qt::DirectConnection);
connect(graph, &NodeGraph::ValueChanged, this, &PreviewAutoCacher::ValueChanged); connect(graph, &NodeGraph::ValueChanged, this, &PreviewAutoCacher::ValueChanged, Qt::DirectConnection);
connect(graph, &NodeGraph::InputValueHintChanged, this, &PreviewAutoCacher::ValueHintChanged); connect(graph, &NodeGraph::InputValueHintChanged, this, &PreviewAutoCacher::ValueHintChanged, Qt::DirectConnection);
connect(viewer_node_, connect(viewer_node_,
&ViewerOutput::VideoAutoCacheChanged, &ViewerOutput::VideoAutoCacheChanged,
+7
View File
@@ -980,6 +980,13 @@ void NodeView::OpenSelectedNodeInViewer()
void NodeView::RemoveNode(Node *node) void NodeView::RemoveNode(Node *node)
{ {
for (auto it=attached_items_.begin(); it!=attached_items_.end(); ) {
if (it->item->GetNode() == node) {
it = attached_items_.erase(it);
} else {
it++;
}
}
for (const Node::OutputConnection &oc : node->output_connections()) { for (const Node::OutputConnection &oc : node->output_connections()) {
scene_.RemoveEdge(oc.first, oc.second); scene_.RemoveEdge(oc.first, oc.second);
} }
+5 -1
View File
@@ -721,10 +721,13 @@ void PointerTool::InitiateDrag(Block *clicked_item,
TimelineViewGhostItem* PointerTool::AddGhostFromBlock(Block* block, Timeline::MovementMode mode, bool check_if_exists) TimelineViewGhostItem* PointerTool::AddGhostFromBlock(Block* block, Timeline::MovementMode mode, bool check_if_exists)
{ {
if (!block) { // Ignore null blocks or blocks that aren't attached to a track because there's nothing we can
// do with either of those
if (!block || !block->track()) {
return nullptr; return nullptr;
} }
// Check if we've already made a ghost for this block
if (check_if_exists) { if (check_if_exists) {
foreach (TimelineViewGhostItem* ghost, parent()->GetGhostItems()) { foreach (TimelineViewGhostItem* ghost, parent()->GetGhostItems()) {
if (Node::ValueToPtr<Block>(ghost->GetData(TimelineViewGhostItem::kAttachedBlock)) == block) { if (Node::ValueToPtr<Block>(ghost->GetData(TimelineViewGhostItem::kAttachedBlock)) == block) {
@@ -733,6 +736,7 @@ TimelineViewGhostItem* PointerTool::AddGhostFromBlock(Block* block, Timeline::Mo
} }
} }
// Otherwise, it's time to make a ghost for this block
TimelineViewGhostItem* ghost = TimelineViewGhostItem::FromBlock(block); TimelineViewGhostItem* ghost = TimelineViewGhostItem::FromBlock(block);
#ifdef HIDE_GAP_GHOSTS #ifdef HIDE_GAP_GHOSTS