--- On Sat, 1/10/09, Mike McGonagle <mjm...@gmail.com> wrote: > From: Mike McGonagle <mjm...@gmail.com> > Subject: Re: [PD] Outlet on 'struct' object > To: pd-list@iem.at > Date: Saturday, January 10, 2009, 6:49 AM > Yeah, this is really nice. One thing I noticed was that if I > click and > hold directly over the drawn line connected to the active > float inlet, > you can drag and it sends a 'change' message, it > also redraws the line > by following the mouse. Is there anyway to get the mouse > coordinates > such that it can be used as input to control the struct > data? It would > be really nice if this type of thing could be abstracted to > allow for > a variable number of inlets to switch. > > Mike
I made a mockup of how this could work using ds dummy-objects, which you can see in vswitch_mockup.pd. This just shows that when you pull the arrow, another inlet would have to be created inside the abstraction. I also made a vswitch abs that would work if you could associate dynamic patching with data structures. The necessary objects are comments in pd-inlet-template: [drawobj] and [drawconnect]. The idea would be that the object chain is created as an element of an instance of a ds, so you could plot an array then use [setsize] to create and destroy the objects as necessary. But test.pd reveals a bug: any ds object created (or made visible) after the abstraction loads will bleed through onto the parent. -Jonathan > > On Fri, Jan 9, 2009 at 10:29 PM, Luke Iannini > <lukex...@gmail.com> wrote: > > That's extremely nice - good stuff. I didn't > know GOP datastructures > > could be done so easily now; I remember it being > weirder. > > > > I'd love to start a collection of GUI objects like > this - looks like > > the "change" selector is working as well, so > perhaps an "advanced > > slider" can finally be done! Mind if I add it to > a "ds-gui" section > > in SVN? > > > > Thanks for sending it along > > Luke > > > > On Fri, Jan 9, 2009 at 4:30 PM, Jonathan Wilkes > <jancs...@yahoo.com> wrote: > >> I made a clone of max's "gswitch" > using the click selector a while back. With 0.42, you can > click the gop window to switch inputs. > >> > >> > >> > >> --- On Sat, 1/10/09, Mike McGonagle > <mjm...@gmail.com> wrote: > >> > >>> From: Mike McGonagle <mjm...@gmail.com> > >>> Subject: Re: [PD] Outlet on 'struct' > object > >>> To: pd-list@iem.at > >>> Date: Saturday, January 10, 2009, 1:06 AM > >>> Ok, I tried it on the sequence example, and it > only seems to > >>> output > >>> stuff in Edit Mode. Is that correct? Plus, it > also seems to > >>> only > >>> output 'select' and 'deselect' > messages. It > >>> also seems to repeatedly > >>> output them when you 'select' and drag > an object. > >>> > >>> Is this a new feature? (I seem to remember > reading > >>> something about > >>> mouse events for structs in 42) Are there any > examples of > >>> how these > >>> are used? > >>> > >>> Mike > >>> > >>> On Fri, Jan 9, 2009 at 4:42 PM, Frank > Barknecht > >>> <f...@footils.org> wrote: > >>> > Hallo, > >>> > Mike McGonagle hat gesagt: // Mike > McGonagle wrote: > >>> > > >>> >> I was just curious, and looking at > the source was > >>> not all that > >>> >> obvious, but does anyone know what > the outlet on a > >>> 'struct' object is > >>> >> used for? > >>> > > >>> > It reports selected and clicked (and > maybe more) data > >>> structure instances. > >>> > Connect a [print] to it and select some > objects to see > >>> the messages. The > >>> > outlet sends messages composed of a > selector and a > >>> gpointer, which you > >>> > can route to [get] objects for example. > It's > >>> pretty useful! > >>> > > >>> > Ciao > >>> > -- > >>> > Frank > >>> > > >>> > > _______________________________________________ > >>> > Pd-list@iem.at mailing list > >>> > UNSUBSCRIBE and account-management -> > >>> http://lists.puredata.info/listinfo/pd-list > >>> > > >>> > >>> > >>> > >>> -- > >>> Peace may sound simple—one beautiful word— > but it > >>> requires everything > >>> we have, every quality, every strength, every > dream, every > >>> high ideal. > >>> —Yehudi Menuhin (1916–1999), musician > >>> > >>> > _______________________________________________ > >>> Pd-list@iem.at mailing list > >>> UNSUBSCRIBE and account-management -> > >>> http://lists.puredata.info/listinfo/pd-list > >> > >> > >> > >> _______________________________________________ > >> Pd-list@iem.at mailing list > >> UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list > >> > >> > > > > > > -- > Peace may sound simple—one beautiful word— but it > requires everything > we have, every quality, every strength, every dream, every > high ideal. > —Yehudi Menuhin (1916–1999), musician > > _______________________________________________ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list
#N struct vgswitch float x float y float x0 symbol sname array inlets inlet-template array drawinlets drawinlet; #N struct inlet-template float num symbol list-obj symbol prepend-obj symbol send symbol vgswitch_in-obj symbol inlet-obj; #N struct drawinlet float something; #N canvas 0 86 1004 682 12; #N canvas 0 0 450 300 drawinlet 0; #X obj 97 111 drawpolygon 0 1 0 0 8 0; #X obj 101 46 struct drawinlet float something; #X restore 15 -166 pd drawinlet; #N canvas 87 309 805 286 vgswitch 0; #X obj 45 52 outlet; #X obj 74 100 plot drawinlets 0 0 32 1 32; #X obj 74 75 plot inlets 0 0 0 110 120; #X obj 74 125 drawsymbol sname 2 3 0; #X obj 45 11 struct vgswitch float x float y float x0 symbol sname array inlets inlet-template array drawinlets drawinlet; #X obj 75 158 drawpolygon 0 1 x0(0:1000)(72:1072) 40 72 40 0 40 0 39 8 39 0 39 0 0 8 0 0 0 0 1 8 1 8 0 32 0 32 1 40 1 40 0 32 0 64 0 64 1 72 1 72 0 64 0 72 0 x0(0:1000)(72:1072) 0 x0(0:1000)(72:1072) 40 x0(0:1000)(72:1072) 25 x0(0:1000)(71:1071) 25 x0(0:1000)(62:1062) 20 x0(0:1000)(71:1071) 25 x0(0:1000)(62:1062) 30 x0(0:1000)(71:1071) 25 5 25; #X connect 4 0 0 0; #X restore 15 -116 pd vgswitch; #N canvas -26 58 1004 682 mockup 1; #X scalar vgswitch 20 20 0 vswitch \; 0 list prepend s vgswitch_in inlet \; 1 list prepend s vgswitch_in inlet \; \; 0 \; 0 \; \;; #X restore 345 -5 pd mockup; #X obj 15 -91 route change; #X obj 15 -66 get vgswitch x0; #X obj 15 -41 div 32; #N canvas 82 306 789 300 inlet-template 0; #X obj 32 78 drawpolygon 0 1 8 19 0 19 0 20 44 20 44 0 0 0 0 20 3 20 3 25 8 25 8 26 0 26 0 25 116 25 116 26 108 26 116 26 116 45 0 45 0 25 0 44 8 44 3 44 3 50 0 50 0 51 8 51 8 50 4 50 108 50 108 70 0 70 0 50; #X obj 270 153 drawnumber num 106 28 0; #X obj 33 152 drawsymbol inlet-obj 2 3 0; #X obj 33 179 drawsymbol list-obj 2 28 0; #X obj 33 206 drawsymbol prepend-obj 42 28 0; #X obj 34 258 drawsymbol vgswitch_in-obj 18 53; #X obj 32 14 struct inlet-template float num symbol list-obj symbol prepend-obj symbol send symbol vgswitch_in-obj symbol inlet-obj; #X obj 33 233 drawsymbol send 2 53 0; #X restore 15 -141 pd inlet-template; #N canvas 0 0 1004 682 guts 0; #X obj 47 15 inlet; #X msg 566 130 traverse pd-mockup \, bang; #X obj 566 155 pointer; #X msg 417 155 20 20; #X obj 417 180 append vgswitch x y; #X obj 54 329 element vgswitch inlets; #X obj 198 247 setsize vgswitch drawinlets; #X obj 198 272 setsize vgswitch inlets; #X obj 54 243 t a a; #X obj 145 65 t b b b b b; #X msg 612 85 \; pd-mockup clear; #X obj 145 117 t b b a; #X obj 54 354 t b a; #X msg 145 90 2; #X msg 179 148 0; #X msg 145 148 1; #X obj 54 300 t a a; #X obj 8 424 f; #X obj 438 241 set -symbol vgswitch sname; #X msg 438 216 symbol vswitch; #X obj 145 38 loadbang; #X obj 8 459 set inlet-template num; #X obj 54 405 set -symbol inlet-template list-obj prepend-obj send vgswitch_in-obj inlet-obj; #X obj 54 179 + 2; #X obj 54 217 + 2; #X obj 54 268 - 1; #X msg 54 379 list list prepend s vgswitch_in inlet; #X connect 0 0 23 0; #X connect 0 0 24 0; #X connect 1 0 2 0; #X connect 2 0 4 2; #X connect 3 0 4 0; #X connect 4 0 5 1; #X connect 4 0 6 1; #X connect 4 0 7 1; #X connect 4 0 18 1; #X connect 5 0 12 0; #X connect 8 0 25 0; #X connect 8 1 7 0; #X connect 9 0 13 0; #X connect 9 1 19 0; #X connect 9 2 3 0; #X connect 9 3 1 0; #X connect 9 4 10 0; #X connect 11 0 15 0; #X connect 11 1 14 0; #X connect 11 2 6 0; #X connect 11 2 7 0; #X connect 12 0 17 0; #X connect 12 0 26 0; #X connect 12 1 21 1; #X connect 12 1 22 5; #X connect 13 0 11 0; #X connect 14 0 16 0; #X connect 15 0 16 0; #X connect 16 0 5 0; #X connect 16 1 17 1; #X connect 17 0 21 0; #X connect 19 0 18 0; #X connect 20 0 9 0; #X connect 23 0 6 0; #X connect 24 0 8 0; #X connect 25 0 16 0; #X connect 26 0 22 0; #X restore 15 -6 pd guts; #X text 203 -7 example inside-->; #X text 203 10 (fake objects); #X connect 1 0 3 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 7 0;
#N canvas 0 18 1004 682 12; #N canvas 0 0 491 319 inlet-template 0; #X text 29 40 [drawobj 0 0 inlet]; #X text 29 60 [drawobj 0 25 list prepend num]; #X text 29 100 [drawconnect 0 0 1 0]; #X text 29 120 [drawconnect 0 1 0 1]; #X text 29 80 [drawobj 0 50 s vswitch-in]; #X obj 33 176 drawnumber num 0 0 0 inlet; #X obj 9 9 struct \$0-inlet-template float num; #X restore 8 46 pd inlet-template; #X obj 8 121 route change; #N canvas 248 361 689 300 arrow-template 0; #X obj 31 148 outlet; #X obj 65 73 drawpolygon 0 1 5 28 x0(0:1000)(58:1058) 28 x0(0:1000)(48:1048) 24 x0(0:1000)(58:1058) 28 x0(0:1000)(48:1048) 32 x0(0:1000)(58:1058) 28; #X obj 31 28 struct \$0-arrow-template float x0; #X connect 2 0 0 0; #X restore 8 96 pd arrow-template; #N canvas 0 0 1004 682 vinlet-template 0; #X obj 58 106 plot inlets 0 0 0 110 120; #X obj 27 33 struct \$0-vinlet-template float x float y array inlets \$0-inlet-template; #X restore 8 71 pd vinlet-template; #X obj 498 80 namecanvas \$0-vswitch; #N canvas 0 0 1004 682 init 0; #X obj 170 395 * 32; #X obj 87 499 f; #X obj 170 365 - 2; #X msg 355 155 next; #X msg 123 156 next; #X msg 223 156 next; #X obj 123 55 f \$0; #X msg 123 80 traverse \$1-vswitch \, next; #X obj 31 282 spigot; #X msg 146 228 1; #X obj 223 130 t b b a; #X obj 123 282 spigot 1; #X obj 249 201 f; #X obj 283 201 + 1; #X obj 249 226 sel 1; #X msg 249 251 0; #X obj 170 445 pack f \$0; #X obj 33 85 t a; #X msg 170 471 \; \$2-vswitch donecanvasdialog 1 -1 1 0 0 \$1 40 \$1 40 0 0; #X obj 170 420 + 60; #X obj 123 27 loadbang; #X obj 287 395 r \$0-x0; #X text 354 396 update gop size from ds arrow; #X obj 206 365 s \$0-vinlet-size; #X obj 455 248 r \$0-vinlets; #N canvas 0 86 1004 682 spawn-objects 0; #X obj 26 10 inlet; #X obj 26 35 t b b b b; #X obj 285 118 pointer; #X obj 285 68 f \$0; #X msg 285 93 traverse \$1-vswitch \, bang; #X msg 26 95 0; #X msg 72 174 150 550; #X obj 286 28 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 26 138 append \$0-arrow-template x0; #X obj 72 200 append \$0-vinlet-template x y; #X obj 92 272 outlet; #X obj 26 272 outlet; #X connect 0 0 1 0; #X connect 1 0 5 0; #X connect 1 1 3 0; #X connect 1 2 6 0; #X connect 1 3 3 0; #X connect 2 0 8 1; #X connect 2 0 9 2; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 5 0 8 0; #X connect 6 0 9 0; #X connect 7 0 3 0; #X connect 8 0 11 0; #X connect 9 0 10 0; #X restore 472 129 pd spawn-objects; #X obj 716 276 t a; #X obj 123 130 t b b a a; #X obj 669 347 max 1; #X obj 669 429 f; #X obj 703 429 + 1; #X obj 669 402 until; #X obj 669 372 t a b; #X msg 719 402 0; #X obj 669 454 t a a; #X obj 455 273 t a a; #X obj 123 105 pointer \$0-vinlet-template \$0-arrow-template; #X obj 170 310 getsize \$0-vinlet-template inlets; #X obj 455 310 setsize \$0-vinlet-template inlets; #X obj 87 529 set \$0-arrow-template x0; #X obj 669 515 set \$0-inlet-template num; #X obj 741 478 element \$0-vinlet-template inlets; #X msg 472 180 2; #X obj 472 154 b; #X connect 0 0 1 1; #X connect 0 0 19 0; #X connect 1 0 39 0; #X connect 2 0 0 0; #X connect 3 0 11 0; #X connect 4 0 11 0; #X connect 5 0 11 0; #X connect 6 0 7 0; #X connect 7 0 36 0; #X connect 8 0 1 0; #X connect 9 0 8 1; #X connect 10 0 5 0; #X connect 10 0 8 0; #X connect 10 1 12 0; #X connect 10 2 39 1; #X connect 11 0 17 0; #X connect 12 0 13 0; #X connect 12 0 14 0; #X connect 13 0 12 1; #X connect 14 0 15 0; #X connect 15 0 11 1; #X connect 16 0 18 0; #X connect 17 0 36 0; #X connect 19 0 16 0; #X connect 20 0 6 0; #X connect 21 0 19 0; #X connect 24 0 35 0; #X connect 25 0 43 0; #X connect 25 1 26 0; #X connect 26 0 38 1; #X connect 26 0 41 1; #X connect 27 0 4 0; #X connect 27 0 8 0; #X connect 27 1 9 0; #X connect 27 1 12 0; #X connect 27 2 37 0; #X connect 27 3 26 0; #X connect 28 0 32 0; #X connect 29 0 30 0; #X connect 29 0 34 0; #X connect 30 0 29 1; #X connect 31 0 29 0; #X connect 32 0 31 0; #X connect 32 1 33 0; #X connect 33 0 29 1; #X connect 34 0 40 0; #X connect 34 1 41 0; #X connect 35 0 28 0; #X connect 35 1 38 0; #X connect 36 0 27 0; #X connect 36 1 10 0; #X connect 36 2 3 0; #X connect 36 3 25 0; #X connect 37 0 2 0; #X connect 37 0 23 0; #X connect 37 0 28 0; #X connect 41 0 40 1; #X connect 42 0 35 0; #X connect 43 0 42 0; #X restore 381 80 pd init; #X obj 87 178 s \$0-x0; #X text 151 179 (to pd init); #X obj 8 257 inlet; #X obj 118 292 r vswitch-in; #X obj 118 317 list split 1; #X obj 97 342 sel; #X obj 97 367 list append; #X obj 77 268 r \$0-vinlet-size; #X obj 8 282 f; #X obj 40 283 + 1; #X obj 8 313 mod; #X obj 77 293 - 1; #X obj 8 179 div 32; #X obj 8 231 s \$0-vinlets; #X obj 97 392 outlet; #X obj 8 204 + 2; #X text 152 46 <-- would need [drawobj] and [drawconnect] to work; #X floatatom 308 200 5 0 0 0 - - -; #X text 357 200 no of inlets; #X obj 8 146 get \$0-arrow-template x0; #X connect 1 0 25 0; #X connect 2 0 1 0; #X connect 8 0 14 0; #X connect 9 0 10 0; #X connect 10 0 11 1; #X connect 10 1 12 1; #X connect 11 0 12 0; #X connect 12 0 20 0; #X connect 13 0 17 0; #X connect 14 0 15 0; #X connect 14 0 16 0; #X connect 15 0 14 1; #X connect 16 0 11 0; #X connect 17 0 16 1; #X connect 18 0 21 0; #X connect 21 0 19 0; #X connect 21 0 23 0; #X connect 25 0 6 0; #X connect 25 0 18 0; #X coords 0 0 60 40 60 40 1 0 0;
#N struct 1006-arrow-template float x0; #N struct 1006-vinlet-template float x float y array inlets 1006-inlet-template ; #N struct 1006-inlet-template float num; #N canvas 0 0 1004 682 12; #X text 92 172 ds structures bleed over from abstraction to canvas (scroll down to see); #X obj 97 111 vswitch;
_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list