aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Iannini <lukeiannini@users.sourceforge.net>2009-04-12 08:43:50 +0000
committerLuke Iannini <lukeiannini@users.sourceforge.net>2009-04-12 08:43:50 +0000
commit303968db751de5df61392eb0eac3542cd9a0dd94 (patch)
tree9841615f60ddb5d5bcab97f3e7cb72903b2d5986
parentf2d477e14d21180016ec022f1edf7a2dbec34a1c (diff)
updated templater to use canvasdelete to clean itself up after spawning the template
svn path=/trunk/abstractions/sfruit/; revision=11013
-rw-r--r--sfruit/templater-help.pd7
-rw-r--r--sfruit/templater.pd115
2 files changed, 62 insertions, 60 deletions
diff --git a/sfruit/templater-help.pd b/sfruit/templater-help.pd
index 9b85a01..307e860 100644
--- a/sfruit/templater-help.pd
+++ b/sfruit/templater-help.pd
@@ -12,8 +12,6 @@ are defined in the template file \, with no offset.;
#X text 522 320 2008 Luke Iannini;
#X text 522 335 proyekto.net;
#X msg 17 281 obj 10 10 templater tmetro \, loadbang;
-#X text 282 253 for the moment \, one must manually delete the [templater]
-object immediately after spawning it.;
#X text 89 229 try me!;
#X text 40 301 (delete existing to try another);
#N canvas 514 43 411 356 creating-templates 0;
@@ -36,8 +34,11 @@ shows the placement of objects within the "modcount" template.;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X restore 301 323 pd creating-templates;
-#X text 283 291 subpatches are not yet supported;
#X text 266 32 [templater] - create and connect a set of pd objects
in the current patch based on a template file.;
+#X text 282 244 thanks to the new canvasdelete \, templater will disappear
+after creating its template.;
+#X text 283 291 subpatches are not yet supported (and may be impossible)
+;
#X connect 1 0 0 0;
#X connect 7 0 0 0;
diff --git a/sfruit/templater.pd b/sfruit/templater.pd
index 3fb5a91..1e7214c 100644
--- a/sfruit/templater.pd
+++ b/sfruit/templater.pd
@@ -1,20 +1,31 @@
#N canvas 804 104 455 638 10;
-#X obj 103 318 textfile;
-#X obj 103 366 route #X;
-#X obj 103 387 route connect;
-#X obj 50 271 until;
-#X obj 50 145 t b b;
-#X obj 50 46 loadbang;
-#X obj 103 435 unpack f f f f;
-#X obj 103 519 pack f f f f;
-#X obj 103 581 sendcanvas 1;
-#X obj 208 443 r \$0.index-offset;
-#X obj 149 479 +;
-#X obj 103 479 +;
-#X msg 103 551 connect \$1 \$2 \$3 \$4;
-#X obj 69 98 canvasindex;
-#X obj 132 125 s \$0.index-offset;
-#N canvas 342 115 467 373 offset-coords 0;
+#X obj 133 328 textfile;
+#X obj 133 376 route #X;
+#X obj 133 397 route connect;
+#X obj 80 281 until;
+#X obj 80 155 t b b;
+#X obj 30 26 loadbang;
+#X obj 133 445 unpack f f f f;
+#X obj 133 529 pack f f f f;
+#X obj 133 591 sendcanvas 1;
+#X obj 179 489 +;
+#X obj 133 489 +;
+#X msg 133 561 connect \$1 \$2 \$3 \$4;
+#X obj 99 108 canvasindex;
+#X obj 229 419 sendcanvas 1;
+#X obj 322 372 canvasposition;
+#X obj 80 84 t b b b;
+#X obj 132 184 list append \$1;
+#X obj 132 208 route float;
+#X msg 133 245 read \$1-template.pd \, rewind;
+#X obj 322 349 sel 0;
+#X text 304 16 *optional;
+#X obj 322 326 list append \$2;
+#X text 86 16 [templater templatename absolute?*];
+#X text 316 612 2008 Luke Iannini;
+#X obj 143 85 s \$0-get_position;
+#X obj 322 302 r \$0-get_position;
+#N canvas 342 115 467 373 offset_coords 0;
#X obj 47 3 inlet;
#X obj 46 334 outlet;
#X obj 47 78 list split 1;
@@ -28,8 +39,6 @@
#X obj 194 211 pack f f;
#X obj 208 62 inlet;
#X obj 46 309 list trim;
-#X obj 266 122 + 20;
-#X text 301 123 spawn under [templater];
#X connect 0 0 2 0;
#X connect 2 0 5 0;
#X connect 2 1 3 0;
@@ -41,54 +50,46 @@
#X connect 7 0 6 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
-#X connect 8 1 13 0;
+#X connect 8 1 9 1;
#X connect 9 0 10 1;
#X connect 10 0 4 0;
#X connect 11 0 8 0;
#X connect 12 0 1 0;
-#X connect 13 0 9 1;
-#X restore 199 387 pd offset-coords;
-#X obj 199 409 sendcanvas 1;
-#X obj 292 362 canvasposition;
-#X obj 50 74 t b b b;
-#X obj 113 75 s \$0.get-position;
-#X obj 292 292 r \$0.get-position;
-#X obj 102 174 list append \$1;
-#X obj 102 198 route float;
-#X msg 103 235 read \$1-template.pd \, rewind;
-#X obj 292 339 sel 0;
-#X text 304 16 *optional;
-#X obj 292 316 list append \$2;
-#X text 86 16 [templater templatename absolute?*];
-#X text 286 602 2008 Luke Iannini;
+#X restore 229 397 pd offset_coords;
+#X obj 238 453 r \$0-index_offset;
+#X obj 162 135 s \$0-index_offset;
+#X obj 30 51 t b b;
+#X obj 30 369 canvasdelete 1;
#X connect 0 0 1 0;
#X connect 0 1 3 1;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
-#X connect 2 1 15 0;
+#X connect 2 1 26 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
-#X connect 4 1 21 0;
-#X connect 5 0 18 0;
-#X connect 6 0 11 0;
+#X connect 4 1 16 0;
+#X connect 5 0 29 0;
+#X connect 6 0 10 0;
#X connect 6 1 7 1;
-#X connect 6 2 10 0;
+#X connect 6 2 9 0;
#X connect 6 3 7 3;
-#X connect 7 0 12 0;
-#X connect 9 0 11 1;
-#X connect 9 0 10 1;
-#X connect 10 0 7 2;
-#X connect 11 0 7 0;
-#X connect 12 0 8 0;
-#X connect 13 1 14 0;
-#X connect 15 0 16 0;
-#X connect 17 0 15 1;
-#X connect 18 0 4 0;
-#X connect 18 1 13 0;
-#X connect 18 2 19 0;
-#X connect 20 0 26 0;
-#X connect 21 0 22 0;
-#X connect 22 1 23 0;
-#X connect 23 0 0 0;
-#X connect 24 0 17 0;
-#X connect 26 0 24 0;
+#X connect 7 0 11 0;
+#X connect 9 0 7 2;
+#X connect 10 0 7 0;
+#X connect 11 0 8 0;
+#X connect 12 1 28 0;
+#X connect 14 0 26 1;
+#X connect 15 0 4 0;
+#X connect 15 1 12 0;
+#X connect 15 2 24 0;
+#X connect 16 0 17 0;
+#X connect 17 1 18 0;
+#X connect 18 0 0 0;
+#X connect 19 0 14 0;
+#X connect 21 0 19 0;
+#X connect 25 0 21 0;
+#X connect 26 0 13 0;
+#X connect 27 0 10 1;
+#X connect 27 0 9 1;
+#X connect 29 0 30 0;
+#X connect 29 1 15 0;