示例#1
0
文件: huygens~.c 项目: CICM/PotPourri
int main(void)
{	
	t_class *c;
	
	c = class_new("huygens~", (method)Huygens_new, (method)Huygens_free, (long)sizeof(t_Huygens), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)Huygens_dsp,			"dsp",			A_CANT, 0);
	class_addmethod(c, (method)Huygens_dsp64,		"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)Huygens_assist,		"assist",		A_CANT, 0);
	class_addmethod(c, (method)Huygens_float,		"float",		A_FLOAT, 0);
	class_addmethod(c, (method)Huygens_float,		"int",			A_LONG, 0);
	
	CLASS_ATTR_LONG				(c, "shape", 0, t_Huygens, f_mode);
	CLASS_ATTR_LABEL			(c, "shape", 0, "Shape of the loudspeakers array");
	CLASS_ATTR_ENUMINDEX		(c, "shape", 0, "Linear \" \"Circular");
	CLASS_ATTR_SAVE				(c, "shape", 1);
	CLASS_ATTR_FILTER_CLIP		(c, "shape", 0, 1);
	CLASS_ATTR_ORDER			(c, "shape", 0, "0");
	
	CLASS_ATTR_FLOAT			(c, "distance", 0, t_Huygens, f_speakersDistance);
	CLASS_ATTR_LABEL			(c, "distance", 0, "Distance between speakers array and listener");
	//CLASS_ATTR_ACCESSORS		(c, "distance", NULL, distance_set);
	CLASS_ATTR_SAVE				(c, "distance", 1);
	CLASS_ATTR_FILTER_MIN		(c, "distance", 0.);
	CLASS_ATTR_ORDER			(c, "distance", 0, "1");
	
	CLASS_ATTR_FLOAT			(c, "delta", 0, t_Huygens, f_speakersDelta);
	CLASS_ATTR_LABEL			(c, "delta", 0, "Distance between speakers");
	//CLASS_ATTR_ACCESSORS		(c, "delta", NULL, delta_set);
	CLASS_ATTR_SAVE				(c, "delta", 1);
	CLASS_ATTR_FILTER_MIN		(c, "delta", 0.);
	CLASS_ATTR_ORDER			(c, "delta", 0, "2");
	
	CLASS_ATTR_LONG				(c, "interpolation", 0, t_Huygens, f_interpolation);
	CLASS_ATTR_LABEL			(c, "interpolation", 0, "Delay interpolation");
	CLASS_ATTR_ENUMINDEX		(c, "interpolation", 0, "Linear \" \"Quadratic \" \"Lagrange");
	CLASS_ATTR_SAVE				(c, "interpolation", 1);
	CLASS_ATTR_FILTER_CLIP		(c, "interpolation", 0, 2);
	CLASS_ATTR_ORDER			(c, "interpolation", 0, "3");
	
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	Huygens_class = c;
	
	post("huygens~ by Julien Colafrancesco & Pierre Guillot");
	post("Copyright (C) 2012, CICM / Universite Paris 8");
	
	return 0;
}
示例#2
0
void C74_EXPORT ext_main(void *r)
{
	t_class *c;
	c = class_new("3Dpoltocar", (method)dpoltocar_new,0L, (short)sizeof(t_dpoltocar), 0L, A_DEFLONG, A_DEFLONG, 0);
    class_addmethod(c, (method)dpoltocar_assist	,	"assist",	A_CANT,	0L);
    class_addmethod(c, (method)dpoltocar_bang,		"bang",				0L);
    class_addmethod(c, (method)dpoltocar_list,		"list",		A_GIMME,0L);
//    class_addmethod(c, (method)dpoltocar_mode,		"mode",		A_LONG, 0L);
//    class_addmethod(c, (method)inspector_open,		"info",		A_CANT,	0L);
	
	
//	CLASS_STICKY_ATTR(c,                                "category",	0L, "3Dcartopol");
	
	CLASS_ATTR_LONG(c,                                  "mode",		0L, t_dpoltocar, d_mode);
	CLASS_ATTR_LABEL(c,                                 "mode",		0L, "angle mode");
	CLASS_ATTR_STYLE(c,                                 "mode",		0L, "enum");
	CLASS_ATTR_ENUMINDEX(c,                             "mode",		0L, "\"radians\" \"degrees\"");
	CLASS_ATTR_SAVE(c,                                  "mode",		0L );
	CLASS_ATTR_FILTER_CLIP(c,                           "mode",		0, 1);
	CLASS_ATTR_ORDER(c,                                 "mode",		0L, "0");
	
	my_pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068;
	half_pi = my_pi / 2.0;
	divide_pi = my_pi / 180.0;
	two_pi = 2.0 * my_pi;
	divide_two_pi = 1.0 / two_pi;
	class_register(CLASS_BOX, c);
	dpoltocar_class = c;
	post("·    3Dpoltocar    ·    jasch    ·    "__DATE__"    ·    © all rights reserved",0);
	return;
}
示例#3
0
int C74_EXPORT main(void)
{
	t_class *c = class_new("j.meter~", (method)meter_new, (method)meter_free, sizeof(t_meter), (method)NULL, A_GIMME, 0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY; // use dictionary constructor
	jbox_initclass(c, 0);
	class_dspinitjbox(c);

//	jamoma_init();
	common_symbols_init();
	
	class_addmethod(c, (method)meter_bang,		"bang",			0);
	class_addmethod(c, (method)meter_int,		"int",			A_LONG, 0);
	class_addmethod(c, (method)meter_float,		"float",		A_FLOAT, 0);
	class_addmethod(c, (method)meter_set,    	"set",			A_FLOAT, 0);
	class_addmethod(c, (method)meter_dsp,		"dsp",			A_CANT, 0);
	class_addmethod(c, (method)meter_dsp64,		"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)meter_paint,		"paint",		A_CANT, 0);
	class_addmethod(c, (method)meter_oksize,	"oksize",		A_CANT, 0);
	class_addmethod(c, (method)meter_bang,		"mousedown",	A_CANT, 0);
	class_addmethod(c, (method)meter_notify,	"notify",		A_CANT, 0);
	class_addmethod(c, (method)meter_assist,	"assist",		A_CANT, 0);
	
//	CLASS_ATTR_FLOAT(c,					"interval",			0,	t_meter, attrInterval);
//	CLASS_ATTR_FILTER_CLIP(c,			"interval",			kPollIntervalMinimum, kPollIntervalMaximum);
//	CLASS_ATTR_DEFAULT_SAVE(c,			"interval",			0,	"150");
//	CLASS_ATTR_LABEL(c,					"interval",			0,	"Refresh Interval in Milliseconds");
		
//	CLASS_ATTR_RGBA(c,					"bordercolor",		0,	t_meter, attrBorderColor);
//	CLASS_ATTR_STYLE_LABEL(c,			"bordercolor",		0,	"rgba",	"Border Color");
//	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,	"bordercolor",		0,	"0.2 0.2 0.2 1.");

	CLASS_ATTR_LONG(c,						"orientation",	0, t_meter, attrOrientation);
	CLASS_ATTR_LABEL(c,						"orientation",	0, "Orientation");
	CLASS_ATTR_CATEGORY(c,					"orientation",	0,"Appearance");
	CLASS_ATTR_ENUMINDEX(c,					"orientation",	0, "Automatic Horizontal Vertical");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,		"orientation",	0,"0");
	
	CLASS_ATTR_RGBA(c,						"bgcolor",		0,	t_meter,	attrBgColor);
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c,	"bgcolor",		0,	"0.1 0.1 0.1 1.0");
	CLASS_ATTR_STYLE(c,						"bgcolor",		0,	"rgba");
	CLASS_ATTR_LABEL(c,						"bgcolor",		0,	"Background Color");
	
	CLASS_ATTR_LONG(c,						"defeat",	0, t_meter, attrDefeat);
	CLASS_ATTR_LABEL(c,						"defeat",	0, "defeat");	
	CLASS_ATTR_DEFAULT(c,					"defeat",	0,	"0");
	CLASS_ATTR_SAVE(c,						"defeat",	0);
	CLASS_ATTR_STYLE(c,						"defeat",	0,	"onoff");	
	CLASS_ATTR_CATEGORY(c,					"defeat",	0,"Behavior");
	
	CLASS_ATTR_DEFAULT(c,				"patching_rect",	0,	"0. 0. 100. 12.");
	CLASS_ATTR_MIN(c,					"patching_size",	0,	"1. 1.");

//	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,	"bgcolor",			0,	"0.1 0.1 0.1 1.0");
	
	class_register(CLASS_BOX, c);
	s_meter_class = c;		
	return 0;
}
示例#4
0
t_jit_err jit_fluoride_init(void)
{
	long attrflags=0;
	t_jit_object *attr, *mop;

	_jit_fluoride_class = jit_class_new("jit_fluoride",(method)jit_fluoride_new,(method)jit_fluoride_free,
										sizeof(t_jit_fluoride),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,1,1); //#inputs,#outputs
	jit_mop_single_type(mop,_jit_sym_char);
	jit_mop_single_planecount(mop,4);
	jit_class_addadornment(_jit_fluoride_class,mop);

	//add methods
	jit_class_addmethod(_jit_fluoride_class, (method)jit_fluoride_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;

	CLASS_STICKY_CATEGORY(_jit_fluoride_class,0,"Behavior");
	CLASS_STICKY_ATTR(_jit_fluoride_class,"basic",0,"1");

	// glow -- sets color for neon effect
	attr = jit_object_new(_jit_sym_jit_attr_offset_array, "glow", _jit_sym_float64, 3,
						  attrflags, (method)0L, (method)0L, calcoffset(t_jit_fluoride, glowcount),
						  calcoffset(t_jit_fluoride,glow));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_STYLE_LABEL(_jit_fluoride_class,"glow",0,"rgb","Glow Color");

	// lum -- moves center luminosity
	attr = jit_object_new(_jit_sym_jit_attr_offset,"lum",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_fluoride,lum));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_LABEL(_jit_fluoride_class,"lum",0,"Luminosity");

	// tol -- width of neon tolerance
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tol",_jit_sym_float64,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_fluoride,tol));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_LABEL(_jit_fluoride_class,"tol",0,"Tolerance");

	// mode -- b/w (0) or color (1)
	attr = jit_object_new(_jit_sym_jit_attr_offset,"mode",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_fluoride,mode));
	jit_class_addattr(_jit_fluoride_class,attr);
	CLASS_ATTR_LABEL(_jit_fluoride_class,"mode",0,"Color Mode");
	CLASS_ATTR_ENUMINDEX(_jit_fluoride_class, "mode", 0, "\"Black and White\" Color");

	CLASS_STICKY_CATEGORY_CLEAR(_jit_fluoride_class);
	CLASS_STICKY_ATTR_CLEAR(_jit_fluoride_class, "basic");

	jit_class_register(_jit_fluoride_class);

	return JIT_ERR_NONE;
}
示例#5
0
int C74_EXPORT main(void)				// main recieves a copy of the Max function macros table
{
	t_class *c;
	
	TTDSPInit();
	common_symbols_init();
	
	// Define our class
	c = class_new("j.xfade~", (method)fade_new, (method)fade_free, sizeof(t_fade), (method)0L, A_GIMME, 0);
	
	// Make methods accessible for our class: 
	class_addmethod(c, (method)fade_float,				"float",	A_FLOAT,0L);
	class_addmethod(c, (method)fade_dsp, 				"dsp",		A_CANT, 0L);
	class_addmethod(c, (method)fade_dsp64,				"dsp64",	A_CANT, 0);
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout",	A_CANT,	0);
    class_addmethod(c, (method)fade_assist, 			"assist",	A_CANT, 0L);
	class_addmethod(c, (method)jamoma_fileusage, "fileusage", A_CANT, 0);
	
	// Add attributes to our class:
	CLASS_ATTR_LONG(c,		"shape",		0,	t_fade, attr_shape);
	CLASS_ATTR_ACCESSORS(c,	"shape",		NULL, attr_set_shape);
	CLASS_ATTR_ENUMINDEX(c,	"shape",		0, "EqualPower Linear SquareRoot");

	CLASS_ATTR_LONG(c,		"mode",			0,	t_fade, attr_mode);
	CLASS_ATTR_ACCESSORS(c,	"mode",			NULL, attr_set_mode);
	CLASS_ATTR_ENUMINDEX(c,	"mode",			0, "LookupTable Calculate");

	CLASS_ATTR_FLOAT(c,		"position",		0,	t_fade, attr_position);
	CLASS_ATTR_ACCESSORS(c,	"position",		NULL, attr_set_position);	
	
	// Setup our class to work with MSP
	class_dspinit(c);
	
	// Finalize our class
	class_register(CLASS_BOX, c);
	s_fade_class = c;
	return 0;
}
示例#6
0
文件: uisimp4.c 项目: CICM/max6-sdk
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("uisimp4", 
							(method)uisimp_new,
							(method)uisimp_free,
							sizeof(t_uisimp),
							(method)NULL,
							A_GIMME,
							0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);
	
	class_addmethod(c, (method) uisimp_paint, "paint", A_CANT, 0);
	class_addmethod(c, (method) uisimp_int, "int", A_LONG, 0);
	
	class_addmethod(c, (method) uisimp_mousedown, "mousedown", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mousedragdelta, "mousedragdelta", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mouseup, "mouseup", A_CANT, 0);

	class_addmethod(c, (method) uisimp_assist, "assist", A_CANT, 0);
	class_addmethod(c, (method) jbox_notify, "notify", A_CANT, 0);

	CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0 0 60 60");
	CLASS_ATTR_DEFAULT(c, "color", 0, "0.8 0.5 0.2 1");
	
	CLASS_ATTR_LONG(c,"inset",0, t_uisimp, j_inset);
	CLASS_ATTR_LABEL(c,"inset",0,"Filled Area Inset");
	CLASS_ATTR_CATEGORY(c,"inset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"inset",0,"3");
	
	CLASS_ATTR_CHAR(c,"reset",0, t_uisimp, j_reset);
	CLASS_ATTR_STYLE_LABEL(c,"reset",0,"onoff","Reset Counter on Click");
	CLASS_ATTR_CATEGORY(c,"reset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE(c,"reset",0,"1");
	
	CLASS_ATTR_LONG(c,"shape",0, t_uisimp, j_shape);
	CLASS_ATTR_LABEL(c,"shape", 0, "Fill Shape");
	CLASS_ATTR_CATEGORY(c,"shape",0,"Shape");
	CLASS_ATTR_ENUMINDEX(c,"shape", 0, "Square Circle Angle");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"shape",0,"0");
	
	s_uisimp_class = c;
	class_register(CLASS_BOX, s_uisimp_class);
	return 0;
}
示例#7
0
extern "C" int C74_EXPORT main(void)
{
	t_class *c;

	c = class_new("tap.radians~",(method)radians_new, (method)radians_free, sizeof(t_radians), 
		(method)0L, A_GIMME, 0);

		common_symbols_init();														// Initialize TapTools
	class_addmethod(c, (method)radians_dsp64, "dsp64", A_CANT, 0);
    class_addmethod(c, (method)radians_float, 			"float", A_FLOAT, 0L);	// Input as double
    class_addmethod(c, (method)radians_assist, 			"assist", A_CANT, 0L); 
	class_addmethod(c, (method)stdinletinfo,			"inletinfo",	A_CANT, 0);

	CLASS_ATTR_LONG(c,		"mode",		0,	t_radians, radians_mode);
	CLASS_ATTR_ENUMINDEX(c,	"mode",		0,	"hz-to-radians radians-to-hertz degrees-to-radians radians-to-degrees");

	class_dspinit(c);									// Setup object's class to work with MSP
class_register(_sym_box, c); 	radians_class = c;
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.2d.meter~", (method)meter_new, (method)meter_free, (short)sizeof(t_meter), 0L, A_GIMME, 0);
    class_setname((char *)"hoa.2d.meter~", (char *)"hoa.2d.meter~");
    
    c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
    class_dspinitjbox(c);
    jbox_initclass(c, JBOX_COLOR);
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    // @method signal @digest Array of signals to visualize.
    // @description Array of signals to visualize.
    // @marg 0 @name channel-signal @optional 0 @type signal
    class_addmethod(c, (method) meter_dsp64,		 "dsp64",		  A_CANT, 0);
    class_addmethod(c, (method) meter_assist,		 "assist",		  A_CANT, 0);
    class_addmethod(c, (method) meter_paint,		 "paint",		  A_CANT, 0);
    class_addmethod(c, (method) meter_notify,        "notify",		  A_CANT, 0);
    
    CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 150 150");
    CLASS_ATTR_INVISIBLE            (c, "color", 0);
    
    /* APPEARANCE */
    CLASS_STICKY_CATEGORY           (c, 0, "Appearance");
    CLASS_ATTR_LONG                 (c, "ledsbg", 0, t_meter, f_drawledsbg);
    CLASS_ATTR_ORDER                (c, "ledsbg", 0, "1");
    CLASS_ATTR_STYLE_LABEL          (c, "ledsbg", 0, "onoff", "Draw Leds Background");
    CLASS_ATTR_DEFAULT              (c, "ledsbg", 0, "1");
    CLASS_ATTR_SAVE                 (c, "ledsbg", 1);
    // @description Draw leds background ?
    
    CLASS_ATTR_LONG                 (c, "vectors", 0, t_meter, f_drawvector);
    CLASS_ATTR_ORDER                (c, "vectors", 0, "2");
    CLASS_ATTR_LABEL                (c, "vectors", 0, "Draw Vectors");
    CLASS_ATTR_ENUMINDEX4           (c, "vectors", 0, "none", "energy", "velocity", "both")
    CLASS_ATTR_DEFAULT              (c, "vectors", 0, "1");
    CLASS_ATTR_SAVE                 (c, "vectors", 1);
    // @description The vector(s) to draw.
    
    CLASS_ATTR_LONG                 (c, "mborder", 0, t_meter, f_drawmborder);
    CLASS_ATTR_ORDER                (c, "mborder", 0, "3");
    CLASS_ATTR_LABEL                (c, "mborder", 0, "Draw Meter Borders");
    CLASS_ATTR_ENUMINDEX4           (c, "mborder", 0, "none", "Circles", "Axes", "both")
    CLASS_ATTR_DEFAULT              (c, "mborder", 0, "3");
    CLASS_ATTR_SAVE                 (c, "mborder", 1);
    // @description The meter border(s) to draw.
    
    CLASS_ATTR_DOUBLE               (c, "metersize", 0, t_meter, f_metersize);
    CLASS_ATTR_ORDER                (c, "metersize", 0, "4");
    CLASS_ATTR_LABEL                (c, "metersize", 0, "Meter Circle Size");
    CLASS_ATTR_FILTER_CLIP          (c, "metersize", 0., 1);
    CLASS_ATTR_DEFAULT              (c, "metersize", 0, "0.8");
    CLASS_ATTR_SAVE                 (c, "metersize", 1);
    // @description The size of the inner circle of the <o>hoa.2d.meter~</o>.
    
    CLASS_ATTR_LONG                 (c, "orientation", 0, t_meter, f_direction);
    CLASS_ATTR_LABEL                (c, "orientation", 0, "Meter Fill Orientation");
    CLASS_ATTR_ORDER                (c, "orientation", 0, "5");
    CLASS_ATTR_ENUMINDEX            (c, "orientation", 0, "inside outside");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "orientation", 0, "0");
    // @description The filling orientation of the peak level indicators <o>hoa.2d.meter~</o>.
    
    CLASS_STICKY_CATEGORY_CLEAR (c);
    
    CLASS_STICKY_CATEGORY           (c, 0, "Behavior");
    CLASS_ATTR_LONG                 (c, "channels", 0 , t_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "channels", channels_get, channels_set);
    CLASS_ATTR_ORDER                (c, "channels", 0, "1");
    CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
    CLASS_ATTR_SAVE                 (c, "channels", 1);
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    // @description The number of displayed channel and peak level indicators.
    
    CLASS_ATTR_DOUBLE_VARSIZE       (c, "angles", ATTR_SET_DEFER_LOW, t_meter, f_attrs, f_attrs, MAX_UI_CHANNELS);
    CLASS_ATTR_ACCESSORS            (c, "angles", angles_get, angles_set);
    CLASS_ATTR_ORDER                (c, "angles", 0, "2");
    CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Channels");
    CLASS_ATTR_SAVE                 (c, "angles", 1);
    // @description The angles of the displayed channels and peak level indicators. Values are in degrees, wrapped between 0. and 360., so you can also set the angles with negative values.
    
    CLASS_ATTR_DOUBLE               (c, "offset", 0, t_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "offset", offset_get, offset_set);
    CLASS_ATTR_ORDER                (c, "offset", 0, "3");
    CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
    CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
    CLASS_ATTR_SAVE                 (c, "offset", 1);
    // @description Display offset of channels and peak level indicators. the value is in degree, clipped between -180. and 180.
    
    CLASS_ATTR_LONG                 (c, "rotation", 0, t_meter, f_rotation);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
    CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
    CLASS_ATTR_ENUMINDEX            (c, "rotation", 0, "clockwise anti-clockwise");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation",0, "1");
    // @description The rotation can either be <b>clockwise</b> or <b>anti-clockwise</b>
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_meter, f_interval);
    CLASS_ATTR_ORDER                (c, "interval", 0, "5");
    CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
    CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
    CLASS_ATTR_DEFAULT              (c, "interval", 0, "50");
    CLASS_ATTR_SAVE                 (c, "interval", 1);
    // @description The refresh interval time in milliseconds.
    
    CLASS_STICKY_CATEGORY_CLEAR     (c);
    
    CLASS_ATTR_LONG                 (c, "dbperled", 0, t_meter, f_dbperled);
    CLASS_ATTR_CATEGORY             (c, "dbperled", 0, "Value");
    CLASS_ATTR_ORDER                (c, "dbperled", 0, "4");
    CLASS_ATTR_LABEL                (c, "dbperled", 0, "DeciBels per Led");
    CLASS_ATTR_FILTER_CLIP          (c, "dbperled", 1, 12);
    CLASS_ATTR_DEFAULT              (c, "dbperled", 0, "3");
    CLASS_ATTR_SAVE                 (c, "dbperled", 1);
    // @description Sets the amount of signal level in deciBels represented by each LED. By default each LED represents a 3dB change in volume from its neighboring LEDs.
    
    CLASS_ATTR_LONG                 (c, "nhotleds", 0, t_meter, f_nhotleds);
    CLASS_ATTR_CATEGORY             (c, "nhotleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "nhotleds", 0, "5");
    CLASS_ATTR_LABEL                (c, "nhotleds", 0, "Number of Hot Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "nhotleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "nhotleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "nhotleds", 1);
    // @description Sets the total number "hot" warning LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>hotcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "ntepidleds", 0, t_meter, f_ntepidleds);
    CLASS_ATTR_CATEGORY             (c, "ntepidleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "ntepidleds", 0, "6");
    CLASS_ATTR_LABEL                (c, "ntepidleds", 0, "Number of Tepid Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "ntepidleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "ntepidleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "ntepidleds", 1);
    // @description Sets the total number "tepid" mid-range LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>tepidcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "nwarmleds", 0, t_meter, f_nwarmleds);
    CLASS_ATTR_CATEGORY             (c, "nwarmleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "nwarmleds", 0, "7");
    CLASS_ATTR_LABEL                (c, "nwarmleds", 0, "Number of Warm Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "nwarmleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "nwarmleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "nwarmleds", 1);
    // @description Sets the total number "warm" lower-mid-range LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>warmcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "numleds", 0, t_meter, f_numleds);
    CLASS_ATTR_CATEGORY             (c, "numleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "numleds", 0, "8");
    CLASS_ATTR_LABEL                (c, "numleds", 0, "Total Number of Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "numleds", 10, 20);
    CLASS_ATTR_DEFAULT              (c, "numleds", 0, "12");
    CLASS_ATTR_SAVE                 (c, "numleds", 1);
    // @description The word numleds, followed by a number between 10 and 20, sets the total number of LEDs displayed on the <o>hoa.2d.meter~</o> object. The range is 10-20 LEDs.
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_meter, f_color_bg);
    CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    // @description Sets the RGBA values for the background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "mbgcolor", 0, t_meter, f_color_mbg);
    CLASS_ATTR_LABEL                (c, "mbgcolor", 0, "Meter Background Color");
    CLASS_ATTR_CATEGORY             (c, "mbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "mbgcolor", 0, "rgba");
    CLASS_ATTR_ORDER                (c, "mbgcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "mbgcolor", 0, "0.61 0.61 0.61 1.");
    // @description Sets the RGBA values for the filled circle background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "ledbgcolor", 0, t_meter, f_color_ledbg);
    CLASS_ATTR_LABEL                (c, "ledbgcolor", 0, "Leds Background Color");
    CLASS_ATTR_CATEGORY             (c, "ledbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "ledbgcolor", 0, "rgba");
    CLASS_ATTR_ORDER                (c, "ledbgcolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ledbgcolor", 0, "0. 0. 0. 0.05");
    // @description Sets the RGBA values for leds background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_meter, f_color_cold);
    CLASS_ATTR_CATEGORY             (c, "coldcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "coldcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
    CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
    // @description Sets the RGBA values for the cold signal color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_meter, f_color_tepid);
    CLASS_ATTR_CATEGORY             (c, "tepidcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "tepidcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
    CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the lower-middle "tepid" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_meter, f_color_warm);
    CLASS_ATTR_CATEGORY             (c, "warmcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "warmcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
    CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for upper-middle "warm" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_meter, f_color_hot);
    CLASS_ATTR_CATEGORY             (c, "hotcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "hotcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
    CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the upper "hot" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "overloadcolor", 0, t_meter, f_color_over);
    CLASS_ATTR_CATEGORY             (c, "overloadcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "overloadcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "overloadcolor", 0, "Overload Signal Color");
    CLASS_ATTR_ORDER                (c, "overloadcolor", 0, "8");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overloadcolor", 0, "1. 0. 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the "over" indicator of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_meter, f_color_energy);
    CLASS_ATTR_CATEGORY             (c, "energycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "energycolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "energycolor", 0, "Energy Vector Color");
    CLASS_ATTR_ORDER                (c, "energycolor", 0, "9");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "energycolor", 0, "0. 0. 1. 0.8");
    // @description Sets the RGBA values for the energy vector color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_meter, f_color_velocity);
    CLASS_ATTR_CATEGORY             (c, "velocitycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "velocitycolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "velocitycolor", 0, "Velocity Vector Color");
    CLASS_ATTR_ORDER                (c, "velocitycolor", 0, "9");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "velocitycolor", 0, "1. 0. 0. 0.8");
    // @description Sets the RGBA values for the velocity vector color of the <o>hoa.2d.meter~</o> object
    
    class_register(CLASS_BOX, c);
    class_alias(c, gensym("hoa.meter~"));
    meter_class = c;
}
示例#9
0
int C74_EXPORT main()
{
	t_class *c;
    
	c = class_new("hoa.2d.meter~", (method)meter_new, (method)meter_free, (short)sizeof(t_meter), 0L, A_GIMME, 0);
    class_alias(c, gensym("hoa.meter~"));
    
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	class_dspinitjbox(c);
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);
	
    hoa_initclass(c, (method)hoa_getinfos);
	class_addmethod(c, (method) meter_dsp64,		 "dsp64",		  A_CANT, 0);
	class_addmethod(c, (method) meter_assist,		 "assist",		  A_CANT, 0);
	class_addmethod(c, (method) meter_paint,		 "paint",		  A_CANT, 0);
	class_addmethod(c, (method) meter_notify,        "notify",		  A_CANT, 0);
    class_addmethod(c, (method) meter_getdrawparams, "getdrawparams", A_CANT, 0);
    
	CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 225 225");
	CLASS_ATTR_INVISIBLE            (c, "color", 0);
	
	/* APPEARANCE */
    CLASS_STICKY_CATEGORY           (c, 0, "Appearance");
	CLASS_ATTR_LONG                 (c, "drawledsbg", 0, t_meter, f_drawledsbg);
	CLASS_ATTR_ORDER                (c, "drawledsbg", 0, "1");
	CLASS_ATTR_STYLE_LABEL          (c, "drawledsbg", 0, "onoff", "Draw Leds Background");
	CLASS_ATTR_DEFAULT              (c, "drawledsbg", 0, "1");
	CLASS_ATTR_SAVE                 (c, "drawledsbg", 1);
	
	CLASS_ATTR_LONG                 (c, "drawvector", 0, t_meter, f_drawvector);
	CLASS_ATTR_ORDER                (c, "drawvector", 0, "2");
    CLASS_ATTR_LABEL                (c, "drawvector", 0, "Draw Vectors");
    CLASS_ATTR_ENUMINDEX4           (c, "drawvector", 0, "none", "energy", "velocity", "both")
	CLASS_ATTR_DEFAULT              (c, "drawvector", 0, "1");
	CLASS_ATTR_SAVE                 (c, "drawvector", 1);
    
    CLASS_ATTR_LONG                 (c, "drawmborder", 0, t_meter, f_drawmborder);
	CLASS_ATTR_ORDER                (c, "drawmborder", 0, "3");
    CLASS_ATTR_LABEL                (c, "drawmborder", 0, "Draw Meter Borders");
    CLASS_ATTR_ENUMINDEX4           (c, "drawmborder", 0, "none", "Circles", "Axes", "both")
	CLASS_ATTR_DEFAULT              (c, "drawmborder", 0, "3");
	CLASS_ATTR_SAVE                 (c, "drawmborder", 1);
	
	CLASS_ATTR_DOUBLE               (c, "metersize", 0, t_meter, f_metersize);
	CLASS_ATTR_ORDER                (c, "metersize", 0, "4");
	CLASS_ATTR_LABEL                (c, "metersize", 0, "Meter Circle Size");
	CLASS_ATTR_FILTER_CLIP          (c, "metersize", 0., 1);
	CLASS_ATTR_DEFAULT              (c, "metersize", 0, "0.8");
	CLASS_ATTR_SAVE                 (c, "metersize", 1);
    
    CLASS_ATTR_LONG                 (c, "orientation", 0, t_meter, f_direction);
	CLASS_ATTR_LABEL                (c, "orientation", 0, "Meter Fill Orientation");
    CLASS_ATTR_ORDER                (c, "orientation", 0, "5");
	CLASS_ATTR_ENUMINDEX            (c, "orientation", 0, "inside outside");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c,"orientation",0, "0");
    CLASS_STICKY_CATEGORY_CLEAR (c);
	
    CLASS_STICKY_CATEGORY           (c, 0, "Behavior");
	CLASS_ATTR_LONG                 (c, "channels", 0 , t_meter, f_number_of_channels);
    CLASS_ATTR_ACCESSORS            (c, "channels", NULL, number_of_channels_set);
	CLASS_ATTR_ORDER                (c, "channels", 0, "1");
	CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
	CLASS_ATTR_SAVE                 (c, "channels", 1);
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    
	CLASS_ATTR_DOUBLE_VARSIZE       (c, "angles", 0, t_meter,f_angles_of_channels, f_number_of_channels, MAX_SPEAKER);
	CLASS_ATTR_ACCESSORS            (c, "angles", NULL, angles_of_channels_set);
	CLASS_ATTR_ORDER                (c, "angles", 0, "2");
	CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Loudspeakers");
    CLASS_ATTR_SAVE                 (c, "angles", 1);
    
	CLASS_ATTR_DOUBLE               (c, "offset", 0, t_meter, f_offset_of_channels);
	CLASS_ATTR_ORDER                (c, "offset", 0, "3");
	CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
	CLASS_ATTR_SAVE                 (c, "offset", 1);
    
    CLASS_ATTR_LONG                 (c, "rotation", 0, t_meter, f_rotation);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
	CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
	CLASS_ATTR_ENUMINDEX            (c, "rotation", 0, "clockwise anti-clockwise");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation",0, "1");
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_meter, f_interval);
	CLASS_ATTR_ORDER                (c, "interval", 0, "5");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
	CLASS_ATTR_DEFAULT              (c, "interval", 0, "50");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
    CLASS_STICKY_CATEGORY_CLEAR     (c);
	
	CLASS_ATTR_LONG                 (c, "dbperled", 0, t_meter, f_dbperled);
    CLASS_ATTR_CATEGORY             (c, "dbperled", 0, "Value");
	CLASS_ATTR_ORDER                (c, "dbperled", 0, "4");
	CLASS_ATTR_LABEL                (c, "dbperled", 0, "DeciBels per Led");
	CLASS_ATTR_FILTER_CLIP          (c, "dbperled", 1, 12);
	CLASS_ATTR_DEFAULT              (c, "dbperled", 0, "3");
	CLASS_ATTR_SAVE                 (c, "dbperled", 1);
	
	CLASS_ATTR_LONG                 (c, "nhotleds", 0, t_meter, f_nhotleds);
    CLASS_ATTR_CATEGORY             (c, "nhotleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "nhotleds", 0, "5");
	CLASS_ATTR_LABEL                (c, "nhotleds", 0, "Number of Hot Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "nhotleds", 0, 20);
	CLASS_ATTR_DEFAULT              (c, "nhotleds", 0, "3");
	CLASS_ATTR_SAVE                 (c, "nhotleds", 1);
	
	CLASS_ATTR_LONG                 (c, "ntepidleds", 0, t_meter, f_ntepidleds);
    CLASS_ATTR_CATEGORY             (c, "ntepidleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "ntepidleds", 0, "6");
	CLASS_ATTR_LABEL                (c, "ntepidleds", 0, "Number of Tepid Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "ntepidleds", 0, 20);
	CLASS_ATTR_DEFAULT              (c, "ntepidleds", 0, "3");
	CLASS_ATTR_SAVE                 (c, "ntepidleds", 1);
	
	CLASS_ATTR_LONG                 (c, "nwarmleds", 0, t_meter, f_nwarmleds);
    CLASS_ATTR_CATEGORY             (c, "nwarmleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "nwarmleds", 0, "7");
	CLASS_ATTR_LABEL                (c, "nwarmleds", 0, "Number of Warm Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "nwarmleds", 0, 20);
	CLASS_ATTR_DEFAULT              (c, "nwarmleds", 0, "3");
	CLASS_ATTR_SAVE                 (c, "nwarmleds", 1);
	
	CLASS_ATTR_LONG                 (c, "numleds", 0, t_meter, f_numleds);
    CLASS_ATTR_CATEGORY             (c, "numleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "numleds", 0, "8");
	CLASS_ATTR_LABEL                (c, "numleds", 0, "Total Number of Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "numleds", 10, 20);
	CLASS_ATTR_DEFAULT              (c, "numleds", 0, "12");
	CLASS_ATTR_SAVE                 (c, "numleds", 1);
    
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_meter, f_color_bg);
	CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    
    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_meter, f_color_bd);
	CLASS_ATTR_CATEGORY             (c, "bdcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.7 0.7 0.7 1.");
    
	CLASS_ATTR_RGBA                 (c, "mbgcolor", 0, t_meter, f_color_mbg);
	CLASS_ATTR_LABEL                (c, "mbgcolor", 0, "Meter Background Color");
    CLASS_ATTR_CATEGORY             (c, "mbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "mbgcolor", 0, "rgba");
	CLASS_ATTR_ORDER                (c, "mbgcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "mbgcolor", 0, "0.61 0.61 0.61 1.");
	
	CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_meter, f_color_cold);
    CLASS_ATTR_CATEGORY             (c, "coldcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "coldcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
	CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_meter, f_color_tepid);
    CLASS_ATTR_CATEGORY             (c, "tepidcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "tepidcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
	CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_meter, f_color_warm);
    CLASS_ATTR_CATEGORY             (c, "warmcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "warmcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
	CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_meter, f_color_hot);
    CLASS_ATTR_CATEGORY             (c, "hotcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "hotcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
	CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "overcolor", 0, t_meter, f_color_over);
    CLASS_ATTR_CATEGORY             (c, "overcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "overcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "overcolor", 0, "Overload Signal Color");
	CLASS_ATTR_ORDER                (c, "overcolor", 0, "8");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overcolor", 0, "1. 0. 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_meter, f_color_energy);
    CLASS_ATTR_CATEGORY             (c, "energycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "energycolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "energycolor", 0, "Energy Vector Color");
	CLASS_ATTR_ORDER                (c, "energycolor", 0, "9");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "energycolor", 0, "0. 0. 1. 0.8");
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_meter, f_color_velocity);
    CLASS_ATTR_CATEGORY             (c, "velocitycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "velocitycolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "velocitycolor", 0, "Velocity Vector Color");
	CLASS_ATTR_ORDER                (c, "velocitycolor", 0, "9");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "velocitycolor", 0, "1. 0. 0. 0.8");
	
	class_register(CLASS_BOX, c);
	meter_class = c;
    
    s_velocity_layer    = gensym("velocity_layer");
	s_energy_layer		= gensym("energy_layer");
    s_leds_layer        = gensym("leds_layer");
    s_separator_layer   = gensym("separator_layer");
    s_skeleton_layer    = gensym("skeleton_layer");
	return 0;
}