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; }
int main(void){ t_class *c = class_new("resdisplay", (method)rd_new, (method)rd_free, sizeof(t_rd), 0L, A_GIMME, 0); c->c_flags |= CLASS_FLAG_NEWDICTIONARY; jbox_initclass(c, JBOX_FIXWIDTH | JBOX_COLOR | JBOX_FONTATTR); class_addmethod(c, (method)rd_paint, "paint", A_CANT, 0); class_addmethod(c, (method)rd_bang, "bang", 0); class_addmethod(c, (method)rd_int, "int", A_LONG, 0); class_addmethod(c, (method)rd_float, "float", A_FLOAT, 0); class_addmethod(c, (method)rd_sinusoids, "sinusoids", A_GIMME, 0); class_addmethod(c, (method)rd_list, "list", A_GIMME, 0); class_addmethod(c, (method)rd_assist, "assist", A_CANT, 0); class_addmethod(c, (method)rd_clear, "clear", 0); class_addmethod(c, (method)rd_displayrange, "displayrange", A_FLOAT, A_FLOAT, 0); class_addmethod(c, (method)rd_mousedown, "mousedown", A_CANT, 0); class_addmethod(c, (method)rd_mousedrag, "mousedrag", A_CANT, 0); class_addmethod(c, (method)rd_notify, "notify", A_CANT, 0); CLASS_STICKY_ATTR(c, "category", 0, "Color"); CLASS_ATTR_RGBA(c, "bgcolor", 0, t_rd, bgcolor); CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "bgcolor", 0, "1. 1. 1. 1."); CLASS_ATTR_STYLE_LABEL(c, "bgcolor", 0, "rgba", "Background Color"); CLASS_ATTR_RGBA(c, "datacolor", 0, t_rd, datacolor); CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "datacolor", 0, "0. 0. 0. 1."); CLASS_ATTR_STYLE_LABEL(c, "datacolor", 0, "rgba", "Data Color"); CLASS_ATTR_RGBA(c, "selectioncolor", 0, t_rd, selectioncolor); CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "selectioncolor", 0, "0. 0. 1. 1."); CLASS_ATTR_STYLE_LABEL(c, "selectioncolor", 0, "rgba", "Selection Color"); CLASS_ATTR_RGBA(c, "bordercolor", 0, t_rd, bordercolor); CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "bordercolor", 0, "0. 0. 0. 1."); CLASS_ATTR_STYLE_LABEL(c, "bordercolor", 0, "rgba", "Border Color"); CLASS_STICKY_ATTR_CLEAR(c, "category"); CLASS_ATTR_DOUBLE(c, "freqmin", 0, t_rd, freqmin); CLASS_ATTR_DEFAULTNAME_SAVE(c, "freqmin", 0, "0.0"); CLASS_ATTR_DOUBLE(c, "freqmax", 0, t_rd, freqmax); CLASS_ATTR_DEFAULTNAME_SAVE(c, "freqmax", 0, "22050."); CLASS_ATTR_DOUBLE(c, "ampmin", 0, t_rd, ampmin); CLASS_ATTR_DEFAULTNAME_SAVE(c, "ampmin", 0, "0.0"); CLASS_ATTR_DOUBLE(c, "ampmax", 0, t_rd, ampmax); CLASS_ATTR_DEFAULTNAME_SAVE(c, "ampmax", 0, "1.0"); CLASS_ATTR_DOUBLE(c, "ampmin_log", 0, t_rd, ampmin_log); CLASS_ATTR_DEFAULTNAME_SAVE(c, "ampmin_log", 0, "-100."); CLASS_ATTR_DOUBLE(c, "ampmax_log", 0, t_rd, ampmax_log); CLASS_ATTR_DEFAULTNAME_SAVE(c, "ampmax_log", 0, "0.0"); CLASS_ATTR_LONG(c, "mode", 0, t_rd, mode); CLASS_ATTR_PAINT(c, "mode", 0); CLASS_ATTR_LONG(c, "log", 0, t_rd, log); CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "log", 0, "1"); CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0. 0. 300. 100."); class_register(CLASS_BOX, c); rd_class = c; common_symbols_init(); version_post_copyright(); return 0; }