[Gridflow-cvs] [svn] commit: r6181 - in /trunk: doc/flow_classes/#import-help.pd src/classes1.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue Aug 17 17:24:12 EDT 2010


Author: matju
Date: Tue Aug 17 17:24:10 2010
New Revision: 6181

Log:
[#import] without arguments does the same as a plain grid-inlet does.

Modified:
    trunk/doc/flow_classes/#import-help.pd
    trunk/src/classes1.cxx

Modified: trunk/doc/flow_classes/#import-help.pd
==============================================================================
--- trunk/doc/flow_classes/#import-help.pd (original)
+++ trunk/doc/flow_classes/#import-help.pd Tue Aug 17 17:24:10 2010
@@ -1,4 +1,4 @@
-#N canvas 648 0 632 642 10;
+#N canvas 596 0 632 642 10;
 #X msg 55 123 reset;
 #X obj 13 59 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1
 ;
@@ -12,7 +12,7 @@
 ;
 #X text 232 478 Like a sequence of ints sent one after another \, except
 in a single message.;
-#X text 232 680 The grid resulting from the incoming integers and/or
+#X text 232 741 The grid resulting from the incoming integers and/or
 grids is output from the outlet.;
 #X text 99 24 This object allows you to produce grids from non-grid
 data \, such as integers and lists of integers. This object also reframes/resyncs
@@ -29,11 +29,7 @@
 that integer in the current grid. ends the grid if it is full. the
 constructed grid is not stored: it is streamed. the stream is buffered
 \, so the output is in packets of about a thousand numbers.;
-#X text 232 579 "per message" : the grid will shape itself according
-to the incoming data. Almost obsolete as sending a list to any grid
-inlet will result in the same except the latter can not be cast to
-other than int32.;
-#X text 232 535 "to_ascii \$1" converts ints as decimal in ascii codes
+#X text 232 557 "to_ascii \$1" converts ints as decimal in ascii codes
 ;
 #X obj 294 166 #import;
 #X msg 294 144 to_ascii \$1;
@@ -42,11 +38,11 @@
 #X obj 0 0 doc_h;
 #X obj 3 317 doc_i 2;
 #X obj 13 149 #import (240 320 3);
-#X obj 3 650 doc_o 1;
+#X obj 3 711 doc_o 1;
 #X obj 3 220 doc_c 2;
 #X text 232 285 default: i;
 #X obj 14 347 doc_ii 0;
-#X obj 14 557 doc_ii 1;
+#X obj 14 579 doc_ii 1;
 #X obj 14 250 doc_cc 0;
 #X obj 14 285 doc_cc 1;
 #X obj 97 250 doc_m c0 grid;
@@ -54,35 +50,58 @@
 #X obj 97 347 doc_m i0 float;
 #X obj 97 456 doc_m i0 symbol;
 #X obj 97 478 doc_m i0 list;
-#X obj 97 513 doc_m i0 reset;
-#X text 232 513 aborts the current grid if there is one.;
-#X obj 97 535 doc_m i0 to_ascii;
+#X obj 97 535 doc_m i0 reset;
+#X text 232 535 aborts the current grid if there is one.;
+#X obj 97 557 doc_m i0 to_ascii;
 #X obj 97 421 doc_m i0 grid;
-#X obj 97 579 doc_m i1 per_message;
-#X obj 97 557 doc_m i1 grid;
-#X obj 14 680 doc_oo 0;
-#X obj 97 680 doc_m o0 grid;
-#X obj 0 725 doc_f;
-#X obj 232 557 doc_same 0;
-#X connect 0 0 23 0;
+#X obj 97 601 doc_m i1 per_message;
+#X obj 97 579 doc_m i1 grid;
+#X obj 14 741 doc_oo 0;
+#X obj 97 741 doc_m o0 grid;
+#X obj 0 806 doc_f;
+#X obj 232 579 doc_same 0;
+#X obj 3 786 doc_also;
+#X obj 407 141 #import;
+#X obj 407 160 display;
+#X msg 407 122 3 3 f # 0 1.618 2 2.718 1 0 0 2 1;
+#X text 232 601 "per message" : the grid will shape itself according
+to the incoming data. Sending a list to any grid inlet will result
+in the same. However \, this is about the only case (as of 9.11) of
+an object that converts a grid-literal to a real grid without doing
+anything on the content. (before 9.11 \, the numtype of per_message
+had to be decided by [#import] using argument 1);
+#X obj 97 513 doc_m i0 cast;
+#X obj 103 786 #to_list;
+#X obj 163 786 #to_float;
+#X obj 229 786 #to_symbol;
+#X obj 301 786 #pack;
+#X obj 343 786 #unpack;
+#X connect 0 0 22 0;
 #X connect 1 0 4 0;
-#X connect 2 0 23 0;
+#X connect 2 0 22 0;
 #X connect 3 0 2 0;
 #X connect 4 0 3 0;
-#X connect 12 0 23 1;
-#X connect 13 0 23 1;
-#X connect 17 0 20 0;
+#X connect 12 0 22 1;
+#X connect 13 0 22 1;
+#X connect 16 0 19 0;
+#X connect 17 0 16 0;
 #X connect 18 0 17 0;
-#X connect 19 0 18 0;
-#X connect 23 0 5 0;
-#X connect 31 1 6 0;
-#X connect 32 1 26 0;
-#X connect 33 1 14 0;
-#X connect 34 1 7 0;
-#X connect 35 1 8 0;
-#X connect 36 1 37 0;
-#X connect 38 1 16 0;
-#X connect 39 1 11 0;
-#X connect 40 1 15 0;
-#X connect 41 1 45 0;
-#X connect 43 1 9 0;
+#X connect 22 0 5 0;
+#X connect 30 1 6 0;
+#X connect 31 1 25 0;
+#X connect 32 1 14 0;
+#X connect 33 1 7 0;
+#X connect 34 1 8 0;
+#X connect 35 1 36 0;
+#X connect 37 1 15 0;
+#X connect 38 1 11 0;
+#X connect 39 1 49 0;
+#X connect 40 1 44 0;
+#X connect 42 1 9 0;
+#X connect 45 1 51 0;
+#X connect 45 1 52 0;
+#X connect 45 1 53 0;
+#X connect 45 1 54 0;
+#X connect 45 1 55 0;
+#X connect 46 0 47 0;
+#X connect 48 0 46 0;

Modified: trunk/src/classes1.cxx
==============================================================================
--- trunk/src/classes1.cxx (original)
+++ trunk/src/classes1.cxx Tue Aug 17 17:24:10 2010
@@ -117,7 +117,10 @@
 		if (in.size()<=0) in.resize(1);
 		if (!in[0]) in[0]=new GridInlet((FObject *)this,stromgol);
 		while (n) {
-			if (!go || !go->sender) go = new GridOut(this,0,per_message?in[0]->dim:dim,cast);
+			if (!go || !go->sender) {
+				if (per_message) go = new GridOut(this,0,in[0]->dim,in[0]->nt);
+				else             go = new GridOut(this,0,       dim,     cast);
+			}
 			long n2 = min((long)n,go->dim.prod()-go->dex);
 			go->send(n2,data);
 			n-=n2; data+=n2;



More information about the Gridflow-cvs mailing list