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; }
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; }
TTErr wrapTTClassAsPdClass(TTSymbol ttblueClassName, const char* pdClassName, WrappedClassPtr* c, WrappedClassOptionsPtr options) { TTObject o(ttblueClassName, 1); // Create a temporary instance of the class so that we can query it. TTValue v; WrappedClass* wrappedPdClass = NULL; TTSymbol name; TTCString nameCString = NULL; t_symbol* namePdSymbol = NULL; TTUInt32 nameSize = 0; TTDSPInit(); wrappedPdClass = new WrappedClass; wrappedPdClass->pdClassName = gensym((char*)pdClassName); wrappedPdClass->pdClass = eclass_new( (char*)pdClassName, (method)wrappedClass_new, (method)wrappedClass_free, sizeof(WrappedInstance), CLASS_NOINLET, A_GIMME, 0); wrappedPdClass->ttblueClassName = ttblueClassName; wrappedPdClass->validityCheck = NULL; wrappedPdClass->validityCheckArgument = NULL; wrappedPdClass->options = options; if (!o.valid()) { error("Jamoma ClassWrapper failed to load %s", ttblueClassName.c_str()); return kTTErrAllocFailed; } o.messages(v); for (TTUInt16 i=0; i<v.size(); i++) { name = v[i]; //nameSize = name->getString().length(); // TODO -- this crash on Windows... nameSize = strlen(name.c_str()); nameCString = new char[nameSize+1]; strncpy(nameCString, name.c_str(), nameSize+1); namePdSymbol = gensym(nameCString); wrappedPdClass->pdNamesToTTNames[namePdSymbol->s_name] = (t_object*)name.rawpointer(); eclass_addmethod((t_eclass*)wrappedPdClass->pdClass, (method)wrappedClass_anything, nameCString, A_GIMME, 0); delete[] nameCString; nameCString = NULL; } o.attributes(v); for (TTUInt16 i=0; i<v.size(); i++) { TTAttributePtr attr = NULL; name = v[i]; //nameSize = name->getString().length(); // TODO -- this crash on Windows... nameSize = strlen(name.c_str()); nameCString = new char[nameSize+1]; strncpy(nameCString, name.c_str(), nameSize+1); namePdSymbol = gensym(nameCString); if (name == TT("maxNumChannels")) continue; // don't expose these attributes to Pd users if (name == TT("bypass")) { if (wrappedPdClass->options && !wrappedPdClass->options->lookup(TT("generator"), v)) continue; // generators don't have inputs, and so don't really provide a bypass } o.instance()->findAttribute(name, &attr); wrappedPdClass->pdNamesToTTNames[namePdSymbol->s_name] = (t_object*)name.rawpointer(); if (attr->type == kTypeFloat32) CLASS_ATTR_FLOAT(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr); else if (attr->type == kTypeFloat64) CLASS_ATTR_DOUBLE(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr); else if (attr->type == kTypeSymbol || attr->type == kTypeString) CLASS_ATTR_SYMBOL(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr); else CLASS_ATTR_LONG(wrappedPdClass->pdClass,nameCString,0,t_eclass,c_attr); //class_addattr(wrappedPdClass->pdClass, attr_offset_new(nameCString, pdType, 0, (method)wrappedClass_attrGet, (method)wrappedClass_attrSet, 0)); /* // Add display styles for the Max 5 inspector if (attr->type == kTypeBoolean) CLASS_ATTR_STYLE(wrappedPdClass->pdClass, (char*)name.c_str(), 0, (char*)"onoff"); if (name == TT("fontFace")) CLASS_ATTR_STYLE(wrappedPdClass->pdClass, (char*)"fontFace", 0, (char*)"font"); */ delete[] nameCString; nameCString = NULL; } eclass_addmethod(wrappedPdClass->pdClass, (method)wrappedClass_dsp64, "dsp64", A_CANT, 0L); eclass_addmethod(wrappedPdClass->pdClass, (method)object_obex_dumpout, "dumpout", A_CANT, 0); eclass_addmethod(wrappedPdClass->pdClass, (method)wrappedClass_assist, "assist", A_CANT, 0L); // eclass_addmethod(wrappedPdClass->pdClass, (method)stdinletinfo, "inletinfo", A_CANT, 0); eclass_dspinit(wrappedPdClass->pdClass); eclass_register(CLASS_BOX, wrappedPdClass->pdClass); if (c) *c = wrappedPdClass; wrappedPdClasses[wrappedPdClass->pdClassName->s_name] = (t_object*)wrappedPdClass; return kTTErrNone; }
extern "C" void setup_c0x2ebreakpoints(void) { t_eclass *c; c = eclass_new("c.breakpoints", (method)breakpoints_new, (method)breakpoints_free, (short)sizeof(t_breakpoints), 0L, A_GIMME, 0); eclass_init(c, 0); cream_initclass(c); eclass_addmethod(c, (method) breakpoints_assist, "assist", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_paint, "paint", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_notify, "notify", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_getdrawparams, "getdrawparams", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_oksize, "oksize", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_float, "float", A_FLOAT,0); eclass_addmethod(c, (method) breakpoints_bang, "bang", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_next, "next", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_prev, "prev", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_getlist, "getlist", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_add, "add", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_move, "move", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_remove, "remove", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_erase, "erase", A_NULL,0); eclass_addmethod(c, (method) breakpoints_function, "function", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_scaleabs, "scaleabs", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_scaleord, "scaleord", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_mousedown, "mousedown", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_mousemove, "mousemove", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_mousedrag, "mousedrag", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_mouseleave, "mouseleave", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_mouseup, "mouseup", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_preset, "preset", A_NULL, 0); eclass_addmethod(c, (method) breakpoints_read, "read", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_write, "write", A_GIMME,0); eclass_addmethod(c, (method) breakpoints_save, "save", A_NULL, 0); CLASS_ATTR_INVISIBLE (c, "send", 1); CLASS_ATTR_DEFAULT (c, "size", 0, "150. 100."); CLASS_ATTR_FLOAT_ARRAY (c, "absrange", 0, t_breakpoints, f_range_abscissa, 2); CLASS_ATTR_ORDER (c, "absrange", 0, "2"); CLASS_ATTR_LABEL (c, "absrange", 0, "Abscissa Range"); CLASS_ATTR_DEFAULT_SAVE_PAINT (c, "absrange", 0, "0. 1000."); CLASS_ATTR_FLOAT_ARRAY (c, "ordrange", 0, t_breakpoints, f_range_ordinate, 2); CLASS_ATTR_ORDER (c, "ordrange", 0, "2"); CLASS_ATTR_LABEL (c, "ordrange", 0, "Ordinate Range"); CLASS_ATTR_DEFAULT_SAVE_PAINT (c, "ordrange", 0, "0. 1."); CLASS_ATTR_SYMBOL (c, "outline", 0, t_breakpoints, f_outline); CLASS_ATTR_ORDER (c, "outline", 0, "2"); CLASS_ATTR_LABEL (c, "outline", 0, "Outline"); CLASS_ATTR_DEFAULT_SAVE_PAINT (c, "outline", 0, "Linear"); CLASS_ATTR_ITEMS (c, "outline", 0, "Linear Cosine Cubic"); CLASS_ATTR_STYLE (c, "outline", 0, "menu"); CLASS_ATTR_RGBA (c, "bgcolor", 0, t_breakpoints, 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_breakpoints, 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, "ptcolor", 0, t_breakpoints, f_color_point); CLASS_ATTR_LABEL (c, "ptcolor", 0, "Point Color"); CLASS_ATTR_ORDER (c, "ptcolor", 0, "3"); CLASS_ATTR_DEFAULT_SAVE_PAINT (c, "ptcolor", 0, "0.5 0.5 0.5 1."); CLASS_ATTR_STYLE (c, "ptcolor", 0, "color"); CLASS_ATTR_RGBA (c, "licolor", 0, t_breakpoints, f_color_line); CLASS_ATTR_LABEL (c, "licolor", 0, "Line Color"); CLASS_ATTR_ORDER (c, "licolor", 0, "4"); CLASS_ATTR_DEFAULT_SAVE_PAINT (c, "licolor", 0, "0. 0. 0. 1."); CLASS_ATTR_STYLE (c, "licolor", 0, "color"); CLASS_ATTR_RGBA (c, "textcolor", 0, t_breakpoints, 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); breakpoints_class = c; }