예제 #1
0
void main(void)
{	
	void *p,*q,*attr;
	long attrflags;
	
	jit_unpack_init();	
	setup(&max_jit_unpack_class, max_jit_unpack_new, (method)max_jit_unpack_free, (short)sizeof(t_max_jit_unpack), 
		0L, A_GIMME, 0);

	p = max_jit_classex_setup(calcoffset(t_max_jit_unpack,obex));
	q = jit_class_findbyname(gensym("jit_unpack"));
	
	addmess((method)max_jit_unpack_jit_matrix, "jit_matrix", A_GIMME,0); //place at beginning for speed
	max_jit_classex_mop_wrap(p,q,MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX);
//	max_jit_classex_mop_wrap(p,q,0);
    max_jit_classex_standard_wrap(p,q,0);
    
    attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"type",_jit_sym_symbol,attrflags,
		(method)max_jit_mop_gettype,(method)max_jit_mop_type,0/*custom*/);
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	max_jit_classex_addattr(p,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)max_jit_mop_getdim,(method)max_jit_mop_dim,0/*custom*/);
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	max_jit_classex_addattr(p,attr);
    
    addmess((method)max_jit_mop_assist, "assist", A_CANT,0);  
    addmess((method)max_jit_mop_variable_anything, "anything", A_GIMME, 0);  

}
예제 #2
0
void main(void)
{	
	void *p,*q,*attr;
	long attrflags;
	
	setup(&max_jit_op_class, max_jit_op_new, (method)max_jit_op_free, (short)sizeof(t_max_jit_op), 
		0L, A_GIMME, 0);

	p = max_jit_classex_setup(calcoffset(t_max_jit_op,obex));
	q = jit_class_findbyname(gensym("jit_op"));    
    
    addmess((method)max_jit_op_jit_matrix, "jit_matrix", A_GIMME, 0);
    max_jit_classex_mop_wrap(p,q,MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX); 		
    max_jit_classex_mop_mproc(p,q,max_jit_op_mproc); 	//custom mproc
    max_jit_classex_standard_wrap(p,q,0);
        
    attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW ;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"val",_jit_sym_atom,JIT_MATRIX_MAX_PLANECOUNT,attrflags,
		(method)0,(method)max_jit_op_val,calcoffset(t_max_jit_op,valcount),calcoffset(t_max_jit_op,val));
	max_jit_classex_addattr(p,attr);
 	
 	addint((method)max_jit_op_int);
 	addfloat((method)max_jit_op_float);
	addmess((method)max_jit_op_list, "list", A_GIMME, 0);
    addmess((method)max_jit_mop_assist, "assist", A_CANT,0);  
}
void C74_EXPORT main(void)
{
	void *p,*q,*attr;
	long attrflags;

	xray_jit_levelsetseg_init();
	setup((t_messlist **)&max_xray_jit_levelsetseg_class, max_xray_jit_levelsetseg_new, (method)max_xray_jit_levelsetseg_free, (short)sizeof(t_max_xray_jit_levelsetseg),
		0L, A_GIMME, 0);

	p = max_jit_classex_setup(calcoffset(t_max_xray_jit_levelsetseg,obex));
	q = jit_class_findbyname(gensym("xray_jit_levelsetseg"));

	addmess((method)max_xray_jit_levelsetseg_jit_matrix, "jit_matrix", A_GIMME, 0);
    max_jit_classex_mop_wrap(p,q,MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX);
    max_jit_classex_mop_mproc(p,q,max_xray_jit_levelsetseg_mproc); 	//custom mproc
    max_jit_classex_standard_wrap(p,q,0);

    attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW ;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"val",_jit_sym_float32,attrflags,
		(method)0,(method)max_xray_jit_levelsetseg_val,calcoffset(t_max_xray_jit_levelsetseg,val),calcoffset(t_max_xray_jit_levelsetseg,val));
	max_jit_classex_addattr(p,attr);

    addfloat((method)max_xray_jit_levelsetseg_float);
    addmess((method)max_jit_mop_assist, "assist", A_CANT,0);
}
예제 #4
0
void ext_main(void *r)
{
	long attrflags;
	void *p,*attr;

	setup((t_messlist **)&max_jit_peek_class, (method)max_jit_peek_new, (method)max_jit_peek_free, (short)sizeof(t_max_jit_peek),
		  0L, A_GIMME, 0);

	addmess((method)max_jit_peek_dsp, "dsp", A_CANT, 0);
	addmess((method)max_jit_peek_dsp64, "dsp64", A_CANT, 0);
	dsp_initclass();

	p = max_jit_classex_setup(calcoffset(t_max_jit_peek,obex));

	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW ;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"matrix_name",_jit_sym_symbol,attrflags,
						  (method)0L,(method)max_jit_peek_matrix_name,calcoffset(t_max_jit_peek,matrix_name));
	max_jit_classex_addattr(p,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Matrix Name\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"plane",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_max_jit_peek,plane));
	max_jit_classex_addattr(p,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Plane");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"interp",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_max_jit_peek,interp));
	max_jit_classex_addattr(p,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Interp");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"normalize",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_max_jit_peek,normalize));
	max_jit_classex_addattr(p,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Normalize");

	// because it is not safe to call jitter methods inside the perform routine,
	// we need notify message to find out when our matrix data is changing
	addmess((method)max_jit_peek_notify, "notify", A_CANT,0);

	max_jit_classex_standard_wrap(p,NULL,0);
	addmess((method)max_jit_peek_assist, "assist", A_CANT,0);
	return 0;
}
예제 #5
0
void main(void)
{	
	long attrflags;
	void *p,*attr;
	
	setup(&max_jit_turtle_class, max_jit_turtle_new, (method)max_jit_turtle_free, (short)sizeof(t_max_jit_turtle), 
		0L, A_GIMME, 0);

	p = max_jit_classex_setup(calcoffset(t_max_jit_turtle,obex));
	
 	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW ;

	// origin -- where to start drawing from (or reset to with a 'reset' message)
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"origin",_jit_sym_long,2,attrflags,
		(method)0,(method)0,calcoffset(t_max_jit_turtle,origincount),calcoffset(t_max_jit_turtle,origin));
	max_jit_classex_addattr(p,attr);

	// angle -- angle factor for turning the turtle
	attr = jit_object_new(_jit_sym_jit_attr_offset,"angle",_jit_sym_long,attrflags,
		(method)0,(method)0,calcoffset(t_max_jit_turtle,angle));
	max_jit_classex_addattr(p,attr);

	// scale -- stepsize for moving the turtle
	attr = jit_object_new(_jit_sym_jit_attr_offset,"scale",_jit_sym_long,attrflags,
		(method)0,(method)0,calcoffset(t_max_jit_turtle,scale));
	max_jit_classex_addattr(p,attr);

	// clearmode -- send a clear on reset or not
	attr = jit_object_new(_jit_sym_jit_attr_offset,"clearmode",_jit_sym_long,attrflags,
		(method)0,(method)0,calcoffset(t_max_jit_turtle,clearmode));
	max_jit_classex_addattr(p,attr);
	
	addmess((method)max_jit_turtle_reset,			"reset",			A_GIMME,0);
	
	max_jit_classex_standard_wrap(p,NULL,0);	
	addmess((method)max_jit_turtle_assist,			"assist",			A_CANT,0);
// 	addbang((method)max_jit_turtle_bang);
	addint((method)max_jit_turtle_int);
	
    max_jit_class_addmethods(jit_class_findbyname(gensym("jit_turtle")));	
}
예제 #6
0
int main(void)
{	
	void *p, *q;
	t_jit_object	*attr;
	
	post("jit.openni %s, Copyright (c) 2011 Dale Phurrough. This program comes with ABSOLUTELY NO WARRANTY.", JIT_OPENNI_VERSION);
	post("jit.openni %s, Licensed under the GNU General Public License v3.0 (GPLv3) available at http://www.gnu.org/licenses/gpl-3.0.html", JIT_OPENNI_VERSION);

	// initialize the Jitter class by calling Jitter class's registration function
	jit_openni_init();
	
	// create the Max wrapper class
	setup((t_messlist**)&max_jit_openni_class, (method)max_jit_openni_new, (method)max_jit_openni_free, sizeof(t_max_jit_openni), 0, A_GIMME, 0);
	
	// specify a byte offset to keep additional OBEX information
	p = max_jit_classex_setup(calcoffset(t_max_jit_openni, obex));
	
	// look up the Jitter class in the class registry
	q = jit_class_findbyname(gensym("jit_openni"));    
    
	// add default methods and attributes for MOP max wrapper class, e.g. name, type, dim, planecount, bang, outputmatrix, etc
	max_jit_classex_mop_wrap(p, q, MAX_JIT_MOP_FLAGS_OWN_OUTPUTMATRIX|MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX|MAX_JIT_MOP_FLAGS_OWN_ADAPT);

	// add custom max wrapper attributes
	attr = jit_object_new(_jit_sym_jit_attr_offset, "skeleton_format", _jit_sym_char, JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW,
			NULL, NULL, calcoffset(t_max_jit_openni, chrSkeletonOutputFormat));
	jit_attr_addfilterset_clip(attr,0,2,TRUE,TRUE);
	max_jit_classex_addattr(p, attr);

	// wrap the Jitter class with the standard methods for Jitter objects, e.g. getattributes, dumpout, maxjitclassaddmethods, etc
	max_jit_classex_standard_wrap(p, q, 0);

    // add methods to the Max wrapper class
	max_addmethod_usurp_low((method)max_jit_openni_outputmatrix, "outputmatrix");	
	max_addmethod_usurp_low((method)max_jit_openni_XMLConfig_read, "read");

	// add an inlet/outlet assistance method; in this case the default matrix-operator (mop) assist fn 
	addmess((method)max_jit_openni_assist, "assist", A_CANT, 0);
	return 0;
}