outlet color attribute?

Jan 30, 2008 at 1:57am

outlet color attribute?

Haven’t found an answer to this in the archives or in the instance creation explanations:

Is there any way to change the color of an object’s outlets? That is, is there an outlet color attribute that can be set?

I want to write an object that will communicate with either a Polhemus FastTrak (4 active outlets) or Polhemus Patriot (2 active outlets). The object will always have four outlets. After querying the serial port and determining which model is connected I want to indicate active outlets by changing their color.

#35570
Jan 30, 2008 at 6:45am

Hope I’m wrong about this but I don’t think this is currently
possible. All of the outlet creation routines that are provided are
for creating an ordered set of outlets which only care about which
object it points to and what kind of data it sends out each outlet (a
linked list for outlets is declared in struct object in ext_mess.h)).
I don’t think that the definition for t_outlet is provided anywhere
for that matter — likely whatever internal drawing routines that draw
the outlets are responsible and are hands off to third party
developers. I don’t think there are any operations or routines that
can change the color of the outlet…it’s a nice idea though.

On Jan 29, 2008 5:57 PM, Bob Pritchard wrote:
>
> Haven’t found an answer to this in the archives or in the instance creation explanations:
>
> Is there any way to change the color of an object’s outlets? That is, is there an outlet color attribute that can be set?
>
> I want to write an object that will communicate with either a Polhemus FastTrak (4 active outlets) or Polhemus Patriot (2 active outlets). The object will always have four outlets. After querying the serial port and determining which model is connected I want to indicate active outlets by changing their color.
>
>
>

#121375
Jan 30, 2008 at 6:53am

I think a workaround to this would be easier anyway:

Make a set of values output from a specific outlet in your external to
send out color_codes or whatever integer codes you want to use between
[0-255] and map that corresponding to the message it outputs and then
have that render an o”utlet-like” row of jit.pwindow pixels to that
color–it shouldn’t take up that much real estate — maybe not as
elegant as blinking outlets but shouldn’t be too hard either–this
should give you extra flexibility too.

On Jan 29, 2008 10:45 PM, Brandon Nickell wrote:
> Hope I’m wrong about this but I don’t think this is currently
> possible. All of the outlet creation routines that are provided are
> for creating an ordered set of outlets which only care about which
> object it points to and what kind of data it sends out each outlet (a
> linked list for outlets is declared in struct object in ext_mess.h)).
> I don’t think that the definition for t_outlet is provided anywhere
> for that matter — likely whatever internal drawing routines that draw
> the outlets are responsible and are hands off to third party
> developers. I don’t think there are any operations or routines that
> can change the color of the outlet…it’s a nice idea though.
>
>
> On Jan 29, 2008 5:57 PM, Bob Pritchard wrote:
> >
> > Haven’t found an answer to this in the archives or in the instance creation explanations:
> >
> > Is there any way to change the color of an object’s outlets? That is, is there an outlet color attribute that can be set?
> >
> > I want to write an object that will communicate with either a Polhemus FastTrak (4 active outlets) or Polhemus Patriot (2 active outlets). The object will always have four outlets. After querying the serial port and determining which model is connected I want to indicate active outlets by changing their color.
> >
> >
> >
>

#121376
Jan 30, 2008 at 9:33am

How about creating only two outlets in your object_new() function in case you detected a Patriot?

Mattijs

Quote: charred wrote on Wed, 30 January 2008 02:57
—————————————————-
> Haven’t found an answer to this in the archives or in the instance creation explanations:
>
> Is there any way to change the color of an object’s outlets? That is, is there an outlet color attribute that can be set?
>
> I want to write an object that will communicate with either a Polhemus FastTrak (4 active outlets) or Polhemus Patriot (2 active outlets). The object will always have four outlets. After querying the serial port and determining which model is connected I want to indicate active outlets by changing their color.
>
>
—————————————————-

#121377
Jan 30, 2008 at 11:56pm

Using the jit.pwindow in that manner would certainly work and wouldn’t take up much space. I was just hoping to be elegant!

#121378
Jan 31, 2008 at 12:00am

object_new(): I wanted the four outlets constantly present so I wouldn’t have to reconnect to various objects when the polhemus object switched from two to four outlets. Of course, I could just have two different objects for the two different models of tracking device (which is what I have now).

#121379
Jan 31, 2008 at 12:58pm

Quote: charred wrote on Thu, 31 January 2008 01:00
—————————————————-
> object_new(): I wanted the four outlets constantly present so I wouldn’t have to reconnect to various objects when the polhemus object switched from two to four outlets. Of course, I could just have two different objects for the two different models of tracking device (which is what I have now).
—————————————————-

I see. Another idea; instead of coloring the outlets you could change the outlet description, just as [zl ] does: setting the description of unused outlets to “(inactive)”.

Mattijs

#121380

You must be logged in to reply to this topic.