Пример #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
t_jit_err jit_submatrix_init(void) 
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	
	_jit_submatrix_class = jit_class_new("jit_submatrix",(method)jit_submatrix_new,(method)jit_submatrix_free,
		sizeof(t_jit_submatrix),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_output_nolink(mop,1);
	jit_class_addadornment(_jit_submatrix_class,mop);
	//add methods
	jit_class_addmethod(_jit_submatrix_class, (method)jit_submatrix_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_submatrix,dimcount),calcoffset(t_jit_submatrix,dim));
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	jit_class_addattr(_jit_submatrix_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"offset",_jit_sym_long,JIT_MATRIX_MAX_DIMCOUNT,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_submatrix,offsetcount),calcoffset(t_jit_submatrix,offset));
	jit_class_addattr(_jit_submatrix_class,attr);
	
	jit_class_register(_jit_submatrix_class);

	return JIT_ERR_NONE;
}
Пример #3
0
t_jit_err jit_rgb2luma_init(void)
{
	long attrflags=0;
	t_jit_object *attr, *mop, *o;

	_jit_rgb2luma_class = jit_class_new("jit_rgb2luma",(method)jit_rgb2luma_new,(method)jit_rgb2luma_free,
										sizeof(t_jit_rgb2luma),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_single_planecount(mop, 1);
	jit_mop_single_type(mop, _jit_sym_char);
	o=jit_object_method(mop,_jit_sym_getoutput,1);
	jit_attr_setlong(o,_jit_sym_planelink,0);
	jit_class_addadornment(_jit_rgb2luma_class,mop);

	//add methods
	jit_class_addmethod(_jit_rgb2luma_class, (method)jit_rgb2luma_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"ascale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,ascale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Alpha Scale\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rscale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,rscale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Red Scale\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"gscale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,gscale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Green Scale\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"bscale",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_rgb2luma,bscale));
	jit_class_addattr(_jit_rgb2luma_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Blue Scale\"");

	jit_class_register(_jit_rgb2luma_class);

	return JIT_ERR_NONE;
}
Пример #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
t_jit_err jit_coerce_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;

	_jit_coerce_class = jit_class_new("jit_coerce",(method)jit_coerce_new,(method)jit_coerce_free,
									  sizeof(t_jit_coerce),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_output_nolink(mop,1);
	jit_class_addadornment(_jit_coerce_class,mop);
	//add methods
	jit_class_addmethod(_jit_coerce_class, (method)jit_coerce_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);
	//add attributes
	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)0L,(method)0L,calcoffset(t_jit_coerce,type));
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	object_addattr_parse(attr,"basic",_jit_sym_long,0,"1");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Type");
	jit_class_addattr(_jit_coerce_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"planecount",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_coerce,planecount));
	object_addattr_parse(attr,"category",_jit_sym_symbol,0,"MOP");
	object_addattr_parse(attr,"basic",_jit_sym_long,0,"1");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Planecount");
	jit_class_addattr(_jit_coerce_class,attr);

	jit_class_register(_jit_coerce_class);

	return JIT_ERR_NONE;
}
Пример #6
0
t_jit_err jit_gl_hap_init(void) 
{
	void *ob3d;
	void *attr;
	long attrflags=0;
	long ob3d_flags = JIT_OB3D_NO_ROTATION_SCALE;
	ob3d_flags |= JIT_OB3D_NO_POLY_VARS;
	ob3d_flags |= JIT_OB3D_NO_BLEND;
	ob3d_flags |= JIT_OB3D_NO_TEXTURE;
	ob3d_flags |= JIT_OB3D_NO_MATRIXOUTPUT;
	ob3d_flags |= JIT_OB3D_AUTO_ONLY;
	ob3d_flags |= JIT_OB3D_NO_DEPTH;
	ob3d_flags |= JIT_OB3D_NO_ANTIALIAS;
	ob3d_flags |= JIT_OB3D_NO_FOG;
	ob3d_flags |= JIT_OB3D_NO_LIGHTING_MATERIAL;
	ob3d_flags |= JIT_OB3D_NO_SHADER;
	ob3d_flags |= JIT_OB3D_NO_BOUNDS;
	ob3d_flags |= JIT_OB3D_NO_COLOR;	
	
	_jit_gl_hap_class = jit_class_new("jit_gl_hap", 
		(method)jit_gl_hap_new, (method)jit_gl_hap_free,
		sizeof(t_jit_gl_hap),A_DEFSYM,0L);
	
	ob3d = jit_ob3d_setup(_jit_gl_hap_class, calcoffset(t_jit_gl_hap, ob3d), ob3d_flags);

	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_draw,			"ob3d_draw", A_CANT, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_dest_closing, "dest_closing", A_CANT, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_dest_changed, "dest_changed", A_CANT, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_object_register,		"register", A_CANT, 0L);

	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_read,			"read", A_GIMME, 0);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_sendoutput,	"sendoutput", A_DEFER_LOW, 0L);
	
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_dispose,	"dispose",	A_USURP_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_start,	"start",	A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_stop,		"stop",		A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_jump,		"jump",		A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_frame,	"frame",	A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_clear_looppoints,	"clear_looppoints", A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_loadram,	"loadram",	A_DEFER_LOW, 0L);
	jit_class_addmethod(_jit_gl_hap_class, (method)jit_gl_hap_loadram,	"unloadram",A_DEFER_LOW, 0L);
	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	//attr = jit_object_new(_jit_sym_jit_attr_offset,"adapt",_jit_sym_char,attrflags,
	//	(method)0L,(method)0L,calcoffset(t_jit_gl_hap,adapt));
	//jit_class_addattr(_jit_gl_hap_class,attr);
	//object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,2,attrflags,
		(method)0L,(method)0L,0,calcoffset(t_jit_gl_hap,dim));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	//attr = jit_object_new(_jit_sym_jit_attr_offset_array,"rect",_jit_sym_float32,4,attrflags,
	//	(method)0L,(method)0L,0,calcoffset(t_jit_gl_hap,rect));
	//jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"time",_jit_sym_long,attrflags,
		(method)jit_gl_hap_time_get,(method)jit_gl_hap_time_set,0L);
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loop",_jit_sym_char,attrflags,
		(method)0L,(method)jit_gl_hap_loop_set,calcoffset(t_jit_gl_hap,loop));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"enumindex");
	object_addattr_parse(attr,"enumvals",_jit_sym_atom,0,"off normal palindrome playback-limits");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"autostart",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,autostart));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
		
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rate",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_hap_rate_set,calcoffset(t_jit_gl_hap,rate));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"vol",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_hap_vol_set,calcoffset(t_jit_gl_hap,vol));
	jit_class_addattr(_jit_gl_hap_class,attr);	
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rate_preserves_pitch",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,rate_preserves_pitch));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
		
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loopstart",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_hap_loopstart,calcoffset(t_jit_gl_hap,looppoints[0]));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loopend",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_hap_loopend,calcoffset(t_jit_gl_hap,looppoints[1]));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"looppoints",_jit_sym_long,2,attrflags,
		(method)0L,(method)jit_gl_hap_looppoints,0,calcoffset(t_jit_gl_hap,looppoints));
	jit_class_addattr(_jit_gl_hap_class,attr);
		
	attr = jit_object_new(_jit_sym_jit_attr_offset,"loopreport",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,loopreport));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"framereport",_jit_sym_char,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap, framereport));
	jit_class_addattr(_jit_gl_hap_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"out_name",_jit_sym_symbol, attrflags,
		(method)jit_gl_hap_getattr_out_name,(method)jit_gl_hap_setattr_out_name,0);
	jit_class_addattr(_jit_gl_hap_class,attr);	

	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"fps",_jit_sym_float32,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,fps));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"duration",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,duration));
	jit_class_addattr(_jit_gl_hap_class,attr);
			
	attr = jit_object_new(_jit_sym_jit_attr_offset,"timescale",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,timescale));
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"framecount",_jit_sym_long,attrflags,
		(method)0L,(method)0L,calcoffset(t_jit_gl_hap,framecount));
	jit_class_addattr(_jit_gl_hap_class,attr);
				
	// hide default ob3d attrs that aren't used
	attrflags = JIT_ATTR_GET_OPAQUE_USER | JIT_ATTR_SET_OPAQUE_USER;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"position",_jit_sym_float32,3,attrflags,
		(method)0L,(method)0L,0,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"anchor",_jit_sym_float32,3,attrflags,
		(method)0L,(method)0L,0,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"anim",_jit_sym_symbol, attrflags,
		(method)0L,(method)0L,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"animmode",_jit_sym_symbol, attrflags,
		(method)0L,(method)0L,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"filterclass",_jit_sym_symbol, attrflags,
		(method)0L,(method)0L,0);
	jit_class_addattr(_jit_gl_hap_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"layer",_jit_sym_long,attrflags,
		(method)0L,(method)0L,0L);
	jit_class_addattr(_jit_gl_hap_class,attr);
	
	jit_class_register(_jit_gl_hap_class);

	ps_bind = gensym("bind");
	ps_unbind = gensym("unbind");
	ps_width = gensym("width");
	ps_height = gensym("height");
	ps_glid = gensym("glid");	
	ps_draw = gensym("draw");

	return JIT_ERR_NONE;
}
Пример #7
0
t_jit_err jit_gl_videoplane_init(void)
{
	long attrflags=0;
	long ob3d_flags=0;
	t_jit_object *attr;
	void *ob3d;

	_jit_gl_videoplane_class = jit_class_new("jit_gl_videoplane", (method)jit_gl_videoplane_new, (method)jit_gl_videoplane_free,
							   sizeof(t_jit_gl_videoplane),A_DEFSYM,0L);

	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_jit_matrix,		"jit_matrix", 			A_USURP_LOW, 0);
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_sendtexture,	"sendtexture", 			A_DEFER_LOW, 0);

	// set up object extension for 3d object, customized with flags
	ob3d = jit_ob3d_setup(_jit_gl_videoplane_class, calcoffset(t_jit_gl_videoplane, ob3d), ob3d_flags);

	// add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,2,attrflags,
						  (method)0L,(method)jit_gl_videoplane_dim,0/*fix*/,calcoffset(t_jit_gl_videoplane,dim));
	jit_attr_addfilterset_clip(attr,2,0,TRUE,FALSE);
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"displaylist",_jit_sym_char,attrflags,
						  (method)0L,(method)jit_gl_videoplane_displaylist,calcoffset(t_jit_gl_videoplane, displaylist));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Displaylist");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"gridmode",_jit_sym_char,attrflags,
						  (method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, gridmode));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	CLASS_ATTR_ENUM(_jit_gl_videoplane_class,"gridmode",0,"trigrid quadgrid");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Grid Mode\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"interp",_jit_sym_long,attrflags,
						  (method)0L,(method)jit_gl_videoplane_interp,calcoffset(t_jit_gl_videoplane, interp));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"style",_jit_sym_symbol,0,"onoff");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Interp");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"nudge",_jit_sym_float32,attrflags,
						  (method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, nudge));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Nudge");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_offset_x",_jit_sym_float32,attrflags,
						  (method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_offset_x));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Tex Offset X\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_offset_y",_jit_sym_float32,attrflags,
						  (method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_offset_y));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Tex Offset Y\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_scale_x",_jit_sym_float32,attrflags,
						  (method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_scale_x));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Tex Scale X\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_scale_y",_jit_sym_float32,attrflags,
						  (method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_scale_y));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Tex Scale Y\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rect_tex",_jit_sym_long,attrflags,
						  (method)0L,(method)jit_gl_videoplane_rect_tex,calcoffset(t_jit_gl_videoplane, rect_tex));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Rect Tex\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"client_storage",_jit_sym_long,attrflags,
						  (method)0L,(method)jit_gl_videoplane_client_storage,calcoffset(t_jit_gl_videoplane, client_storage));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Client Storage\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"colormode",_jit_sym_symbol,attrflags,
						  (method)0L,(method)jit_gl_videoplane_colormode,calcoffset(t_jit_gl_videoplane, colormode));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	CLASS_ATTR_ENUM(_jit_gl_videoplane_class,"colormode",0,"argb uyvy");
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Colormode");

	attr = jit_object_new(_jit_sym_jit_attr_offset,"texturename",_jit_sym_symbol,attrflags,
						  (method)0L,(method)jit_gl_videoplane_texturename,calcoffset(t_jit_gl_videoplane, texturename));
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Texture Name\"");

	// define our OB3D draw method.  called in automatic mode by
	// jit.gl.render or otherwise through ob3d when banged. this
	// method is A_CANT because our draw setup needs to happen
	// in the ob3d beforehand to initialize OpenGL state
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_draw, "ob3d_draw", A_CANT, 0L);

	// define our dest_closing and dest_changed methods.
	// these methods are called by jit.gl.render when the
	// destination context closes or changes: for example, when
	// the user moves the window from one monitor to another. Any
	// resources your object keeps in the OpenGL machine
	// (e.g. textures, display lists, vertex shaders, etc.)
	// will need to be freed when closing, and rebuilt when it has
	// changed.
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_dest_changed, "dest_changed",	A_CANT, 0L);
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_dest_closing, "dest_closing",	A_CANT, 0L);

	// rebuild_geometry is called if texture units or other
	// attributes change requiring a rebuild
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_rebuild_geometry, "rebuild_geometry", 0L);

	// must register for ob3d
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_object_register, 				"register",		A_CANT, 0L);

	jit_attr_addfilterset_proc(jit_class_attr_get(_jit_gl_videoplane_class,gensym("drawto")),(method)jit_gl_videoplane_drawto_filter);

	jit_class_register(_jit_gl_videoplane_class);

	ps_bind				= gensym("bind");
	ps_unbind			= gensym("unbind");
	ps_jit_gl_texture	= gensym("jit_gl_texture");
	ps_rectangle		= gensym("rectangle");
	ps_colormode		= gensym("colormode");
	ps_mode				= gensym("mode");
	ps_static			= gensym("static");
	ps_dynamic			= gensym("dynamic");
	ps_drawto			= gensym("drawto");
	ps_texture			= gensym("texture");
	ps_filter			= gensym("filter");
	ps_linear			= gensym("linear");
	ps_nearest			= gensym("nearest");

	ps_gridmode			= gensym("gridmode");
	ps_nudge			= gensym("nudge");
	ps_tex_offset_x		= gensym("tex_offset_x");
	ps_tex_offset_y		= gensym("tex_offset_y");
	ps_tex_scale_x		= gensym("tex_scale_x");
	ps_tex_scale_y		= gensym("tex_scale_y");


	return JIT_ERR_NONE;
}
Пример #8
0
t_jit_err jit_print_init(void)
{
	long attrflags=0;
	t_jit_object *attr;
	t_jit_object *mop;

	_jit_print_class = jit_class_new("jit_print",(method)jit_print_new,(method)jit_print_free,
									 sizeof(t_jit_print),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1);
	jit_class_addadornment(_jit_print_class,mop);
	//add methods
	jit_class_addmethod(_jit_print_class, (method)jit_print_matrix_calc, "matrix_calc", A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset,"precision",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,precision));
	jit_attr_addfilterset_clip(attr,0,0,TRUE,FALSE);	//clip to 0-x
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Precision");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"fieldwidth",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,fieldwidth));
	jit_attr_addfilterset_clip(attr,0,0,TRUE,FALSE);	//clip to 0-x
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Field Width\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,mode));
	jit_attr_addfilterset_clip(attr,0,2,TRUE,TRUE);	//clip to 0-2
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Mode");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"zeropad",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print,zeropad));
	jit_attr_addfilterset_clip(attr,0,1,TRUE,TRUE);	//clip to 0-1
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Zero Pad\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"planedelim",_jit_sym_symbol,attrflags,
						  (method)jit_print_planedelim_get,(method)jit_print_planedelim_set,0L);
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Plane Delimiter\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"coldelim",_jit_sym_symbol,attrflags,
						  (method)jit_print_coldelim_get,(method)jit_print_coldelim_set,0L);
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Column Delimiter\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rowdelim",_jit_sym_symbol,attrflags,
						  (method)jit_print_rowdelim_get,(method)jit_print_rowdelim_set,0L);
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"\"Row Delimiter\"");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"title",_jit_sym_symbol,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print, title));
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Title");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"info",_jit_sym_char,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_print, info));
	jit_attr_addfilterset_clip(attr,0,2,TRUE,TRUE);	//clip to 0-1
	jit_class_addattr(_jit_print_class,attr);
	object_addattr_parse(attr,"label",_jit_sym_symbol,0,"Info");
	

	jit_class_register(_jit_print_class);
	ps_null = gensym("");
	ps_tab = gensym("tab");
	ps_cr = gensym("cr");
	ps_space = gensym("space");

	return JIT_ERR_NONE;
}