@@ -143,8 +143,37 @@ void PatchObject::update(map<int,shared_ptr<PatchObject>> &patchObjects, pdsp::E
143143 if (!outPut[i]->isDisabled && outPut[i]->fromOutletID == out && patchObjects[outPut[i]->toObjectID ]!=nullptr && !patchObjects[outPut[i]->toObjectID ]->getWillErase ()){
144144 outPut[i]->posFrom = getOutletPosition (out);
145145 outPut[i]->posTo = patchObjects[outPut[i]->toObjectID ]->getInletPosition (outPut[i]->toInletID );
146+
147+ // check first if link is deactivated by shift click
148+ outPut[i]->isDeactivated = false ;
149+ for (size_t di=0 ;di<linksDeactivated.size ();di++){
150+ if (outPut[i]->id == linksDeactivated.at (di)){
151+ outPut[i]->isDeactivated = true ;
152+ break ;
153+ }
154+ }
146155 // send data through links
147- patchObjects[outPut[i]->toObjectID ]->_inletParams [outPut[i]->toInletID ] = _outletParams[out];
156+ if (!outPut[i]->isDeactivated ){
157+ patchObjects[outPut[i]->toObjectID ]->inletsConnected [outPut[i]->toInletID ] = true ;
158+ if (outPut[i]->type == VP_LINK_AUDIO && patchObjects[outPut[i]->toObjectID ]->getIsPDSPPatchableObject ()){
159+ if (this ->getIsPDSPPatchableObject () || this ->getName () == " audio device" ){
160+ this ->pdspOut [outPut[i]->fromOutletID ] >> patchObjects[outPut[i]->toObjectID ]->pdspIn [outPut[i]->toInletID ];
161+ }
162+ }else if (outPut[i]->type == VP_LINK_TEXTURE){
163+ // TODO
164+ }
165+ patchObjects[outPut[i]->toObjectID ]->_inletParams [outPut[i]->toInletID ] = _outletParams[out];
166+ }else {
167+ patchObjects[outPut[i]->toObjectID ]->inletsConnected [outPut[i]->toInletID ] = false ;
168+ if (outPut[i]->type == VP_LINK_AUDIO){
169+ if (patchObjects[outPut[i]->toObjectID ]->getIsPDSPPatchableObject () && patchObjects[outPut[i]->toObjectID ]->pdspIn [outPut[i]->toInletID ].getInputsList ().size () > 0 ){
170+ patchObjects[outPut[i]->toObjectID ]->pdspIn [outPut[i]->toInletID ].disconnectIn ();
171+ }
172+ }else if (outPut[i]->type == VP_LINK_TEXTURE){
173+ // TODO
174+ }
175+
176+ }
148177 }
149178 }
150179 }
@@ -303,7 +332,10 @@ void PatchObject::drawImGuiNode(ImGuiEx::NodeCanvas& _nodeCanvas, map<int,shared
303332
304333
305334 // Refresh links to eventually disconnect ( backspace key )
306- linksToDisconnect = _nodeCanvas.getSelectedLinks ();
335+ linksToDisconnect = _nodeCanvas.getSelectedLinks ();
336+
337+ // Refresh links deactivated
338+ linksDeactivated = _nodeCanvas.getDeactivatedLinks ();
307339
308340 // Refresh objects selected to eventually duplicate or delete ( cmd-d or backsapce )
309341 objectsSelected = _nodeCanvas.getSelectedNodes ();
@@ -392,6 +424,7 @@ bool PatchObject::connectTo(map<int,shared_ptr<PatchObject>> &patchObjects, int
392424 tempLink->toObjectID = this ->getId ();
393425 tempLink->toInletID = toInlet;
394426 tempLink->isDisabled = false ;
427+ tempLink->isDeactivated = false ;
395428
396429 patchObjects[fromObjectID]->outPut .push_back (tempLink);
397430
0 commit comments