Skip to content

Commit a39f407

Browse files
committed
Lift requirement that sinks terminate a signal chain.
These changes make it so that sinks can be placed in the middle of a signal chain, similar to how filters currently behave. Other changes include: - Simplified logic for drawing GraphView - New aesthetics for GraphView - Fixed bugs when moving around Splitters or Mergers - Add a threshold for dragging editors, to avoid accidentally triggering a "MOVE" event
1 parent c9cb133 commit a39f407

6 files changed

Lines changed: 239 additions & 202 deletions

File tree

Source/Processors/GenericProcessor/GenericProcessor.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -176,30 +176,30 @@ void GenericProcessor::setSourceNode(GenericProcessor* sn)
176176
{
177177
// std::cout << " The source is not blank." << std::endl;
178178

179-
if (!sn->isSink())
180-
{
179+
//if (!sn->isSink())
180+
//{
181181
// std::cout << " The source is not a sink." << std::endl;
182-
if (sourceNode != sn)
183-
{
184-
// std::cout << " The source is new and named " << sn->getName() << std::endl;
182+
if (sourceNode != sn)
183+
{
184+
// std::cout << " The source is new and named " << sn->getName() << std::endl;
185185

186-
if (this->isMerger())
187-
setMergerSourceNode(sn);
188-
else
189-
sourceNode = sn;
186+
if (this->isMerger())
187+
setMergerSourceNode(sn);
188+
else
189+
sourceNode = sn;
190190

191-
sn->setDestNode(this);
192-
}
193-
else
194-
{
195-
// std::cout << " The source node is not new." << std::endl;
196-
}
197-
}
198-
else
199-
{
191+
sn->setDestNode(this);
192+
}
193+
//else
194+
//{
195+
// std::cout << " The source node is not new." << std::endl;
196+
//}
197+
//}
198+
//else
199+
//{
200200
// std::cout << " The source is a sink." << std::endl;
201-
sourceNode = 0;
202-
}
201+
// sourceNode = 0;
202+
//}
203203

204204
}
205205
else
@@ -222,8 +222,8 @@ void GenericProcessor::setDestNode(GenericProcessor* dn)
222222
{
223223
// std::cout << "My name is " << getName() << ". Setting dest node." << std::endl;
224224

225-
if (!isSink())
226-
{
225+
//if (!isSink())
226+
//{
227227
// std::cout << " I am not a sink." << std::endl;
228228

229229
if (dn != 0)
@@ -262,13 +262,13 @@ void GenericProcessor::setDestNode(GenericProcessor* dn)
262262

263263
destNode = 0;
264264
}
265-
}
266-
else
267-
{
265+
//}
266+
//else
267+
//{
268268
//std::cout << " I am a sink, I can't have a dest node." << std::endl;
269269
//if (dn != 0)
270270
// dn->setSourceNode(this);
271-
}
271+
//}
272272
}
273273

274274

@@ -381,10 +381,10 @@ void GenericProcessor::update()
381381
createSpikeChannels();
382382
createConfigurationObjects();
383383

384-
if (this->isSink())
385-
{
386-
settings.numOutputs = 0;
387-
}
384+
//if (this->isSink())
385+
//{
386+
// settings.numOutputs = 0;
387+
//}
388388

389389
updateSettings(); // allow processors to change custom settings
390390

Source/Processors/Merger/MergerEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void MergerEditor::mouseDown(const MouseEvent& e)
138138

139139
for (i = 0; i < availableProcessors.size(); i++)
140140
{
141-
if (!availableProcessors[i]->isSink() &&
141+
if (//!availableProcessors[i]->isSink() &&
142142
!availableProcessors[i]->isMerger() &&
143143
!availableProcessors[i]->isSplitter() &&
144144
availableProcessors[i]->getDestNode() != getProcessor())

Source/UI/EditorViewport.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,9 @@ void EditorViewport::mouseDrag(const MouseEvent& e)
845845
if (editorArray.contains((GenericEditor*) e.originalComponent)
846846
&& e.y < 15
847847
&& canEdit
848-
&& editorArray.size() > 1)
848+
&& editorArray.size() > 1
849+
&& e.getDistanceFromDragStart() > 10
850+
)
849851
{
850852

851853
componentWantsToMove = true;

0 commit comments

Comments
 (0)