@@ -144,7 +144,6 @@ async function reconectAll() {
144
144
disconnectAll ( ) ;
145
145
connectAll ( ) ;
146
146
}
147
-
148
147
/**
149
148
* Disconnects all plugin outputs
150
149
*
@@ -322,7 +321,30 @@ function removePluginAt(index, skipReconnect = false) {
322
321
323
322
notifySubscribers ( "rack" , rack ) ;
324
323
325
- if ( settings . AUTO_RECONNECT && ! skipReconnect ) reconectAll ( ) ;
324
+ // if (settings.AUTO_RECONNECT && !skipReconnect) reconectAll();
325
+ if ( settings . AUTO_RECONNECT && ! skipReconnect ) {
326
+ if ( rack . length === 0 ) {
327
+ return ;
328
+ }
329
+
330
+ let previous = "" ;
331
+ let next = "" ;
332
+ let previousLength = rack . length + 1 ;
333
+
334
+ // If we deleted first item
335
+ if ( index === 0 ) {
336
+ previous = "input" ;
337
+ next = rack [ 0 ] ;
338
+ } // If we deleted last item
339
+ else if ( index === previousLength - 1 ) {
340
+ previous = rack [ rack . length - 1 ] ;
341
+ next = "output" ;
342
+ } else {
343
+ previous = rack [ index - 1 ] ;
344
+ next = rack [ index ] ;
345
+ }
346
+ Jack . connectPlugins ( previous , next , false , false ) ;
347
+ }
326
348
}
327
349
328
350
/**
@@ -363,14 +385,11 @@ function moveRackItem(rackIndex, direction, max = false) {
363
385
// store.wlogError(`${rackIndex} => ${direction} => ${max}`);
364
386
// TODO: This could be better but for now we will disconnect and reconnect everything.
365
387
366
- if ( settings . AUTO_RECONNECT ) reconectAll ( ) ;
367
- }
388
+ // if (settings.AUTO_RECONNECT) reconectAll();
368
389
369
- /**
370
- * This function will process
371
- *
372
- */
373
- function processConnections ( ) { }
390
+ const oldPrevious = "" ;
391
+ const oldNext = "" ;
392
+ }
374
393
375
394
/**
376
395
* This function will force connection between 2 plugins. If one of them is mono, adjust as necesary
0 commit comments