element icon indicating copy to clipboard operation
element copied to clipboard

req: automagic stereo connections

Open quantifiable opened this issue 3 years ago • 1 comments

what needs solved

Whenever you add a connection by dragging from connector A to B, you have to do it all over for the second connector (stereo).

how to eliminate an inconvenience

add an automagic stereo connection feature while creating / dragging a connection, with the shift key as a modifier

  • as long as shift is held (momentary) or if it is hit (toggle)
  • automatically connect the other channel of the pair too when connection is made
  • maybe even display a second cable beside the dragged one at the cursor
    • fixed offset to the cursor
    • clearly distinguisable from the dragged connection (which is currently being edited)
      • color: dark yellow, striped? (before established it resembles a snake in color theme, then it's the usual grey)
      • maybe slightly shorter? a few px?

proposed "code"?

assuming 1+2 are a stereo pair (L and R) code for which to connect could be something simple like

if (connector_drag_started % 2)
{
	connector_start_auto = connector_drag_started + 1;
}
else
{
	connector_start_auto = connector_drag_started - 1;
}

similar code for the end connector

  • better than just incrementing by one
    • imagine connecting the outputs 2 (R) and 3 (L aux) to inputs 1 (L) and 2 (R))
  • has a nice bug: if you start on channel 1 and end on channel 2, 1 and 2 get crossed over
    • sell it as a feature for easy channel swapping :)
  • this code also tells you which side of the cursor / connection start terminal to start the automatic cable on

thank you :)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

quantifiable avatar Apr 21 '21 19:04 quantifiable

yesss +1 for this can't wait to test it

HarmonicD avatar Apr 29 '21 21:04 HarmonicD