[Gridflow-cvs] [svn] commit: r6093 - in /trunk/src: classes1.cxx classes3.cxx classes_gui.cxx gem.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Aug 14 18:29:00 EDT 2010


Author: matju
Date: Sat Aug 14 18:28:59 2010
New Revision: 6093

Log:
shortcuts

Modified:
    trunk/src/classes1.cxx
    trunk/src/classes3.cxx
    trunk/src/classes_gui.cxx
    trunk/src/gem.cxx

Modified: trunk/src/classes1.cxx
==============================================================================
--- trunk/src/classes1.cxx (original)
+++ trunk/src/classes1.cxx Sat Aug 14 18:28:59 2010
@@ -224,8 +224,8 @@
 		if (!dest) post("%s",s);
 		else {
 			int n = strlen(s);
-			t_atom a[n];
-			for (int i=0; i<n; i++) SETFLOAT(a+i,s[i]);
+			t_atom2 a[n];
+			for (int i=0; i<n; i++) a[i]=s[i];
 			//fprintf(stderr,"dest=%p\n",dest);
 			//fprintf(stderr,"*dest={%08x,%08x,%08x,%08x,...}\n",dest[0],dest[1],dest[2],dest[3]);
 			pd_typedmess(dest,gensym("very_long_name_that_nobody_uses"),n,a);
@@ -371,12 +371,7 @@
 		DELBUF(fromb);
 		DELBUF(to2);
 	}
-	\decl 0 bang () {
-		t_atom a[2];
-		SETFLOAT(a+0,0);
-		SETSYMBOL(a+1,gensym("#"));
-		pd_list((t_pd *)bself,&s_list,2,a);
-	}
+	\decl 0 bang () {t_atom2 a[2] = {0,gensym("#")}; pd_list((t_pd *)bself,&s_list,2,a);}
 	\decl 1 reassign () {put_at=0;}
 	\decl 1 put_at (...) {
 		if (argv[0].a_type==A_LIST) put_at=TO(Grid *,argv[0]);

Modified: trunk/src/classes3.cxx
==============================================================================
--- trunk/src/classes3.cxx (original)
+++ trunk/src/classes3.cxx Sat Aug 14 18:28:59 2010
@@ -540,7 +540,7 @@
 	\grin 1 int
 	\grin 2 int
 	\constructor (Grid *dl=0, Grid *dr=0) {
-		t_atom a[2]; SETFLOAT(a+0,1); SETFLOAT(a+1,1); SETFLOAT(a+2,0);
+		t_atom2 a[3] = {1,1,0};
 		diml_grid=dl?dl:new Grid(3,a,int32_e);
 		dimr_grid=dr?dr:new Grid(3,a,int32_e);
 		diml = diml_grid->to_dim();
@@ -731,7 +731,7 @@
 	int scalex;
 	\constructor (Grid *factor=0) {
 		scale.constrain(expect_scale_factor);
-		t_atom a[1]; SETFLOAT(a,2);
+		t_atom2 a[1] = {2};
 		scale = factor?factor:new Grid(1,a,int32_e);
 		prepare_scale_factor();
 	}
@@ -785,7 +785,7 @@
 	PtrGrid temp;
 	\constructor (Grid *factor=0, t_symbol *option=0) {
 		scale.constrain(expect_scale_factor);
-		t_atom a[1]; SETFLOAT(a,2);
+		t_atom2 a[1] = {2};
 		scale = factor?factor:new Grid(1,a,int32_e);
 		prepare_scale_factor();
 		smoothly = option==gensym("smoothly");
@@ -1385,7 +1385,7 @@
 	if (in.dim.n<2) RAISE("at least 2 dimensions");
 	int w = which_dim; if (w<0) w+=in.dim.n;
 	if (w<0 || w>=in.dim.n) RAISE("can't join on dim number %d on %d-dimensional grids", which_dim,in.dim.n);
-	if (!r) {t_atom a[1]; SETFLOAT(a,256); r=new Grid(1,a);}
+	if (!r) {t_atom2 a[1] = {256.f}; r=new Grid(1,(t_atom *)a);}
 	SAME_TYPE(in,r);
 	go = new GridOut(this,0,in.dim,in.nt);
 	in.set_chunk(w);

Modified: trunk/src/classes_gui.cxx
==============================================================================
--- trunk/src/classes_gui.cxx (original)
+++ trunk/src/classes_gui.cxx Sat Aug 14 18:28:59 2010
@@ -152,12 +152,9 @@
 		ostringstream os;
 		pd_anything(&pd_objectmaker,gensym("#print"),0,0);
 		gp = pd_newest();
-		t_atom a[1];
-		SETFLOAT(a,20);
-		pd_anything(gp,gensym("maxrows"),1,a);
+		{t_atom2 a[1] = {20}; pd_anything(gp,gensym("maxrows"),1,a);}
 		text << "...";
-		SETPOINTER(a,(t_gpointer *)bself);
-		pd_anything(gp,gensym("dest"),1,a);
+		{t_atom2 a[1] = {(t_gpointer *)bself}; pd_anything(gp,gensym("dest"),1,a);}
  		changed();
 	}
 	~Display () {pd_free(gp);}
@@ -272,7 +269,7 @@
 		if (rcv) pd_bind((t_pd *)bself,rcv);
 	}
 	\decl void anything (...) {
-		t_symbol *sel = gensym(argv[0].a_symbol->s_name+3); // this is getting tiring
+		t_symbol *sel = argv[0]; sel = gensym(sel->s_name+3); // this is getting tiring
 		if (snd) pd_anything(snd,sel,argc-1,argv+1);
 	}
 	void set_rcv (t_symbol *rcv_=0) {
@@ -298,7 +295,7 @@
 	BFObject *proxy;
 	\constructor (t_symbol *rcv_=s_default) {
 		snd = 0;
-		t_atom a[1]; SETSYMBOL(a,rcv_==s_default?symprintf(".x%x",mom):rcv_);
+		t_atom2 a[1] = {rcv_==s_default?symprintf(".x%x",mom):rcv_};
 		pd_anything(&pd_objectmaker,gensym("gf/mouse_spy_proxy"),1,a);
 		proxy = (BFObject *)pd_newest();
 		((MouseSpyProxy *)proxy->self)->snd = (t_pd *)bself;
@@ -306,11 +303,7 @@
 	void set_rcv (t_symbol *rcv_=0) {((MouseSpyProxy *)proxy->self)->set_rcv(rcv_);}
 	~MouseSpy () {((MouseSpyProxy *)proxy->self)->delayed_free();}
 	void event (const char *ss, t_symbol *key=0) {
-		t_atom a[4];
-		SETFLOAT(a+0,y);
-		SETFLOAT(a+1,x);
-		SETFLOAT(a+2,flags&511);
-		if (key) SETSYMBOL(a+3,key);
+		t_atom2 a[4] = {y,x,flags&511}; if (key) a[3]=key;
 		t_symbol *s = gensym(ss);
 		if (snd) pd_anything((t_pd *)snd,s,key?4:3,a);
 		else                      out[0](s,key?4:3,a);
@@ -318,9 +311,9 @@
 	\decl 0 mouse   (int x_, int y_, int but, int z=0) {y=y_; x=x_; flags|=  128<<but ;          event("position");}
 	\decl 0 mouseup (int x_, int y_, int but, int z=0) {y=y_; x=x_; flags&=~(128<<but);          event("position");}
 	\decl 0 motion  (int x_, int y_, int flags_      ) {y=y_; x=x_; flags&=~12; flags|=flags_*2; event("position");}
-	\decl 0 key     (int on, t_atom ascii, int drop) {
+	\decl 0 key     (int on, t_atom2 ascii, int drop) {
 		t_symbol *key;
-		if (ascii.a_type==A_SYMBOL) key = ascii.a_symbol;
+		if (ascii.a_type==A_SYMBOL) key = ascii;
 		else {
 			int i = int(ascii.a_float);
 			key = (i<0 || i>=128 || !keyboard[i]) ? symprintf("%c",i) : keyboard[i];
@@ -367,7 +360,7 @@
 		sys_vgui("image create photo %s -width %d -height %d\n",rsym->s_name,sx,sy);
 		fast=false;
 		changed();
-		t_atom a[1]; SETSYMBOL(a,s_empty);
+		t_atom2 a[1] = {s_empty};
 		pd_anything(&pd_objectmaker,gensym("gf/mouse_spy"),1,a);
 		spy = (BFObject *)pd_newest(); if (!spy) RAISE("no spy?");
 		((MouseSpy *)spy->self)->snd = (t_pd *)bself;
@@ -385,8 +378,7 @@
 		t_canvas *can = mom; /* and not glist_getcanvas(mom) */
 		y-=text_ypix(bself,can)+4; x-=text_xpix(bself,can)+2;
 		if (hold || (y>=0 && y<sy-9 && x>=0 && x<sx-5)) {
-			t_atom a[4]; SETFLOAT(a+0,y); SETFLOAT(a+1,x); SETFLOAT(a+2,flags);
-			if (k) SETSYMBOL(a+3,k);
+			t_atom2 a[4] = {y,x,flags}; if (k) a[3]=k;
 			hold = (flags&-256) != 0;
 			out[0](gensym(sel),k?4:3,a);
 		}
@@ -490,11 +482,8 @@
  * 	sys_gui("set gridsee_socket [socket -server -port 9999]\n");
 	pd_anything(&pd_objectmaker,gensym("netsend"),0,0);
 	seesend = (t_pd *)pd_newest(); if (!seesend) post("no seesend?"); else post("seesend!");
-	t_atom a[2];
-	SETSYMBOL(a,gensym("localhost"));
-	SETFLOAT(a+1,9999);
 	post("preconnect");
-	pd_anything((t_pd *)seesend,gensym("connect"),2,a);
+	t_atom2 a[2] = {gensym("localhost"),9999}; pd_anything((t_pd *)seesend,gensym("connect"),2,a);
 	post("postconnect");
 */
 }

Modified: trunk/src/gem.cxx
==============================================================================
--- trunk/src/gem.cxx (original)
+++ trunk/src/gem.cxx Sat Aug 14 18:28:59 2010
@@ -119,7 +119,7 @@
 	\grin 1 int
 	\decl 0 gem_state (...) {
 		if (argc==2) render((GemState *)(void *)argv[1]); else startRendering();
-		outlet_anything(bself->te_outlet,gensym("gem_state"),argc,argv);
+		out[0](gensym("gem_state"),argc,argv);
 	}
 };
 



More information about the Gridflow-cvs mailing list