Modify connection channel on connect?

Post Reply
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Modify connection channel on connect?

Post 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?
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Modify connection channel on connect?

Post by oskari »

It's not currently possible.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Modify connection channel on connect?

Post by IXix »

oskari wrote:It's not currently possible.
That's a shame. Would have been a useful feature for the machine.
oskari
Site Admin
Posts: 296
Joined: Mon Nov 21, 2011 2:04 pm

Re: Modify connection channel on connect?

Post by oskari »

Actually there is IMachineGraph.SetConnectionChannel but I managed to forget it somehow.
User avatar
IXix
Posts: 1113
Joined: Wed Nov 23, 2011 3:24 pm

Re: Modify connection channel on connect?

Post 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 :)
Post Reply