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

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Feb 19 16:13:04 EST 2010


Author: matju
Date: Fri Feb 19 16:13:02 2010
New Revision: 5015

Log:
[#pack]: add «set» method

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

Modified: trunk/doc/flow_classes/#pack-help.pd
==============================================================================
--- trunk/doc/flow_classes/#pack-help.pd (original)
+++ trunk/doc/flow_classes/#pack-help.pd Fri Feb 19 16:13:02 2010
@@ -1,10 +1,10 @@
-#N canvas 379 12 632 544 10;
+#N canvas 565 34 632 588 10;
 #X obj 23 178 #color;
 #X floatatom 85 77 5 0 0 0 - - -;
 #X floatatom 107 96 5 0 0 0 - - -;
 #X floatatom 129 115 5 0 0 0 - - -;
 #X text 162 90 <--click and drag to place numbers in the grid.;
-#X text 232 463 Outputs values from each individual inlet into a grid.
+#X text 232 507 Outputs values from each individual inlet into a grid.
 ;
 #X obj 0 0 doc_h;
 #X obj 3 349 doc_i n;
@@ -14,24 +14,27 @@
 #X text 232 379 every inlet is hot.;
 #X text 232 401 inlet order corresponds to value order in the grid.
 ;
-#X obj 3 433 doc_o 1;
-#X obj 14 463 doc_oo 0;
+#X obj 3 477 doc_o 1;
+#X obj 14 507 doc_oo 0;
 #X obj 14 379 doc_ii any;
 #X obj 14 282 doc_cc 0;
 #X obj 14 317 doc_cc 1;
 #X obj 97 282 doc_m c0 float/int;
 #X obj 97 317 doc_m c1 numtype;
 #X obj 97 379 doc_m iany float;
-#X obj 97 463 doc_m o0 grid[n];
-#X obj 0 515 doc_f;
+#X obj 97 507 doc_m o0 grid[n];
+#X obj 0 559 doc_f;
 #X text 232 317 number type (default: int32);
 #X obj 85 135 #pack 3 f;
-#X obj 3 495 doc_also;
-#X obj 103 495 pack;
-#X obj 139 495 #unpack;
+#X obj 3 539 doc_also;
+#X obj 103 539 pack;
+#X obj 139 539 #unpack;
 #X obj 263 180 display;
 #X text 232 282 number of elements in the vector to be built (aka number
 of dimensions in the vector space) (default: 2);
+#X obj 97 445 doc_m iany set;
+#X text 232 423 float \$1 is like set \$1 then bang.;
+#X text 232 445 only set value \, don't send.;
 #X connect 1 0 23 0;
 #X connect 2 0 23 1;
 #X connect 3 0 23 2;
@@ -39,8 +42,10 @@
 #X connect 18 1 22 0;
 #X connect 19 1 10 0;
 #X connect 19 1 11 0;
+#X connect 19 1 30 0;
 #X connect 20 1 5 0;
+#X connect 23 0 27 0;
 #X connect 23 0 0 0;
-#X connect 23 0 27 0;
 #X connect 24 1 25 0;
 #X connect 24 1 26 0;
+#X connect 29 1 31 0;

Modified: trunk/src/classes1.cxx
==============================================================================
--- trunk/src/classes1.cxx (original)
+++ trunk/src/classes1.cxx Fri Feb 19 16:13:02 2010
@@ -2191,24 +2191,21 @@
 		this->n=n;
 		ninlets_set(this->n);
 	}
-	\decl void _n_float (int inlet, float f);
-	\decl void _n_list  (int inlet, float f);
-	\decl 0 bang ();
+	\decl void _n_set   (int inlet, float f) {
+		#define FOO(T) ((T *)*a)[inlet] = (T)f;
+		TYPESWITCH(a->nt,FOO,);
+		#undef FOO
+	}
+	\decl void _n_float (int inlet, float f) {_n_set(argc,argv,inlet,f); _0_bang(argc,argv);}
+	\decl void _n_list  (int inlet, float f) {_n_set(argc,argv,inlet,f); _0_bang(argc,argv);}
+	\decl 0 bang () {
+		out=new GridOutlet(this,0,a->dim,a->nt);
+		#define FOO(T) out->send(n,(T *)*a);
+		TYPESWITCH(a->nt,FOO,);
+		#undef FOO
+	}
 	//\grin 0
 };
-\def void _n_float (int inlet, float f) {
-#define FOO(T) ((T *)*a)[inlet] = (T)f;
-TYPESWITCH(a->nt,FOO,);
-#undef FOO
-	_0_bang(argc,argv);
-}
-\def void _n_list (int inlet, float f) {_n_float(argc,argv,inlet,f);}
-\def 0 bang () {
-	out=new GridOutlet(this,0,a->dim,a->nt);
-#define FOO(T) out->send(n,(T *)*a);
-TYPESWITCH(a->nt,FOO,);
-#undef FOO
-}
 \end class {install("#pack",1,1); add_creator("@pack");}
 
 \class GridUnpack : FObject {



More information about the Gridflow-cvs mailing list