Esempio n. 1
0
extern "C" int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("tap.count~",(method)count_tilde_new, (method)count_tilde_free, sizeof(t_count_tilde), (method)0L, A_GIMME, 0);

	common_symbols_init();
	
	class_addmethod(c, (method)count_tilde_reset, 	"reset", 0L);
	class_addmethod(c, (method)count_tilde_dsp64,	"dsp64", A_CANT, 0);
    class_addmethod(c, (method)count_tilde_assist, 	"assist", A_CANT, 0L); 
	class_addmethod(c, (method)stdinletinfo,		"inletinfo",	A_CANT, 0);
 
	CLASS_ATTR_LONG(c,		"high_bound",	0,	t_count_tilde, attr_high_bound);
	CLASS_ATTR_LONG(c,		"low_bound",	0,	t_count_tilde, attr_low_bound);
	
	CLASS_ATTR_LONG(c,		"active",		0,	t_count_tilde, attr_active);
	CLASS_ATTR_STYLE(c,		"active",		0,	"onoff");

	CLASS_ATTR_LONG(c,		"autoreset",	0,	t_count_tilde, attr_autoreset);
	CLASS_ATTR_STYLE(c,		"autoreset",	0,	"onoff");

	CLASS_ATTR_LONG(c,		"loop",			0,	t_count_tilde, attr_loop);
	CLASS_ATTR_STYLE(c,		"loop",			0,	"onoff");
	
	class_dspinit(c);									// Setup object's class to work with MSP
	class_register(_sym_box, c);
	count_tilde_class = c;
	return 0;
}
Esempio n. 2
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;
}
Esempio n. 3
0
extern "C" void setup_c0x2eblackboard(void)
{
    t_eclass *c;
    
    c = eclass_new("c.blackboard", (method)blackboard_new, (method)blackboard_free, (short)sizeof(t_blackboard), 0L, A_GIMME, 0);
    eclass_guiinit(c, 0);

    
    eclass_addmethod(c, (method) blackboard_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_oksize,          "oksize",           A_NULL, 0);
    
    eclass_addmethod(c, (method) blackboard_width,           "width",            A_FLOAT,0);
    eclass_addmethod(c, (method) blackboard_color,           "color",            A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_fill,            "fill",             A_FLOAT,0);
    
    eclass_addmethod(c, (method) blackboard_line,            "line",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_path,            "path",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_rect,            "rect",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_oval,            "oval",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_arc,             "arc",              A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_image,           "image",            A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_text,            "text",             A_GIMME,0);
    
    eclass_addmethod(c, (method) blackboard_clear,           "clear",            A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_reset,           "reset",            A_NULL, 0);
    
    eclass_addmethod(c, (method) blackboard_mousemove,       "mousemove",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mousedrag,       "mousedrag",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mouseup,         "mouseup",          A_NULL, 0);
    
    CLASS_ATTR_DEFAULT              (c, "size", 0, "200 200");
    CLASS_ATTR_INVISIBLE            (c, "send", 1);
    
    CLASS_ATTR_LONG                 (c, "chalkmode", 0, t_blackboard, f_pen_mode);
    CLASS_ATTR_LABEL                (c, "chalkmode", 0, "Chalk Mode");
    CLASS_ATTR_FILTER_CLIP          (c, "chalkmode", 0, 1);
    CLASS_ATTR_ORDER                (c, "chalkmode", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "chalkmode", 0, "1");
    CLASS_ATTR_SAVE                 (c, "chalkmode", 0);
    CLASS_ATTR_STYLE                (c, "chalkmode", 0, "onoff");
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_blackboard, f_color_background);
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_blackboard, f_color_border);
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    blackboard_class = c;
}
Esempio n. 4
0
extern "C" void setup_c0x2eincdec(void)
{
	t_eclass *c;

	c = eclass_new("c.incdec", (method)incdec_new, (method)incdec_free, (short)sizeof(t_incdec), 0L, A_GIMME, 0);

	eclass_init(c, 0);

	eclass_addmethod(c, (method) incdec_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) incdec_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) incdec_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) incdec_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) incdec_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) incdec_set,             "set",              A_FLOAT,0);
    eclass_addmethod(c, (method) incdec_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) incdec_output,          "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) incdec_inc,             "inc",              A_CANT, 0);
    eclass_addmethod(c, (method) incdec_dec,             "dec",              A_CANT, 0);
    eclass_addmethod(c, (method) incdec_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) incdec_mouseup,         "mouseup",          A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
    CLASS_ATTR_INVISIBLE            (c, "send", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "13 20");

    CLASS_ATTR_FLOAT                (c, "step", 0, t_incdec, f_increment);
	CLASS_ATTR_LABEL                (c, "step", 0, "Step increment");
    CLASS_ATTR_FILTER_MIN           (c, "step", 0.);
	CLASS_ATTR_ORDER                (c, "step", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "step", 0, "1.");
    CLASS_ATTR_STYLE                (c, "step", 0, "number");
    CLASS_ATTR_STEP                 (c, "step", 0.1);
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_incdec, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_incdec, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "arcolor", 0, t_incdec, f_color_arrow);
	CLASS_ATTR_LABEL                (c, "arcolor", 0, "Arrow Color");
	CLASS_ATTR_ORDER                (c, "arcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "arcolor", 0, "0. 0. 0. 1.");
    CLASS_ATTR_STYLE                (c, "arcolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cicm_post();
	incdec_class = c;
}
Esempio n. 5
0
extern "C" void setup_c0x2escope_tilde(void)
{
    t_eclass *c;

    c = eclass_new("c.scope~", (method)scope_new, (method)scope_free, (short)sizeof(t_scope), 0L, A_GIMME, 0);

    eclass_guiinit(c, 0);
    eclass_dspinit(c);
    eclass_addmethod(c, (method) scope_dsp,             "dsp",              A_NULL, 0);
    eclass_addmethod(c, (method) scope_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) scope_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) scope_oksize,          "oksize",           A_NULL, 0);

    CLASS_ATTR_INVISIBLE            (c, "send", 1);
    CLASS_ATTR_DEFAULT              (c, "size", 0, "125 100");

    CLASS_ATTR_LONG                 (c, "bufdis", 0, t_scope, f_display_size);
    CLASS_ATTR_ORDER                (c, "bufdis", 0, "1");
    CLASS_ATTR_LABEL                (c, "bufdis", 0, "Display Buffer Size");
    CLASS_ATTR_FILTER_CLIP          (c, "bufdis", 2, 8092);
    CLASS_ATTR_DEFAULT              (c, "bufdis", 0, "256");
    CLASS_ATTR_SAVE                 (c, "bufdis", 1);
    CLASS_ATTR_STYLE                (c, "bufdis", 0, "number");

    CLASS_ATTR_LONG                 (c, "bufsig", 0, t_scope, f_signal_size);
    CLASS_ATTR_ORDER                (c, "bufsig", 0, "2");
    CLASS_ATTR_LABEL                (c, "bufsig", 0, "Signal Buffer Size");
    CLASS_ATTR_FILTER_CLIP          (c, "bufsig", 2, 8092);
    CLASS_ATTR_DEFAULT              (c, "bufsig", 0, "256");
    CLASS_ATTR_SAVE                 (c, "bufsig", 1);
    CLASS_ATTR_STYLE                (c, "bufsig", 0, "number");

    CLASS_ATTR_FLOAT_ARRAY          (c, "range", 0, t_scope, f_range, 2);
    CLASS_ATTR_ORDER                (c, "range", 0, "2");
    CLASS_ATTR_LABEL                (c, "range", 0, "Range");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "range", 0, "-1 1");

    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_scope, f_color_background);
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");

    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_scope, f_color_border);
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");

    CLASS_ATTR_RGBA                 (c, "sicolor", 0, t_scope, f_color_signal);
    CLASS_ATTR_LABEL                (c, "sicolor", 0, "Signal Color");
    CLASS_ATTR_ORDER                (c, "sicolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "sicolor", 0, "0. 0.6 0. 0.8");
    CLASS_ATTR_STYLE                (c, "sicolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cscope_class = c;
}
Esempio n. 6
0
extern "C" void setup_c0x2enumber_tilde(void)
{
	t_eclass *c;

	c = eclass_new("c.number~", (method)number_tilde_new, (method)number_tilde_free, (short)sizeof(t_number_tilde), 0L, A_GIMME, 0);

	eclass_dspinit(c);
	eclass_init(c, 0);
    cream_initclass(c);

	eclass_addmethod(c, (method) number_tilde_dsp,             "dsp",              A_NULL, 0);
	eclass_addmethod(c, (method) number_tilde_assist,          "assist",           A_NULL, 0);
	eclass_addmethod(c, (method) number_tilde_paint,           "paint",            A_NULL, 0);
	eclass_addmethod(c, (method) number_tilde_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) number_tilde_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) number_tilde_oksize,          "oksize",           A_NULL, 0);
    eclass_addmethod(c, (method) number_tilde_output,          "bang",             A_NULL, 0);

	CLASS_ATTR_DEFAULT			(c, "size", 0, "53 13");

    CLASS_ATTR_LONG                 (c, "interval", 0, t_number_tilde, f_interval);
	CLASS_ATTR_ORDER                (c, "interval", 0, "2");
	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_ATTR_STYLE                (c, "interval", 0, "number");
    
    CLASS_ATTR_LONG                 (c, "decimal", 0, t_number_tilde, f_ndecimal);
	CLASS_ATTR_ORDER                (c, "decimal", 0, "3");
	CLASS_ATTR_LABEL                (c, "decimal", 0, "Number of decimal");
    CLASS_ATTR_DEFAULT              (c, "decimal", 0, "6");
	CLASS_ATTR_FILTER_MIN           (c, "decimal", 0);
    CLASS_ATTR_FILTER_MAX           (c, "decimal", 6);
	CLASS_ATTR_SAVE                 (c, "decimal", 1);
    CLASS_ATTR_STYLE                (c, "decimal", 0, "number");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_number_tilde, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_number_tilde, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "textcolor", 0, t_number_tilde, f_color_text);
	CLASS_ATTR_LABEL                (c, "textcolor", 0, "Text Color");
	CLASS_ATTR_ORDER                (c, "textcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "textcolor", 0, "0. 0. 0. 1.");
    CLASS_ATTR_STYLE                (c, "textcolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
	number_tilde_class = c;
}
Esempio n. 7
0
extern "C" void setup_c0x2ematrix(void)
{
	t_eclass *c;

	c = eclass_new("c.matrix", (method)matrixctrl_new, (method)matrixctrl_free, (short)sizeof(t_matrixctrl), 0L, A_GIMME, 0);
	eclass_guiinit(c, 0);
    eclass_addmethod(c, (method) matrixctrl_assist,          "assist",           A_NULL, 0);
	eclass_addmethod(c, (method) matrixctrl_paint,           "paint",            A_NULL, 0);
	eclass_addmethod(c, (method) matrixctrl_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_oksize,          "oksize",           A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_set,             "set",              A_GIMME,0);
    eclass_addmethod(c, (method) matrixctrl_list,            "list",             A_GIMME,0);
    eclass_addmethod(c, (method) matrixctrl_bang,            "bang",             A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_clear,           "clear",            A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_getrow,          "getrow",           A_FLOAT,0);
    eclass_addmethod(c, (method) matrixctrl_getcolumn,       "getcolumn",        A_FLOAT,0);

    eclass_addmethod(c, (method) matrixctrl_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_mousedrag,       "mousedrag",        A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_mouseleave,      "mouseleave",       A_NULL, 0);

    eclass_addmethod(c, (method) matrixctrl_preset,          "preset",           A_NULL, 0);

    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "105 53");

    CLASS_ATTR_FLOAT_ARRAY          (c, "matrix", 0, t_matrixctrl, f_size, 2);
	CLASS_ATTR_LABEL                (c, "matrix", 0, "Matrix Size");
    CLASS_ATTR_ACCESSORS			(c, "matrix", NULL, matrixctrl_matrix_set);
	CLASS_ATTR_ORDER                (c, "matrix", 0, "1");
	CLASS_ATTR_DEFAULT              (c, "matrix", 0, "8 4");
    CLASS_ATTR_SAVE                 (c, "matrix", 0);

    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_matrixctrl, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");

	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_matrixctrl, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");

    CLASS_ATTR_RGBA                 (c, "accolor", 0, t_matrixctrl, f_color_on);
	CLASS_ATTR_LABEL                (c, "accolor", 0, "Active Cell Color");
	CLASS_ATTR_ORDER                (c, "accolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "accolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "accolor", 0, "color");

    eclass_register(CLASS_BOX, c);
	matrixctrl_class = c;
}
Esempio n. 8
0
extern "C" void setup_c0x2ebang(void)
{
	t_eclass *c;
    
	c = eclass_new("c.bang", (method)bang_new, (method)bang_free, (short)sizeof(t_bang), 0L, A_GIMME, 0);
    
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) bang_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) bang_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) bang_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) bang_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) bang_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) bang_output,          "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) bang_output,          "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) bang_output,          "list",             A_GIMME,0);
    eclass_addmethod(c, (method) bang_output,          "anything",         A_GIMME,0);
    
    eclass_addmethod(c, (method) bang_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) bang_mouseup,         "mouseup",          A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "16. 16.");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_bang, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_bang, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bacolor", 0, t_bang, f_color_bang);
	CLASS_ATTR_LABEL                (c, "bacolor", 0, "Bang Color");
	CLASS_ATTR_ORDER                (c, "bacolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bacolor", 0, "0. 0. 0. 1.");
	CLASS_ATTR_STYLE                (c, "bacolor", 0, "color");
	
    eclass_register(CLASS_BOX, c);
    cicm_post();
	bang_class = c;
}
Esempio n. 9
0
extern "C" void setup_c0x2earray(void)
{
	t_eclass *c;
    
	c = eclass_new("c.array", (method)carray_new, (method)carray_free, (short)sizeof(t_carray), 0L, A_GIMME, 0);
    
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) carray_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) carray_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) carray_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) carray_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) carray_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) carray_output,          "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) carray_output,          "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) carray_output,          "list",             A_GIMME,0);
    eclass_addmethod(c, (method) carray_output,          "anything",         A_GIMME,0);
    
    eclass_addmethod(c, (method) carray_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) carray_mouseup,         "mouseup",          A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "16. 16.");
    
    CLASS_ATTR_SYMBOL               (c, "array", 0, t_carray, f_name);
    CLASS_ATTR_ACCESSORS            (c, "array", NULL, carray_buffer_set);
	CLASS_ATTR_LABEL                (c, "array", 0, "Array Name");
	CLASS_ATTR_ORDER                (c, "array", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "array", 0, "(null)");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_carray, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_carray, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
	
    eclass_register(CLASS_BOX, c);
    cicm_post();
	carray_class = c;
}
Esempio n. 10
0
int C74_EXPORT main(void)
{
	t_class* c;

	TTAudioGraphInit();
	common_symbols_init();

	c = class_new("j.dcblock=", (method)DCBlockNew, (method)DCBlockFree, sizeof(DCBlock), (method)0L, A_GIMME, 0);

	class_addmethod(c, (method)DCBlockClear,		"clear",				0);
	class_addmethod(c, (method)DCBlockReset,		"audio.reset",		A_CANT, 0);
	class_addmethod(c, (method)DCBlockSetup,		"audio.setup",		A_CANT, 0);
	class_addmethod(c, (method)DCBlockConnect,	"audio.connect",	A_OBJ, A_LONG, 0);
 	class_addmethod(c, (method)MaxAudioGraphDrop,	"audio.drop",		A_CANT, 0);
	class_addmethod(c, (method)MaxAudioGraphObject,	"audio.object",		A_CANT, 0);
	class_addmethod(c, (method)DCBlockAssist,		"assist",				A_CANT, 0);
    class_addmethod(c, (method)object_obex_dumpout,	"dumpout",				A_CANT, 0);
	class_addmethod(c, (method)jamoma_fileusage, "fileusage", A_CANT, 0);

	CLASS_ATTR_LONG(c,		"bypass",	0,		DCBlock,	attrBypass);
	CLASS_ATTR_STYLE(c,		"bypass",	0,		"onoff");
	CLASS_ATTR_ACCESSORS(c,	"bypass",	NULL,	DCBlockSetBypass);

	class_register(_sym_box, c);
	sDCBlockClass = c;
	return 0;
}
Esempio n. 11
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;
}
Esempio n. 12
0
void C74_EXPORT ext_main(void *r)
{
  t_class *c;
  
  c = class_new("dict.recurse", (method)dict_recurse_new, (method)dict_recurse_free, 
      (long)sizeof(t_dict_recurse), (method)NULL, A_GIMME, 0);
  
  // Methods
  class_addmethod(c, (method)dict_recurse_assist, "assist", A_CANT, 0);  

  class_addmethod(c, (method)dict_recurse_all, "all", A_SYM, 0);
  class_addmethod(c, (method)dict_recurse_find, "find", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_replace, "replace", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_append, "append", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_delete, "delete", A_GIMME, 0);

  class_addmethod(c, (method)dict_recurse_bang, "bang", 0);
  class_addmethod(c, (method)dict_recurse_set, "set", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_get, "get", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_anything, "anything", A_GIMME, 0);  

  class_addmethod(c, (method)dict_re_compile, "compile", A_GIMME, 0);
  class_addmethod(c, (method)dict_re_simulate, "simulate", A_GIMME, 0);
  class_addmethod(c, (method)dict_re_states, "states", 0);

  // Attributes
  CLASS_ATTR_CHAR(c, "verbose", 0, t_dict_recurse, a_verbose);
  CLASS_ATTR_STYLE(c, "verbose", 0, "onoff");
  CLASS_ATTR_SAVE(c, "verbose", 0);

  class_register(CLASS_BOX, c);
  dict_recurse_class = c;
}
Esempio n. 13
0
extern "C" int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	t_class *c;

	c = class_new("tap.colorspace",(method)cs_new, (method)cs_free, sizeof(t_cs), (method)0L, A_GIMME, 0);

	common_symbols_init();
	class_addmethod(c, (method)cs_bang,					"bang", 0L);	
    class_addmethod(c, (method)cs_int, 					"int", A_LONG, 0L);		// Input as int
    class_addmethod(c, (method)cs_float, 				"float", A_FLOAT, 0L);	// Input as float
    class_addmethod(c, (method)cs_list,					"list", A_GIMME, 0L);
    class_addmethod(c, (method)cs_assist, 				"assist", A_CANT, 0L); 
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout", A_CANT,0);      
	class_addmethod(c, (method)cs_inletinfo,			"inletinfo",	A_CANT, 0);


	CLASS_ATTR_SYM(c,		"mode",			0,	t_cs, attr_mode);
	CLASS_ATTR_ENUM(c,		"mode",			0,	
"no_transform rgb2cmy cmy2rgb rgb2hsv hsv2rgb rgb2xyz xyz2rgb rgb2uvw uvw2rgb rgb2retinalcone retinalcone2rgb rgb2lab lab2rgb rgb2yiq yiq2rgb rgb2hls hls2rgb rgb2rgbcie rgbcie2rgb rgb2rgbsmpte rgbsmpte2rgb rgb2hsl hsl2rgb");
	
	CLASS_ATTR_SYM(c,		"outputtype",	0,	t_cs, attr_outputtype);
	CLASS_ATTR_ENUM(c,		"outputtype",	0,	"split packed");
	
	CLASS_ATTR_LONG(c,		"autopack",		0,	t_cs, attr_autopack);
	CLASS_ATTR_STYLE(c,		"autopack",		0,	"onoff");

	this_class = c; class_register(_sym_box, c);

	// initialize class globals
	ps_no_transform		= gensym("no_transform");
	ps_rgb2cmy			= gensym("rgb2cmy");
	ps_cmy2rgb			= gensym("cmy2rgb");
	ps_rgb2hsv			= gensym("rgb2hsv");
	ps_hsv2rgb			= gensym("hsv2rgb");
	ps_rgb2xyz			= gensym("rgb2xyz");
	ps_xyz2rgb			= gensym("xyz2rgb");
	ps_rgb2uvw			= gensym("rgb2uvw");
	ps_uvw2rgb			= gensym("uvw2rgb");
	ps_rgb2retinalcone	= gensym("rgb2retinalcone");
	ps_retinalcone2rgb	= gensym("retinalcone2rgb");
	ps_rgb2lab			= gensym("rgb2lab");
	ps_lab2rgb			= gensym("lab2rgb");
	ps_rgb2yiq			= gensym("rgb2yiq");
	ps_yiq2rgb			= gensym("yiq2rgb");
	ps_rgb2hls			= gensym("rgb2hls");
	ps_hls2rgb			= gensym("hls2rgb");
	ps_rgb2rgbcie		= gensym("rgb2rgbcie");
	ps_rgbcie2rgb		= gensym("rgbcie2rgb");
	ps_rgb2rgbsmpte		= gensym("rgb2rgbsmpte");
	ps_rgbsmpte2rgb		= gensym("rgbsmpte2rgb");
	ps_rgb2hsl			= gensym("rgb2hsl");
	ps_hsl2rgb			= gensym("hsl2rgb");
	
	ps_split			= gensym("split");
	ps_packed			= gensym("packed");
	
	// Finalize our class
	class_register(CLASS_BOX, c);
	this_class = c;
}
Esempio n. 14
0
extern "C" void setup_c0x2etoggle(void)
{
	t_eclass *c;

	c = eclass_new("c.toggle", (method)toggle_new, (method)toggle_free, (short)sizeof(t_toggle), 0L, A_GIMME, 0);

	eclass_init(c, 0);

	eclass_addmethod(c, (method) toggle_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) toggle_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) toggle_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) toggle_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) toggle_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) toggle_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) toggle_set,             "set",              A_FLOAT,0);
    eclass_addmethod(c, (method) toggle_bang,            "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) toggle_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) toggle_preset,          "preset",           A_CANT, 0);

    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "15. 15.");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_toggle, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_toggle, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "crcolor", 0, t_toggle, f_color_cross);
	CLASS_ATTR_LABEL                (c, "crcolor", 0, "Cross Color");
	CLASS_ATTR_ORDER                (c, "crcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "crcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "crcolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cicm_post();
	toggle_class = c;
}
Esempio n. 15
0
extern "C" void setup_c0x2edsp_tilde(void)
{
    t_eclass *c;
    
    c = eclass_new("c.dsp~", (method)dsp_tilde_new, (method)dsp_tilde_free, (short)sizeof(t_dsp_tilde), CLASS_NOINLET, A_GIMME, 0);
    
    eclass_init(c, 0);
    cream_initclass(c);
    
    eclass_addmethod(c, (method) dsp_tilde_assist,          "assist",           A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_oksize,          "oksize",           A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_anything,        "anything",         A_GIMME, 0);
    eclass_addmethod(c, (method) dsp_tilde_open,            "settings",         A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_start,           "start",            A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_stop,            "stop",             A_NULL, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
    CLASS_ATTR_DEFAULT              (c, "size", 0, "30 30");
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_dsp_tilde, f_color_background);
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_dsp_tilde, f_color_border);
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
    CLASS_ATTR_RGBA                 (c, "logocolor", 0, t_dsp_tilde, f_color_logo);
    CLASS_ATTR_LABEL                (c, "logocolor", 0, "Logo Color");
    CLASS_ATTR_ORDER                (c, "logocolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "logocolor", 0, "0. 0.6 0. 0.8");
    CLASS_ATTR_STYLE                (c, "logocolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    dsp_tildeclass = c;
}
Esempio n. 16
0
int JAMOMA_EXPORT_MAXOBJ main(void)
{
	t_class 	*c;
	t_object 	*attr = NULL;
	long		numDataspaces = 0;
	SymbolPtr*	dataspaceNames = NULL;
	char		dataspaces[2048];
	short		i;

	jamoma_init();
	common_symbols_init();
	
	jamoma_getDataspaceList(&numDataspaces, &dataspaceNames);
	dataspaces[0] = 0;
	for (i=0; i<numDataspaces; i++)
	{
		strcat(dataspaces, dataspaceNames[i]->s_name);
		strcat(dataspaces, " ");
	}

	// Define our class
	c = class_new("jcom.return",(method)return_new, (method)return_free, sizeof(t_return), (method)0L, A_GIMME, 0);
	
	// Make methods accessible for our class:
	class_addmethod(c, (method)return_bang,					"bang",			A_CANT, 0L);
	class_addmethod(c, (method)return_int,					"int",			A_DEFLONG,	0L);
	class_addmethod(c, (method)return_float,				"float",		A_DEFFLOAT,	0L);
 	class_addmethod(c, (method)return_list,					"list",			A_GIMME, 0L);
 	class_addmethod(c, (method)return_symbol,				"anything",		A_GIMME, 0L);
	class_addmethod(c, (method)return_dump,					"dump",			0L);
	class_addmethod(c, (method)return_updatename,			"update_name",	A_CANT, 0L);
	class_addmethod(c, (method)return_assist,				"assist",		A_CANT, 0L); 

	jcom_core_subscriber_classinit_extended(c, attr);
	
	// ATTRIBUTE: type - options are generic, integer, decimal, string, boolean
	jamoma_class_attr_new(c, "type", _sym_symbol, (method)return_attr_settype, (method)return_attr_gettype);
	
	// ATTRIBUTES: dataspace stuff
	
	CLASS_ATTR_SYM(c,						"dataspace",					0,	t_return, attrDataspace);
	CLASS_ATTR_LABEL(c,						"dataspace",					0,	"dataspace");
	CLASS_ATTR_ENUM(c,						"dataspace",					0, dataspaces);

	CLASS_ATTR_SYM(c,						"dataspace/unit/native",		0,	t_return, attrUnitNative);
	CLASS_ATTR_LABEL(c,						"dataspace/unit/native",		0,	"dataspace/unit/native");
		
	CLASS_ATTR_CHAR(c,						"enable",						0,	t_return,	attrEnable);
	CLASS_ATTR_STYLE(c,						"enable",						0,	"onoff");
	
	// Finalize our class
	class_register(CLASS_BOX, c);
	return_class = c;
	
	return 0;
}
Esempio n. 17
0
int C74_EXPORT main(void)
{
	MaxAudioGraphWrappedClassOptionsPtr	options = new MaxAudioGraphWrappedClassOptions;
	TTValue								value(0);
	MaxAudioGraphWrappedClassPtr			c = NULL;

	TTAudioGraphInit();
    
	options->append(TT("generator"), value);
	value = 2;
	options->append(TT("wrapperDefinesNumOutlets"), value);
	
	wrapAsMaxAudioGraph(TT("soundfile.player"), "j.soundfile.player=", &c, options);
	CLASS_ATTR_STYLE(c->maxClass,		"filePath", 0,	"file");
	
	wrapAsMaxAudioGraph(TT("soundfile.player"), "soundfile.player=", &c, options);
	CLASS_ATTR_STYLE(c->maxClass,		"filePath", 0,	"file");
	
	return 0;
}
Esempio n. 18
0
extern "C" int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("tap.fft.binmodulator~",(method)binmod_new, (method)binmod_free, sizeof(t_binmod), 
		(method)0L, A_GIMME, 0);

		common_symbols_init();												// Initialize TapTools
	class_addmethod(c, (method)binmod_dsp, 				"dsp", A_CANT, 0L);		
    class_addmethod(c, (method)binmod_assist, 			"assist", A_CANT, 0L); 
    
    class_addmethod(c, (method)binmod_resync,			"phase_resync", 0L);
    class_addmethod(c, (method)binmod_zero_frequency,	"zero_frequency", 0L);
    class_addmethod(c, (method)binmod_zero_phase,		"zero_phase", 0L);
    class_addmethod(c, (method)binmod_zero_depth,		"zero_depth", 0L);
    class_addmethod(c, (method)binmod_zero_shape,		"zero_shape", 0L);
    class_addmethod(c, (method)binmod_get_frequency_n,	"getfrequencyn", A_LONG, 0L);
    class_addmethod(c, (method)binmod_get_phase_n,		"getphasen", A_LONG, 0L);
    class_addmethod(c, (method)binmod_get_depth_n,		"getdepthn", A_LONG, 0L);
    class_addmethod(c, (method)binmod_get_shape_n,		"getshapen", A_LONG, 0L);
	class_addmethod(c, (method)stdinletinfo,			"inletinfo",	A_CANT, 0);

	CLASS_ATTR_FLOAT(c,			"bypass",		0,	t_binmod, attr_bypass);
	CLASS_ATTR_STYLE(c,			"bypass",		0,	"onoff");

	CLASS_ATTR_FLOAT_VARSIZE(c,	"frequency",	0,	t_binmod, attr_freq, attr_freq_len, MAX_NUM_LFOS);
	CLASS_ATTR_ACCESSORS(c,		"frequency",	NULL, binmod_freq_set);

	CLASS_ATTR_FLOAT_VARSIZE(c,	"depth",		0,	t_binmod, attr_depth, attr_depth_len, MAX_NUM_LFOS);
	CLASS_ATTR_ACCESSORS(c,		"depth",		NULL, binmod_depth_set);

	CLASS_ATTR_FLOAT_VARSIZE(c,	"phase",		0,	t_binmod, attr_phase, attr_phase_len, MAX_NUM_LFOS);
	CLASS_ATTR_ACCESSORS(c,		"phase",		NULL, binmod_phase_set);

	CLASS_ATTR_SYM_VARSIZE(c,	"shape",		0,	t_binmod, attr_shape, attr_shape_len, MAX_NUM_LFOS);
	CLASS_ATTR_ACCESSORS(c,		"shape",		NULL, binmod_shape_set);

	class_dspinit(c);									// Setup object's class to work with MSP
class_register(_sym_box, c); 	binmod_class = c;

	// init globals
	ps_sine = gensym("sine");
	ps_ramp = gensym("ramp");
	ps_sawtooth = gensym("sawtooth");
	ps_square = gensym("square");
	ps_triangle = gensym("triangle");
}
Esempio n. 19
0
extern "C" int C74_EXPORT main(void)
{
	t_class* c = class_new("tap.comb~", (method)comb_new, (method)comb_free, sizeof(t_comb), (method)0L, A_GIMME, 0);

	common_symbols_init();

	class_addmethod(c, (method)comb_dsp64, "dsp64", A_CANT, 0);

    class_addmethod(c, (method)comb_int, 				"int", A_LONG, 0L);		// Input as int
    class_addmethod(c, (method)comb_float, 				"float", A_FLOAT, 0L);	// Input as double
    class_addmethod(c, (method)comb_lp_cf,				"lpass", A_FLOAT, 0L);	// for backwards compatibility
    class_addmethod(c, (method)comb_clear,				"clear", 0L);
    class_addmethod(c, (method)comb_assist, 			"assist", A_CANT, 0L); 
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout", A_CANT,0);      
	class_addmethod(c, (method)stdinletinfo,			"inletinfo",	A_CANT, 0);
	
	CLASS_ATTR_DOUBLE(c,		"feedback",			0,	t_comb, attr_feedback);
	CLASS_ATTR_ACCESSORS(c,		"feedback",			NULL, attr_set_feedback);

	CLASS_ATTR_LONG(c,			"autoclip",			0,	t_comb, attr_autoclip);
	CLASS_ATTR_ACCESSORS(c,		"autoclip",			NULL, attr_set_autoclip);
	CLASS_ATTR_STYLE(c,			"autoclip",			0, "onoff");

	CLASS_ATTR_DOUBLE(c,		"delay",			0,	t_comb, attr_delay);
	CLASS_ATTR_ACCESSORS(c,		"delay",			NULL, attr_set_delay);

	CLASS_ATTR_DOUBLE(c,		"decay",			0,	t_comb, attr_decay);
	CLASS_ATTR_ACCESSORS(c,		"decay",			NULL, attr_set_decay);

	CLASS_ATTR_DOUBLE(c,		"buffersize",		0,	t_comb, attr_buffersize);
	CLASS_ATTR_ACCESSORS(c,		"buffersize",		NULL, attr_set_buffersize);

	CLASS_ATTR_DOUBLE(c,		"lowpass",			0,	t_comb, attr_lowpass);
	CLASS_ATTR_ACCESSORS(c,		"lowpass",			NULL, attr_set_lowpass);
		
	class_dspinit(c);									// Setup object's class to work with MSP
	class_register(_sym_box, c);
	s_comb_class = c; 
}
Esempio n. 20
0
void jcom_core_subscriber_classinit_extended(t_class *c, t_object *attr, bool define_name)
{
	jcom_core_subscriber_classinit_common(c, attr, define_name);

	// TODO: The name of the attributes should be substituted for their jps_* symbol pointers.
	
	// ATTRIBUTE: range <low, high>
	jamoma_class_attr_array_new(c, 	"range/bounds", 		_sym_float32, 2, (method)jcom_core_attr_setrange, (method)jcom_core_attr_getrange);
		
	// ATTRIBUTE: clipmode - options are none, low, high, both, wrap, fold
	jamoma_class_attr_new(c, 		"range/clipmode",	 	_sym_symbol, (method)jcom_core_attr_setclipmode, (method)jcom_core_attr_getclipmode);
	CLASS_ATTR_ENUM(c,				"range/clipmode",		0,	(char*)"none low high both wrap fold");	

	// ATTRIBUTE: repetitions - 0 means repetitive values are not allowed, 1 means they are
	jamoma_class_attr_new(c, 		"repetitions/allow", 	_sym_long, (method)jcom_core_attr_setrepetitions, (method)jcom_core_attr_getrepetitions);

	// ATTRIBUTE: type 
	// this is not defined here because some objects (i.e jcom.parameter) need to treat this in different ways

	// ATTRIBUTE: description - does nothing, but is accessed by jcom.dispatcher for /autodoc generation
	jamoma_class_attr_new(c,		"description", 			_sym_symbol, (method)jcom_core_attr_setdescription, (method)jcom_core_attr_getdescription);
	CLASS_ATTR_STYLE(c,				"description",			0, "text_onesymbol");
}
Esempio n. 21
0
extern "C" void setup_hoa0x2escope_tilde(void)
{
	t_eclass *c;

	c = class_new("hoa.scope~", (method)scope_new, (method)scope_free, (short)sizeof(t_scope), 0L, A_GIMME, 0);

	class_dspinitjbox(c);
    
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);

	class_addmethod(c, (method)scope_dsp,			"dsp",          A_CANT, 0);
	class_addmethod(c, (method)scope_assist,		"assist",		A_CANT,	0);
	class_addmethod(c, (method)scope_paint,			"paint",		A_CANT,	0);
	class_addmethod(c, (method)scope_notify,		"notify",		A_CANT, 0);
	class_addmethod(c, (method)scope_getdrawparams, "getdrawparams", A_CANT, 0);
	class_addmethod(c, (method)scope_oksize,		"oksize",		A_CANT, 0);

	CLASS_ATTR_DEFAULT			(c, "size", 0, "225 225");

    CLASS_ATTR_LONG             (c, "order", 0, t_scope, f_order);
    CLASS_ATTR_ACCESSORS        (c, "order", (method)NULL,(method)scope_setattr_order);
	CLASS_ATTR_CATEGORY			(c, "order", 0, "Behavior");
	CLASS_ATTR_ORDER			(c, "order", 0, "1");
	CLASS_ATTR_LABEL			(c, "order", 0, "Ambisonic Order");
	CLASS_ATTR_FILTER_MIN		(c, "order", 1);
	CLASS_ATTR_DEFAULT			(c, "order", 0, "3");
	CLASS_ATTR_SAVE				(c, "order", 1);
    
    CLASS_ATTR_FLOAT            (c, "gain", 0, t_scope, f_normalize);
	CLASS_ATTR_CATEGORY			(c, "gain", 0, "Behavior");
	CLASS_ATTR_ORDER			(c, "gain", 0, "2");
	CLASS_ATTR_LABEL			(c, "gain", 0, "Gain factor");
	CLASS_ATTR_FILTER_MIN		(c, "gain", 1.);
	CLASS_ATTR_DEFAULT			(c, "gain", 0, "1.");
	CLASS_ATTR_SAVE				(c, "gain", 1);

	CLASS_ATTR_LONG             (c, "interval", 0, t_scope, f_interval);
	CLASS_ATTR_CATEGORY			(c, "interval", 0, "Behavior");
	CLASS_ATTR_ORDER			(c, "interval", 0, "3");
	CLASS_ATTR_LABEL			(c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN		(c, "interval", 20);
	CLASS_ATTR_DEFAULT			(c, "interval", 0, "100");
	CLASS_ATTR_SAVE				(c, "interval", 1);
    
    CLASS_ATTR_LONG             (c, "drawcircle", 0, t_scope, f_drawCircle);
	CLASS_ATTR_CATEGORY			(c, "drawcircle", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcircle", 0, "1");
	CLASS_ATTR_STYLE            (c, "drawcircle", 0, "onoff");
    CLASS_ATTR_LABEL			(c, "drawcircle", 0, "Draw Circle");
	CLASS_ATTR_DEFAULT			(c, "drawcircle", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcircle", 1);
    
    CLASS_ATTR_LONG             (c, "drawangles", 0, t_scope, f_drawAngles);
	CLASS_ATTR_CATEGORY			(c, "drawangles", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawangles", 0, "2");
    CLASS_ATTR_STYLE            (c, "drawangles", 0, "onoff");
    CLASS_ATTR_LABEL			(c, "drawangles", 0, "Draw Angles");
	CLASS_ATTR_DEFAULT			(c, "drawangles", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawangles", 1);
    
    CLASS_ATTR_LONG             (c, "drawcontrib", 0, t_scope, f_drawContributions);
	CLASS_ATTR_CATEGORY			(c, "drawcontrib", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcontrib", 0, "3");
    CLASS_ATTR_STYLE            (c, "drawcontrib", 0, "onoff");
    CLASS_ATTR_LABEL			(c, "drawcontrib", 0, "Draw Contributions");
	CLASS_ATTR_DEFAULT			(c, "drawcontrib", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcontrib", 1);
	
	CLASS_ATTR_INVISIBLE		(c, "color", 0);
	CLASS_ATTR_INVISIBLE		(c, "textcolor", 0);
	
	CLASS_ATTR_RGBA				(c, "bgcolor", 0, t_scope, f_colorBackground);
	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_scope, f_bordercolor);
	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, "txcolor", 0, t_scope, f_colorText);
	CLASS_ATTR_CATEGORY			(c, "txcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "txcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "txcolor", 0, "Text Color");
	CLASS_ATTR_ORDER			(c, "txcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "txcolor", 0, "0. 0. 0. 7.");
	
	CLASS_ATTR_RGBA				(c, "phcolor", 0, t_scope, f_colorPositif);
	CLASS_ATTR_CATEGORY			(c, "phcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "phcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "phcolor", 0, "Positifs Harmonics");
	CLASS_ATTR_ORDER			(c, "phcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "phcolor", 0, "1. 0. 0. 1.");
	
	CLASS_ATTR_RGBA				(c, "nhcolor", 0, t_scope, f_colorNegatif);
	CLASS_ATTR_CATEGORY			(c, "nhcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "nhcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "nhcolor", 0, "Negatifs Harmonics");
	CLASS_ATTR_ORDER			(c, "nhcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "nhcolor", 0, "0. 0. 1. 1.");
	
    class_register(CLASS_NOBOX, c);
	scope_class = c;
	
}
extern "C" void setup_hoa0x2e2d0x2emeter_tilde(void)
{
	t_eclass *c;
    
	c = eclass_new("hoa.2d.meter~", (method)hoa_meter_new, (method)hoa_meter_free, (short)sizeof(t_hoa_meter), 0L, A_GIMME, 0);
    class_addcreator((t_newmethod)hoa_meter_new, gensym("hoa.meter~"), A_GIMME, 0);
    
	eclass_dspinit(c);
	eclass_init(c, 0);
	hoa_initclass(c, (method)hoa_getinfos);
	eclass_addmethod(c, (method) hoa_meter_dsp,             "dsp",           A_CANT, 0);
	eclass_addmethod(c, (method) hoa_meter_assist,          "assist",		 A_CANT, 0);
	eclass_addmethod(c, (method) hoa_meter_paint,           "paint",		 A_CANT, 0);
	eclass_addmethod(c, (method) hoa_meter_notify,          "notify",        A_CANT, 0);
    eclass_addmethod(c, (method) hoa_meter_getdrawparams,   "getdrawparams", A_CANT, 0);
    eclass_addmethod(c, (method) hoa_meter_oksize,          "oksize",        A_CANT, 0);
    
    eclass_addmethod(c, (method)hoa_meter_deprecated,   "loudspeakers",	A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_meter_deprecated,   "bordercolor",	A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_meter_deprecated,   "mbgcolor",     A_GIMME, 0);
    
	CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
    CLASS_ATTR_INVISIBLE            (c, "send", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "225. 225.");
	
    CLASS_ATTR_LONG                 (c, "channels", 0 , t_hoa_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, "8");
    CLASS_ATTR_STYLE                (c, "channels", 1, "number");
    
    CLASS_ATTR_FLOAT_VARSIZE        (c, "angles", 0, t_hoa_meter, f_attrs, f_attrs, MAX_SPEAKER);
	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);
    CLASS_ATTR_DEFAULT              (c, "angles", 0, "0 45 90 135 180 225 270 315");
    
    CLASS_ATTR_FLOAT                (c, "offset", 0, t_hoa_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);
    CLASS_ATTR_STYLE                (c, "offset", 1, "number");
    
    CLASS_ATTR_SYMBOL               (c, "rotation", 0, t_hoa_meter, f_clockwise);
    CLASS_ATTR_ACCESSORS            (c, "rotation", NULL, rotation_set);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
	CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation", 0, "0");
    CLASS_ATTR_STYLE                (c, "rotation", 1, "menu");
    CLASS_ATTR_ITEMS                (c, "rotation", 1, "anti-clockwise clockwise");
    
	CLASS_ATTR_SYMBOL               (c, "vectors", 0, t_hoa_meter, f_vector_type);
    CLASS_ATTR_ACCESSORS            (c, "vectors", NULL, vectors_set);
	CLASS_ATTR_ORDER                (c, "vectors", 0, "2");
    CLASS_ATTR_LABEL                (c, "vectors", 0, "Vectors");
	CLASS_ATTR_DEFAULT              (c, "vectors", 0, "Energy");
	CLASS_ATTR_SAVE                 (c, "vectors", 1);
    CLASS_ATTR_STYLE                (c, "vectors", 1, "menu");
    CLASS_ATTR_ITEMS                (c, "vectors", 1, "none energy velocity both");
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_meter, f_interval);
	CLASS_ATTR_ORDER                (c, "interval", 0, "5");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval (in ms)");
	CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
	CLASS_ATTR_DEFAULT              (c, "interval", 0, "50");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
	CLASS_ATTR_STYLE                (c, "interval", 1, "number");
    
    CLASS_ATTR_RGBA					(c, "bgcolor", 0, t_hoa_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_DEFAULT_SAVE_PAINT	(c, "bgcolor", 0, "0.76 0.76 0.76 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 1, "color");
    
    CLASS_ATTR_RGBA					(c, "bdcolor", 0, t_hoa_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_DEFAULT_SAVE_PAINT	(c, "bdcolor", 0, "0.7 0.7 0.7 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_hoa_meter, f_color_cold_signal);
	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_STYLE                (c, "coldcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_hoa_meter, f_color_tepid_signal);
	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_STYLE                (c, "tepidcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_hoa_meter, f_color_warm_signal);
	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_STYLE                (c, "warmcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_hoa_meter, f_color_hot_signal);
	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_STYLE                (c, "hotcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "overcolor", 0, t_hoa_meter, f_color_over_signal);
	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_STYLE                (c, "overcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_hoa_meter, f_color_energy_vector);
	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_STYLE                (c, "energycolor", 1, "color");
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_hoa_meter, f_color_velocity_vector);
	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_ATTR_STYLE                (c, "velocitycolor", 1, "color");
	
    eclass_register(CLASS_BOX, c);
	hoa_meter_class = c;
}
Esempio n. 23
0
extern "C" void setup_c0x2eknob(void)
{
    t_eclass *c = eclass_new("c.knob", (method)knob_new, (method)ebox_free, (short)sizeof(t_knob), 0L, A_GIMME, 0);
    
    if(c)
    {
        eclass_guiinit(c, 0);
        
        eclass_addmethod(c, (method) knob_paint,            "paint",            A_NULL, 0);
        eclass_addmethod(c, (method) knob_notify,           "notify",           A_NULL, 0);
        eclass_addmethod(c, (method) knob_getdrawparams,    "getdrawparams",    A_NULL, 0);
        eclass_addmethod(c, (method) knob_oksize,           "oksize",           A_NULL, 0);
        eclass_addmethod(c, (method) knob_set,              "set",              A_FLOAT,0);
        eclass_addmethod(c, (method) knob_float,            "float",            A_FLOAT,0);
        eclass_addmethod(c, (method) knob_bang,             "bang",             A_NULL, 0);
        
        eclass_addmethod(c, (method) knob_mousedown,        "mousedown",        A_NULL, 0);
        eclass_addmethod(c, (method) knob_mousedrag,        "mousedrag",        A_NULL, 0);
        eclass_addmethod(c, (method) knob_mouseup,          "mouseup",          A_NULL, 0);
        
        CLASS_ATTR_DEFAULT              (c, "size", 0, "50. 50.");
        
        CLASS_ATTR_CHAR                 (c, "endless", 0, t_knob, f_endless);
        CLASS_ATTR_LABEL                (c, "endless", 0, "Endless Mode");
        CLASS_ATTR_ORDER                (c, "endless", 0, "1");
        CLASS_ATTR_FILTER_CLIP          (c, "endless", 0, 1);
        CLASS_ATTR_DEFAULT              (c, "endless", 0, "0");
        CLASS_ATTR_SAVE                 (c, "endless", 0);
        CLASS_ATTR_STYLE                (c, "endless", 0, "onoff");
        CLASS_ATTR_PAINT                (c, "endless", 0);
        
        CLASS_ATTR_FLOAT_ARRAY          (c, "minmax", 0, t_knob, f_dummy, 2);
        CLASS_ATTR_ORDER                (c, "minmax", 0, "3");
        CLASS_ATTR_LABEL                (c, "minmax", 0, "Min/Max Values");
        CLASS_ATTR_DEFAULT              (c, "minmax", 0, "0 1");
        CLASS_ATTR_ACCESSORS            (c, "minmax", knob_minmax_get, knob_minmax_set);
        CLASS_ATTR_SAVE                 (c, "minmax", 1);
        
        CLASS_ATTR_INT                  (c, "bdsize", 0, t_knob, f_bdsize);
        CLASS_ATTR_LABEL                (c, "bdsize", 0, "Border Size");
        CLASS_ATTR_ORDER                (c, "bdsize", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdsize", 0, "2");
        CLASS_ATTR_FILTER_CLIP          (c, "bdsize", 0, 4);
        CLASS_ATTR_STYLE                (c, "bdsize", 0, "number");
        
        CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_knob, f_color_background);
        CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
        CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
        CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
        
        CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_knob, f_color_border);
        CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
        CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
        
        CLASS_ATTR_RGBA                 (c, "necolor", 0, t_knob, f_color_needle);
        CLASS_ATTR_LABEL                (c, "necolor", 0, "Needle Color");
        CLASS_ATTR_ORDER                (c, "necolor", 0, "3");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "necolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "necolor", 0, "color");
        
        eclass_register(CLASS_BOX, c);
        knob_class = c;
    }
}
Esempio n. 24
0
int C74_EXPORT main()
{
	t_class *c;

	c = class_new("hoa.scope~", (method)scope_new, (method)scope_free, (short)sizeof(t_scope), 0L, A_GIMME, 0);

	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	class_dspinitjbox(c);
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);

	class_addmethod(c, (method)scope_dsp,			"dsp",			A_CANT, 0);
	class_addmethod(c, (method)scope_dsp64,			"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)scope_assist,		"assist",		A_CANT,	0);
	class_addmethod(c, (method)scope_paint,			"paint",		A_CANT,	0);
	class_addmethod(c, (method)scope_notify,		"notify",		A_CANT, 0);
	class_addmethod(c, (method)scope_getdrawparams, "getdrawparams", A_CANT, 0);
	class_addmethod(c, (method)scope_oksize,		"oksize",		A_CANT, 0);

	CLASS_ATTR_DEFAULT			(c, "patching_rect", 0, "0 0 225 225");

    CLASS_ATTR_LONG             (c, "order", 0, t_scope, f_order);
    CLASS_ATTR_ACCESSORS        (c, "order", (method)NULL,(method)scope_setattr_order);
	CLASS_ATTR_CATEGORY			(c, "order", 0, "Value");
	CLASS_ATTR_ORDER			(c, "order", 0, "1");
	CLASS_ATTR_LABEL			(c, "order", 0, "Ambisonic Order");
	CLASS_ATTR_FILTER_MIN		(c, "order", 1);
	CLASS_ATTR_DEFAULT			(c, "order", 0, "3");
	CLASS_ATTR_SAVE				(c, "order", 1);
	
    CLASS_ATTR_LONG             (c, "mode", 0, t_scope, f_process_mode);
	CLASS_ATTR_CATEGORY			(c, "mode", 0, "Value");
    CLASS_ATTR_ENUMINDEX2       (c, "mode", 0, "Peak", "Average");
	CLASS_ATTR_ORDER			(c, "mode", 0, "2");
	CLASS_ATTR_LABEL			(c, "mode", 0, "Process Mode");
	CLASS_ATTR_DEFAULT			(c, "mode", 0, "0");
	CLASS_ATTR_SAVE				(c, "mode", 1);
    
    CLASS_ATTR_LONG             (c, "bufsize", 0, t_scope, f_bufsize);
	CLASS_ATTR_CATEGORY			(c, "bufsize", 0, "Value");
	CLASS_ATTR_ORDER			(c, "bufsize", 0, "3");
    CLASS_ATTR_FILTER_MIN		(c, "bufsize", 1);
	CLASS_ATTR_LABEL			(c, "bufsize", 0, "Buffer Size (in samps)");
	CLASS_ATTR_DEFAULT			(c, "bufsize", 0, "128");
	CLASS_ATTR_SAVE				(c, "bufsize", 1);
    
	CLASS_ATTR_LONG             (c, "interval", 0, t_scope, f_interval);
	CLASS_ATTR_CATEGORY			(c, "interval", 0, "Value");
	CLASS_ATTR_ORDER			(c, "interval", 0, "4");
	CLASS_ATTR_LABEL			(c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN		(c, "interval", 20);
	CLASS_ATTR_DEFAULT			(c, "interval", 0, "100");
	CLASS_ATTR_SAVE				(c, "interval", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawcircle", 0, t_scope, f_drawCircle);
	CLASS_ATTR_CATEGORY			(c, "drawcircle", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcircle", 0, "1");
	CLASS_ATTR_STYLE_LABEL		(c, "drawcircle", 0, "onoff", "Draw Circle");
	CLASS_ATTR_DEFAULT			(c, "drawcircle", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcircle", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawangles", 0, t_scope, f_drawAngles);
	CLASS_ATTR_CATEGORY			(c, "drawangles", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawangles", 0, "2");
	CLASS_ATTR_STYLE_LABEL		(c, "drawangles", 0, "onoff", "Draw Angles");
	CLASS_ATTR_DEFAULT			(c, "drawangles", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawangles", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawcontrib", 0, t_scope, f_drawContributions);
	CLASS_ATTR_CATEGORY			(c, "drawcontrib", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcontrib", 0, "3");
	CLASS_ATTR_STYLE_LABEL		(c, "drawcontrib", 0, "onoff", "Draw Contributions");
	CLASS_ATTR_DEFAULT			(c, "drawcontrib", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcontrib", 1);
	
	CLASS_ATTR_INVISIBLE		(c, "color", 0);
	CLASS_ATTR_INVISIBLE		(c, "textcolor", 0);
	
	CLASS_ATTR_RGBA				(c, "bgcolor", 0, t_scope, f_colorBackground);
	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, "bordercolor", 0, t_scope, f_bordercolor);
	CLASS_ATTR_CATEGORY			(c, "bordercolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bordercolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bordercolor", 0, "Border Color");
	CLASS_ATTR_ORDER			(c, "bordercolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bordercolor", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA				(c, "txcolor", 0, t_scope, f_colorText);
	CLASS_ATTR_CATEGORY			(c, "txcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "txcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "txcolor", 0, "Text Color");
	CLASS_ATTR_ORDER			(c, "txcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "txcolor", 0, "0. 0. 0. 7.");
	
	CLASS_ATTR_RGBA				(c, "phcolor", 0, t_scope, f_colorPositif);
	CLASS_ATTR_CATEGORY			(c, "phcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "phcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "phcolor", 0, "Positifs Harmonics");
	CLASS_ATTR_ORDER			(c, "phcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "phcolor", 0, "1. 0. 0. 1.");
	
	CLASS_ATTR_RGBA				(c, "nhcolor", 0, t_scope, f_colorNegatif);
	CLASS_ATTR_CATEGORY			(c, "nhcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "nhcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "nhcolor", 0, "Negatifs Harmonics");
	CLASS_ATTR_ORDER			(c, "nhcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "nhcolor", 0, "0. 0. 1. 1.");
	
	class_register(CLASS_BOX, c);
	scope_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Esempio n. 25
0
extern "C" void setup_c0x2etab(void)
{
    t_eclass *c = eclass_new("c.tab", (method)tab_new, (method)ebox_free, (short)sizeof(t_tab), 0L, A_GIMME, 0);

    if(c)
    {
        eclass_guiinit(c, 0);
        eclass_addmethod(c, (method) tab_paint,             "paint",            A_NULL, 0);
        eclass_addmethod(c, (method) tab_notify,            "notify",           A_NULL, 0);
        eclass_addmethod(c, (method) tab_getdrawparams,     "getdrawparams",    A_NULL, 0);
        eclass_addmethod(c, (method) tab_oksize,            "oksize",           A_NULL, 0);

        eclass_addmethod(c, (method) tab_append,            "append",           A_GIMME,0);
        eclass_addmethod(c, (method) tab_insert,            "insert",           A_GIMME,0);
        eclass_addmethod(c, (method) tab_setitem,           "setitem",          A_GIMME,0);
        eclass_addmethod(c, (method) tab_delete,            "delete",           A_FLOAT,0);
        eclass_addmethod(c, (method) tab_clear,             "clear",            A_NULL,0);

        eclass_addmethod(c, (method) tab_float,             "float",            A_FLOAT,0);
        eclass_addmethod(c, (method) tab_anything,          "anything",         A_GIMME,0);
        eclass_addmethod(c, (method) tab_set,               "set",              A_GIMME,0);
        eclass_addmethod(c, (method) tab_setsymbol,         "setsymbol",        A_GIMME,0);
        eclass_addmethod(c, (method) tab_bang,              "bang",             A_NULL, 0);
        eclass_addmethod(c, (method) tab_next,              "next",             A_NULL, 0);
        eclass_addmethod(c, (method) tab_prev,              "prev",             A_NULL, 0);

        eclass_addmethod(c, (method) tab_mousedown,         "mousedown",       A_NULL, 0);
        eclass_addmethod(c, (method) tab_mouseup,           "mouseup",         A_NULL, 0);
        eclass_addmethod(c, (method) tab_mousemove,         "mousemove",       A_NULL, 0);
        eclass_addmethod(c, (method) tab_mouseleave,        "mouseleave",      A_NULL, 0);

        CLASS_ATTR_DEFAULT              (c, "size", 0, "100 13");

        CLASS_ATTR_CHAR                 (c, "orientation", 0, t_tab, f_orientation);
        CLASS_ATTR_LABEL                (c, "orientation", 0, "Vertical Orientation");
        CLASS_ATTR_ORDER                (c, "orientation", 0, "1");
        CLASS_ATTR_FILTER_CLIP          (c, "orientation", 0, 1);
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "orientation", 0, "0");
        CLASS_ATTR_STYLE                (c, "orientation", 0, "onoff");

        CLASS_ATTR_CHAR                 (c, "toggle", 0, t_tab, f_toggle);
        CLASS_ATTR_LABEL                (c, "toggle", 0, "Toggle Mode");
        CLASS_ATTR_ORDER                (c, "toggle", 0, "1");
        CLASS_ATTR_FILTER_CLIP          (c, "toggle", 0, 1);
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "toggle", 0, "0");
        CLASS_ATTR_STYLE                (c, "toggle", 0, "onoff");

        CLASS_ATTR_SYMBOL_VARSIZE       (c, "items", 0, t_tab, f_items, f_nitems, CREAM_MAXITEMS);
        CLASS_ATTR_LABEL                (c, "items", 0, "Items");
        CLASS_ATTR_ORDER                (c, "items", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "items", 0, "");
        CLASS_ATTR_ACCESSORS            (c, "items", NULL, tab_items_set);

        CLASS_ATTR_FONT                 (c, "font", 0, t_tab, f_font);
        CLASS_ATTR_LABEL                (c, "font", 0, "Font");
        CLASS_ATTR_SAVE                 (c, "font", 0);
        CLASS_ATTR_PAINT                (c, "font", 0);

        CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_tab, f_color_background);
        CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
        CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
        CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_tab, f_color_border);
        CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
        CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "textcolor", 0, t_tab, f_color_text);
        CLASS_ATTR_LABEL                (c, "textcolor", 0, "Text Color");
        CLASS_ATTR_ORDER                (c, "textcolor", 0, "3");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "textcolor", 0, "0. 0. 0. 1.");
        CLASS_ATTR_STYLE                (c, "textcolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "hocolor", 0, t_tab, f_color_hover);
        CLASS_ATTR_LABEL                (c, "hocolor", 0, "Hover Color");
        CLASS_ATTR_ORDER                (c, "hocolor", 0, "4");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hocolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "hocolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "secolor", 0, t_tab, f_color_select);
        CLASS_ATTR_LABEL                (c, "secolor", 0, "Selection Color");
        CLASS_ATTR_ORDER                (c, "secolor", 0, "5");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "secolor", 0, "0.35 0.35 0.35 1.");
        CLASS_ATTR_STYLE                (c, "secolor", 0, "color");

        eclass_register(CLASS_BOX, c);
        tab_class = c;

    }
}
Esempio n. 26
0
int JAMOMA_EXPORT_MAXOBJ main(void)
{
	long		flags;
	t_class*	c;
	long		numDataspaces = 0;
	t_symbol**	dataspaceNames = NULL;
	TTValue		functionNames;
	TTSymbol*	functionName;
	char		dataspaces[2048];
	char		functions[2048];
	char		tempstr[64];
	short		i;

	jamoma_init();
common_symbols_init();
	jamoma_getDataspaceList(&numDataspaces, &dataspaceNames);
	dataspaces[0] = 0;
	for(i=0; i<numDataspaces; i++){
		strcat(dataspaces, dataspaceNames[i]->s_name);
		strcat(dataspaces, " ");
	}
	FunctionLib::getUnitNames(functionNames);
	functions[0] = 0;
	for(i=0; i<functionNames.getSize(); i++){
		functionNames.get(i, &functionName);
		strcat(functions, functionName->getCString());	
		strcat(functions, " ");
	}

	c = class_new("jcom.paramui",
				  (method)paramui_new,
				  (method)paramui_free,
				  sizeof(t_paramui),
				  (method)NULL,
				  A_GIMME,
				  0L);

	flags = JBOX_TEXTFIELD | JBOX_COLOR;
	jbox_initclass(c, flags);
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY; // to specify dictionary constructor

	class_addmethod(c, (method)paramui_notify,			"notify",			A_CANT, 0);
	class_addmethod(c, (method)paramui_paint,			"paint",			A_CANT, 0);
	class_addmethod(c, (method)paramui_mousedown,		"mousedown",		A_CANT, 0);
	class_addmethod(c, (method)paramui_mousedragdelta,	"mousedragdelta",	A_CANT, 0);
	class_addmethod(c, (method)paramui_mouseup,			"mouseup",			A_CANT, 0);
	class_addmethod(c, (method)paramui_oksize,			"oksize",			A_CANT, 0);

	CLASS_ATTR_DEFAULT(c,		"patching_rect",	0, "0. 0. 144. 20.");
	CLASS_ATTR_DEFAULT(c,		"fontname",			0, JAMOMA_DEFAULT_FONT);
	snprintf(tempstr, 64, "%f", JAMOMA_DEFAULT_FONTSIZE);
	CLASS_ATTR_DEFAULT(c,		"fontsize",			0, tempstr);

	CLASS_STICKY_ATTR(c,		"category",			0, "Jamoma");
	
	CLASS_ATTR_SYM(c,			"name",				0, t_paramui, attr_name);
	CLASS_ATTR_LABEL(c,			"name",				0, "Parameter Name");
	CLASS_ATTR_DEFAULT(c,		"name",				0, "my/parameter");
	CLASS_ATTR_SAVE(c,			"name",				0);
	CLASS_ATTR_ACCESSORS(c,		"name",				paramui_getName, paramui_setName);

	CLASS_ATTR_SYM(c,			"label",			0, t_paramui, attr_label);
	CLASS_ATTR_LABEL(c,			"label",			0, "Parameter Label");
	CLASS_ATTR_STYLE(c,			"label",			0, "text_onesymbol");
	CLASS_ATTR_DEFAULT(c,		"label",			0, "");
	CLASS_ATTR_SAVE(c,			"label",			0);

	CLASS_ATTR_SYM(c,			"type",				0, t_paramui, attr_type);
	CLASS_ATTR_LABEL(c,			"type",				0, "Data Type");
	CLASS_ATTR_ENUM(c,			"type",				0, "decimal integer string boolean");
	CLASS_ATTR_DEFAULT(c,		"type",				0, "decimal");
	CLASS_ATTR_SAVE(c,			"type",				0);
	CLASS_ATTR_ACCESSORS(c,		"type",				paramui_getType, paramui_setType);

	CLASS_ATTR_FLOAT_VARSIZE(c,	"value/default",	0, t_paramui, attr_default, attr_defaultSize, LISTSIZE);
	CLASS_ATTR_LABEL(c,			"value/default",	0, "Default Value");
	CLASS_ATTR_DEFAULT(c,		"value/default",	0, "0.");
	CLASS_ATTR_SAVE(c,			"value/default",	0);
	CLASS_ATTR_ACCESSORS(c,		"value/default",	paramui_getDefault, paramui_setDefault);

	CLASS_ATTR_SYM(c,			"ramp/drive",		0, t_paramui, attr_rampDrive);
	CLASS_ATTR_LABEL(c,			"ramp/drive",		0, "Ramp Drive");
	CLASS_ATTR_DEFAULT(c,		"ramp/drive",		0, "none");
	CLASS_ATTR_SAVE(c,			"ramp/drive",		0);
	CLASS_ATTR_ACCESSORS(c,		"ramp/drive",		paramui_getRampDrive, paramui_setRampDrive);

	CLASS_ATTR_SYM(c,			"ramp/function",	0, t_paramui, attr_rampFunction);
	CLASS_ATTR_LABEL(c,			"ramp/function",	0, "Ramp Function/Shape");
	CLASS_ATTR_ENUM(c,			"ramp/function",	0, functions);
	CLASS_ATTR_DEFAULT(c,		"ramp/function",	0, "linear");
	CLASS_ATTR_SAVE(c,			"ramp/function",	0);
	CLASS_ATTR_ACCESSORS(c,		"ramp/function",	paramui_getRampFunction, paramui_setRampFunction);

	CLASS_ATTR_LONG(c,			"view/freeze",		0, t_paramui, attr_uiFreeze);
	CLASS_ATTR_LABEL(c,			"view/freeze",		0, "Freeze the UI");
	CLASS_ATTR_STYLE(c,			"view/freeze",		0, "onoff");
	CLASS_ATTR_DEFAULT(c,		"view/freeze",		0, "0");
	CLASS_ATTR_SAVE(c,			"view/freeze",		0);
	CLASS_ATTR_ACCESSORS(c,		"view/freeze",		paramui_getUIFreeze, paramui_setUIFreeze);

	CLASS_ATTR_FLOAT(c,			"value/stepsize",	0, t_paramui, attr_stepsize);
	CLASS_ATTR_LABEL(c,			"value/stepsize",	0, "Step Size for inc/dec");
	CLASS_ATTR_DEFAULT(c,		"value/stepsize",	0, "1.0");
	CLASS_ATTR_SAVE(c,			"value/stepsize",	0);
	CLASS_ATTR_ACCESSORS(c,		"value/stepsize",	paramui_getStepsize, paramui_setStepsize);

	CLASS_ATTR_LONG(c,			"priority",			0, t_paramui, attr_priority);
	CLASS_ATTR_LABEL(c,			"priority",			0, "Priority when Recalled from Presets");
	CLASS_ATTR_DEFAULT(c,		"priority",			0, "0");
	CLASS_ATTR_SAVE(c,			"priority",			0);
	CLASS_ATTR_ACCESSORS(c,		"priority",			paramui_getPriority, paramui_setPriority);

	CLASS_ATTR_FLOAT_ARRAY(c,	"range/bounds",		0, t_paramui, attr_range, 2);
	CLASS_ATTR_LABEL(c,			"range/bounds",		0, "Range");
	CLASS_ATTR_DEFAULT(c,		"range/bounds",		0, "0.0 1.0");
	CLASS_ATTR_SAVE(c,			"range/bounds",		0);
	CLASS_ATTR_ACCESSORS(c,		"range/bounds",		paramui_getRange, paramui_setRange);

	CLASS_ATTR_LONG(c,			"repetitions/allow",		0, t_paramui, attr_repetitions);
	CLASS_ATTR_LABEL(c,			"repetitions/allow",		0, "Allow Repeated Values");
	CLASS_ATTR_STYLE(c,			"repetitions/allow",		0, "onoff");
	CLASS_ATTR_DEFAULT(c,		"repetitions/allow",		0, "0");
	CLASS_ATTR_SAVE(c,			"repetitions/allow",		0);
	CLASS_ATTR_ACCESSORS(c,		"repetitions/allow",		paramui_getRepetitions, paramui_setRepetitions);

	CLASS_ATTR_SYM(c,			"range/clipmode",	0, t_paramui, attr_clipmode);
	CLASS_ATTR_LABEL(c,			"range/clipmode",	0, "Mode for Clipping to Range");
	CLASS_ATTR_ENUM(c,			"range/clipmode",	0, "none low high both");
	CLASS_ATTR_DEFAULT(c,		"range/clipmode",	0, "none");
	CLASS_ATTR_SAVE(c,			"range/clipmode",	0);
	CLASS_ATTR_ACCESSORS(c,		"range/clipmode",	paramui_getClipmode, paramui_setClipmode);

	CLASS_ATTR_SYM(c,			"description",		0, t_paramui, attr_description);
	CLASS_ATTR_LABEL(c,			"description",		0, "Parameter Description");
	//CLASS_ATTR_STYLE(c,			"description",		0, "text_large");
	CLASS_ATTR_STYLE(c,			"description",		0, "text_onesymbol");
	CLASS_ATTR_DEFAULT(c,		"description",		0, "This parameter should do something.");
	CLASS_ATTR_SAVE(c,			"description",		0);
	CLASS_ATTR_ACCESSORS(c,		"description",		paramui_getDescription, paramui_setDescription);

	CLASS_ATTR_SYM(c,			"dataspace",		0, t_paramui, attr_dataspace);
	CLASS_ATTR_LABEL(c,			"dataspace",		0, "Dataspace");
	CLASS_ATTR_ENUM(c,			"dataspace",		0, dataspaces);
	CLASS_ATTR_DEFAULT(c,		"dataspace",		0, "none");
	CLASS_ATTR_SAVE(c,			"dataspace",		0);
	CLASS_ATTR_ACCESSORS(c,		"dataspace",		paramui_getDataspace, paramui_setDataspace);

	CLASS_ATTR_SYM(c,			"dataspace/unit/active",		0, t_paramui, attr_unitActive);
	CLASS_ATTR_LABEL(c,			"dataspace/unit/active",		0, "Active Unit within the Dataspace");
	CLASS_ATTR_DEFAULT(c,		"dataspace/unit/active",		0, "none");
	CLASS_ATTR_SAVE(c,			"dataspace/unit/active",		0);
	CLASS_ATTR_ACCESSORS(c,		"dataspace/unit/active",		paramui_getUnitActive, paramui_setUnitActive);

	CLASS_ATTR_SYM(c,			"dataspace/unit/native",		0, t_paramui, attr_unitNative);
	CLASS_ATTR_LABEL(c,			"dataspace/unit/native",		0, "Native Unit within the Dataspace");
	CLASS_ATTR_DEFAULT(c,		"dataspace/unit/native",		0, "none");
	CLASS_ATTR_SAVE(c,			"dataspace/unit/native",		0);
	CLASS_ATTR_ACCESSORS(c,		"dataspace/unit/native",		paramui_getUnitNative, paramui_setUnitNative);

	CLASS_STICKY_ATTR_CLEAR(c,	"category");

	class_register(CLASS_BOX, c);
	s_ui_class = c;
	
	sysmem_freeptr(dataspaceNames);
	return 0;
}
Esempio n. 27
0
TTErr wrapTTModularClassAsMaxClass(TTSymbol& ttblueClassName, const char* maxClassName, WrappedClassPtr* c, ModularSpec* specificities)
{
	TTObject        o;
	TTValue			v, args;
	WrappedClass*	wrappedMaxClass = NULL;
	TTSymbol		TTName;
	t_symbol		*MaxName = NULL;
    TTUInt16        i;
	
	jamoma_init();
	common_symbols_init();
	
	if (!wrappedMaxClasses)
		wrappedMaxClasses = hashtab_new(0);
	
	wrappedMaxClass = new WrappedClass;
	wrappedMaxClass->maxClassName = gensym(maxClassName);
	wrappedMaxClass->maxClass = class_new(	maxClassName,
										  (method)wrappedModularClass_new,
										  (method)wrappedModularClass_free,
										  sizeof(WrappedModularInstance),
										  (method)0L,
										  A_GIMME,
										  0);
	wrappedMaxClass->ttblueClassName = ttblueClassName;
	wrappedMaxClass->validityCheck = NULL;
	wrappedMaxClass->validityCheckArgument = NULL;
	wrappedMaxClass->options = NULL;
	wrappedMaxClass->maxNamesToTTNames = hashtab_new(0);
	
	wrappedMaxClass->specificities = specificities;
    
#ifdef AUDIO_EXTERNAL
    // Setup our class to work with MSP
	class_dspinit(wrappedMaxClass->maxClass);
#endif
	
	// Create a temporary instance of the class so that we can query it.
	o = TTObject(ttblueClassName);
	
	// Register Messages as Max method
	o.messages(v);
	for (i = 0; i < v.size(); i++)
	{
		TTName = v[i];

        if (TTName == TTSymbol("test")                      ||
            TTName == TTSymbol("getProcessingBenchmark")    ||
            TTName == TTSymbol("resetBenchmarking"))
			continue;
        else if ((MaxName = jamoma_TTName_To_MaxName(TTName))) 
		{
            hashtab_store(wrappedMaxClass->maxNamesToTTNames, MaxName, (t_object*)(TTName.rawpointer()));
            class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_anything, MaxName->s_name, A_GIMME, 0);
        }
	}
	
	// Register Attributes as Max attr
	o.attributes(v);
	for (i = 0; i < v.size(); i++) {
		TTAttributePtr	attr = NULL;
		t_symbol		*maxType = _sym_atom;
		
		TTName = v[i];
        
#ifdef AUDIO_EXTERNAL
        // the enable word is already used by a message declared in the dsp_init method
        if (TTName == TTSymbol("enable"))
            continue;
#endif
        
        // we want to hide service attribute for Max external
        if (TTName == TTSymbol("service"))
            continue;
		
		if ((MaxName = jamoma_TTName_To_MaxName(TTName))) {
            
            if (TTName == kTTSym_bypass && wrappedMaxClass->maxClassName != gensym("j.in") && wrappedMaxClass->maxClassName != gensym("j.in~"))
                continue;
            
			o.instance()->findAttribute(TTName, &attr);
			
			if (attr->type == kTypeFloat32)
				maxType = _sym_float32;
			else if (attr->type == kTypeFloat64)
				maxType = _sym_float64;
			else if (attr->type == kTypeSymbol || attr->type == kTypeString)
				maxType = _sym_symbol;
			else if (attr->type == kTypeLocalValue)
				maxType = _sym_atom;
			
			hashtab_store(wrappedMaxClass->maxNamesToTTNames, MaxName, (t_object*)(TTName.rawpointer()));
			class_addattr(wrappedMaxClass->maxClass, attr_offset_new(MaxName->s_name, maxType, 0, (method)wrappedModularClass_attrGet, (method)wrappedModularClass_attrSet, 0));
			
			// Add display styles for the Max 5 inspector
			if (attr->type == kTypeBoolean)
				CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)TTName.c_str(), 0, "onoff");
			if (TTName == TTSymbol("fontFace"))
				CLASS_ATTR_STYLE(wrappedMaxClass->maxClass,	"fontFace", 0, "font");
		}
	}
	
	// standalone support:
	class_addmethod(wrappedMaxClass->maxClass, (method)jamoma_fileusage, "fileusage", A_CANT, 0);

	class_addmethod(wrappedMaxClass->maxClass, (method)stdinletinfo,							"inletinfo",			A_CANT, 0);
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_notify,				"notify",				A_CANT, 0);
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_shareContextNode,	"share_context_node",	A_CANT,	0);
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_anything,			"anything",				A_GIMME, 0);
	
	// Register specific methods and do specific things
	if (specificities) {
		if (specificities->_wrap)
			specificities->_wrap(wrappedMaxClass);
	}
	
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_dump,				"dump",					A_GIMME, 0);

#ifdef ARRAY_EXTERNAL
	
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_ArraySelect,				"array/select",			A_GIMME,0);
    class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_ArrayResize,				"array/resize",			A_LONG,0);
	
	CLASS_ATTR_SYM(wrappedMaxClass->maxClass,			"format",	0,		WrappedModularInstance,	arrayAttrFormat);
	CLASS_ATTR_ACCESSORS(wrappedMaxClass->maxClass,		"format",			wrappedModularClass_FormatGet,	wrappedModularClass_FormatSet);
	CLASS_ATTR_ENUM(wrappedMaxClass->maxClass,			"format",	0,		"single array");
#endif
	
	class_register(_sym_box, wrappedMaxClass->maxClass);
	if (c)
		*c = wrappedMaxClass;
	
	hashtab_store(wrappedMaxClasses, wrappedMaxClass->maxClassName, (t_object*)(wrappedMaxClass));
	return kTTErrNone;
}
Esempio n. 28
0
extern "C"  void setup_c0x2egain_tilde(void)
{
	t_eclass *c;
    
	c = eclass_new("c.gain~", (method)gain_new, (method)gain_free, (short)sizeof(t_gain), 0L, A_GIMME, 0);
    
    eclass_dspinit(c);
	eclass_init(c, 0);
	
    eclass_addmethod(c, (method) gain_dsp,             "dsp",              A_CANT, 0);
	eclass_addmethod(c, (method) gain_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) gain_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) gain_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) gain_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) gain_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) gain_set,             "set",              A_FLOAT,0);
    eclass_addmethod(c, (method) gain_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) gain_linear,          "linear",           A_FLOAT,0);
    eclass_addmethod(c, (method) gain_bang,            "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) gain_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) gain_mousedrag,       "mousedrag",        A_CANT, 0);
    eclass_addmethod(c, (method) gain_dblclick,        "dblclick",         A_CANT, 0);
    eclass_addmethod(c, (method) gain_preset,          "preset",           A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "20. 160.");
    
    CLASS_ATTR_LONG                 (c, "mode", 0, t_gain, f_mode);
	CLASS_ATTR_LABEL                (c, "mode", 0, "Relative Mode");
	CLASS_ATTR_ORDER                (c, "mode", 0, "1");
    CLASS_ATTR_FILTER_CLIP          (c, "mode", 0, 1);
    CLASS_ATTR_DEFAULT              (c, "mode", 0, "0");
    CLASS_ATTR_SAVE                 (c, "mode", 1);
    CLASS_ATTR_STYLE                (c, "mode", 0, "onoff");
    
    CLASS_ATTR_FLOAT                (c, "ramp", 0, t_gain, f_ramp);
	CLASS_ATTR_LABEL                (c, "ramp", 0, "Ramp Time (ms)");
    CLASS_ATTR_ACCESSORS			(c, "ramp", NULL, gain_ramp_set);
	CLASS_ATTR_ORDER                (c, "ramp", 0, "1");
    CLASS_ATTR_FILTER_MIN           (c, "ramp", 0);
    CLASS_ATTR_DEFAULT              (c, "ramp", 0, "20");
    CLASS_ATTR_SAVE                 (c, "ramp", 1);
    CLASS_ATTR_STYLE                (c, "ramp", 0, "number");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_gain, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_gain, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "kncolor", 0, t_gain, f_color_knob);
	CLASS_ATTR_LABEL                (c, "kncolor", 0, "Knob Color");
	CLASS_ATTR_ORDER                (c, "kncolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "kncolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "kncolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    cicm_post();
	gain_class = c;
}
Esempio n. 29
0
int main()
{
	t_class *c;
    common_symbols_init();
    
	c = class_new("hoa.space", (method)space_new, (method)space_free, (short)sizeof(t_space), 0L, A_GIMME, 0);

	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);

	class_addmethod(c, (method)space_assist,          "assist",         A_CANT,	0);
	class_addmethod(c, (method)space_paint,           "paint",          A_CANT,	0);
	class_addmethod(c, (method)space_notify,          "notify",         A_CANT, 0);
	class_addmethod(c, (method)space_getdrawparams,   "getdrawparams",  A_CANT, 0);
	class_addmethod(c, (method)space_mouse_down,      "mousedown",      A_CANT, 0);
	class_addmethod(c, (method)space_mouse_drag,      "mousedrag",      A_CANT, 0);
    class_addmethod(c, (method)space_mouse_enddrag,   "mouseup",         A_CANT, 0);
    class_addmethod(c, (method)space_preset,          "preset",         0);
    class_addmethod(c, (method)space_getvalueof,      "getvalueof",     A_CANT, 0);
	class_addmethod(c, (method)space_setvalueof,      "setvalueof",     A_CANT, 0);
    class_addmethod(c, (method)coefficients_set,      "list",           A_GIMME, 0);
    
	CLASS_ATTR_DEFAULT				(c, "patching_rect", 0, "0 0 225 225");
	CLASS_ATTR_INVISIBLE			(c, "color", 0);
	CLASS_ATTR_INVISIBLE			(c, "textcolor", 0);
	
	CLASS_ATTR_LONG					(c, "shadow", 0, t_space, f_shadow);
	CLASS_ATTR_CATEGORY				(c, "shadow", 0, "Appearance");
	CLASS_ATTR_ORDER				(c, "shadow", 0, "1");
	CLASS_ATTR_STYLE_LABEL			(c, "shadow", 0, "onoff", "Draw Shadows");
	CLASS_ATTR_DEFAULT				(c, "shadow", 0, "1");
	CLASS_ATTR_SAVE					(c, "shadow", 1);

    CLASS_ATTR_LONG					(c, "nmics", 0, t_space, f_number_of_microphones);
	CLASS_ATTR_CATEGORY				(c, "nmics", 0, "Behavior");
	CLASS_ATTR_ORDER				(c, "nmics", 0, "1");
	CLASS_ATTR_LABEL				(c, "nmics", 0, "Number of virtuals microphones");
	CLASS_ATTR_ACCESSORS			(c, "nmics", NULL, number_of_microphones_set);
	CLASS_ATTR_DEFAULT				(c, "nmics", 0, "10");
	CLASS_ATTR_SAVE					(c, "nmics", 1);

    CLASS_ATTR_DOUBLE_VARSIZE       (c, "coeffs", 0, t_space, f_microphonesValues, f_number_of_microphones, MAX_MICS);
	CLASS_ATTR_CATEGORY             (c, "coeffs", 0, "Behavior");
	CLASS_ATTR_ORDER                (c, "coeffs", 0, "2");
	CLASS_ATTR_LABEL                (c, "coeffs", 0, "Virtuals microphones coefficients");
    CLASS_ATTR_ACCESSORS			(c, "coeffs", NULL, coefficients_set);
	CLASS_ATTR_DEFAULT              (c, "coeffs", 0, "666.");
	CLASS_ATTR_SAVE                 (c, "coeffs", 1);
    
	CLASS_ATTR_RGBA					(c, "bgcolor", 0, t_space, f_color_background);
	CLASS_ATTR_CATEGORY				(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "bgcolor", 0, "1. 1. 1. 1.");
	
	CLASS_ATTR_RGBA					(c, "circlecolor", 0, t_space, f_color_circle);
	CLASS_ATTR_CATEGORY				(c, "circlecolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "circlecolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "circlecolor", 0, "Circle Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "circlecolor", 0, "0.6 0.6 0.6 1.");
	
	CLASS_ATTR_RGBA					(c, "harmocolor", 0, t_space, f_color_harmonics);
	CLASS_ATTR_CATEGORY				(c, "harmocolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "harmocolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "harmocolor", 0, "Harmonics color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "harmocolor", 0, "0. 0. 1. 0.25");
	
	CLASS_ATTR_RGBA					(c, "miccolor", 0, t_space, f_color_points);
	CLASS_ATTR_CATEGORY				(c, "miccolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "miccolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "miccolor", 0, "Virtuals microphones color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "miccolor", 0, "0. 0. 0. 1.");
	
	CLASS_ATTR_RGBA					(c, "cishadcolor", 0, t_space, f_color_circleShadow);
	CLASS_ATTR_CATEGORY				(c, "cishadcolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "cishadcolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "cishadcolor", 0, "Circle Shadow Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "cishadcolor", 0, "1. 1. 1. 0.2");
	
	CLASS_ATTR_RGBA					(c, "cicolorin", 0, t_space, f_color_circleInner);
	CLASS_ATTR_CATEGORY				(c, "cicolorin", 0, "Color");
	CLASS_ATTR_STYLE_LABEL			(c, "cicolorin", 0, "rgba", "Circle Inner Color");
	CLASS_ATTR_DEFAULTNAME_SAVE		(c, "cicolorin", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA					(c, "borderboxcolor", 0, t_space, f_color_border_box);
	CLASS_ATTR_CATEGORY				(c, "borderboxcolor", 0, "Color");
	CLASS_ATTR_STYLE_LABEL			(c, "borderboxcolor", 0, "rgba", "Border Box Color");
	CLASS_ATTR_DEFAULTNAME_SAVE		(c, "borderboxcolor", 0, "0.5 0.5 0.5 1.");
	
	CLASS_ATTR_ORDER				(c, "bgcolor", 0, "1");
	CLASS_ATTR_ORDER				(c, "borderboxcolor", 0, "2");
	CLASS_ATTR_ORDER				(c, "cicolor", 0, "3");
	CLASS_ATTR_ORDER				(c, "cicolorin", 0, "4");
	CLASS_ATTR_ORDER				(c, "cishadcolor", 0, "5");
	CLASS_ATTR_ORDER				(c, "harmocolor", 0, "6");
	CLASS_ATTR_ORDER				(c, "miccolor", 0, "7");
	
	class_register(CLASS_BOX, c);
	space_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Esempio n. 30
0
int C74_EXPORT main(void)
{
	t_class *c;
    
	c = class_new("hoa.meter3D~", (method)hoa_meter_new, (method)hoa_meter_free, sizeof(t_hoa_meter), 0L, A_GIMME, 0);
    
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
    class_dspinitjbox(c);
    jucebox_initclass(c, (method)hoa_meter_paint,  JBOX_COLOR | JBOX_FIXWIDTH);
    hoa_initclass(c, (method)hoa_getinfos);
    
	class_addmethod(c, (method)hoa_meter_dsp64,				"dsp64",            A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_mousedown,			"mousedown",        A_CANT, 0);
    class_addmethod(c, (method)hoa_meter_mousedrag,			"mousedrag",        A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_assist,			"assist",           A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_getdrawparams,		"getdrawparams",    A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_notify,			"notify",           A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_setLoudspeakers,   "lscoord",    A_GIMME, 0);
    
    CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 200 200");
    CLASS_ATTR_INVISIBLE            (c, "color", 0);
    
    CLASS_ATTR_LONG                 (c, "loudspeakers", 0, t_hoa_meter, f_number_of_loudspeakers);
    CLASS_ATTR_ACCESSORS            (c, "loudspeakers", NULL,  hoa_meter_attr_set_loudspeakers);
	CLASS_ATTR_CATEGORY             (c, "loudspeakers", 0, "Planewaves");
	CLASS_ATTR_ORDER                (c, "loudspeakers", 0, "1");
	CLASS_ATTR_LABEL                (c, "loudspeakers", 0, "Number Of Loudspeakers");
	CLASS_ATTR_FILTER_MIN           (c, "loudspeakers", 1);
	CLASS_ATTR_DEFAULT              (c, "loudspeakers", 0, "8");
	CLASS_ATTR_SAVE                 (c, "loudspeakers", 1);
    CLASS_ATTR_PAINT                (c, "loudspeakers", 1);
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_meter, f_interval);
	CLASS_ATTR_CATEGORY             (c, "interval", 0, "Behavior");
	CLASS_ATTR_ORDER                (c, "interval", 0, "1");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
	CLASS_ATTR_DEFAULT              (c, "interval", 0, "100");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_hoa_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.9 0.9 0.9 1.");
	
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_hoa_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, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.1 0.1 0.1 1.");
	
    CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_hoa_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_hoa_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_hoa_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_hoa_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_hoa_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_DOUBLE_ARRAY         (c, "camera", 0, t_hoa_meter, f_camera, 2);
	CLASS_ATTR_CATEGORY             (c, "camera", 0, "Rendering Context");
    CLASS_ATTR_ORDER                (c, "camera", 0, "1");
	CLASS_ATTR_LABEL                (c, "camera", 0, "Camera");
	CLASS_ATTR_DEFAULT_SAVE         (c, "camera", 0, "0. 0.");
	CLASS_ATTR_ACCESSORS            (c, "camera", NULL, hoa_meter_attr_set_camera);
    CLASS_ATTR_PAINT                (c, "camera", 1);
    
	class_register(CLASS_BOX, c);
	hoa_meter_class = c;
    
	return 0;
}