Page 1 of 1

Modify connection channel on connect?

Posted: Fri Apr 19, 2013 8:38 pm
by IXix
For my PatchBay machine, I want to have an attribute option to assign new input connections to the first unused input channel. I thought that I would be able to do the following but DestinationChannel is read-only...

Code: Select all

// Handle auto-assign channels
if(Machine.Attributes[2].Value == 1)
{
   for (int i = 0; i < Patch.NumInputs; i++)
   {
      if (!InputConnections.ContainsValue(i))
      {
         c.DestinationChannel = i; // Not allowed
         break;
      }
   }
}
Is there an alternative method to achieve the same thing?

Re: Modify connection channel on connect?

Posted: Sat Apr 20, 2013 1:16 pm
by oskari
It's not currently possible.

Re: Modify connection channel on connect?

Posted: Sat Apr 20, 2013 3:13 pm
by IXix
oskari wrote:It's not currently possible.
That's a shame. Would have been a useful feature for the machine.

Re: Modify connection channel on connect?

Posted: Sat Apr 27, 2013 4:05 pm
by oskari
Actually there is IMachineGraph.SetConnectionChannel but I managed to forget it somehow.

Re: Modify connection channel on connect?

Posted: Sat Apr 27, 2013 4:13 pm
by IXix
oskari wrote:Actually there is IMachineGraph.SetConnectionChannel but I managed to forget it somehow.
Haha, I have trouble remembering how my plugins work and they're a lot simpler than BuzzGUI! IMachineGraph.SetConnectionChannel eh? I probably should have found that on my own. It's not exactly obscure. :oops:

Thanks Oskari :)