int TTGRAPH_EXTERNAL_EXPORT main(void) { ClassPtr c; TTGraphInit(); common_symbols_init(); c = class_new("jcom.midi.out#", (method)MidiOutNew, (method)MidiOutFree, sizeof(MidiOut), (method)0L, A_GIMME, 0); class_addmethod(c, (method)MidiOutGetDeviceNames, "getAvailableDeviceNames", 0); class_addmethod(c, (method)MaxGraphReset, "graph.reset", A_CANT, 0); class_addmethod(c, (method)MaxGraphSetup, "graph.setup", A_CANT, 0); class_addmethod(c, (method)MaxGraphConnect, "graph.connect", A_OBJ, A_LONG, 0); class_addmethod(c, (method)MaxGraphDrop, "graph.drop", A_CANT, 0); class_addmethod(c, (method)MaxGraphObject, "graph.object", A_CANT, 0); class_addmethod(c, (method)MidiOutAssist, "assist", A_CANT, 0); class_addmethod(c, (method)object_obex_dumpout, "dumpout", A_CANT, 0); CLASS_ATTR_SYM(c, "device", 0, MidiOut, obj); CLASS_ATTR_ACCESSORS(c, "device", MidiOutGetDevice, MidiOutSetDevice); class_register(_sym_box, c); sMidiOutClass = c; return 0; }
int main(void) { ClassPtr c; TTGraphInit(); common_symbols_init(); c = class_new("jcom.pack!", (method)PackNew, (method)PackFree, sizeof(Pack), (method)0L, A_GIMME, 0); class_addmethod(c, (method)PackInt, "int", A_LONG, 0); class_addmethod(c, (method)PackFloat, "float", A_LONG, 0); class_addmethod(c, (method)PackList, "list", A_GIMME, 0); class_addmethod(c, (method)PackAnything, "anything", A_GIMME, 0); class_addmethod(c, (method)MaxGraphReset, "graph.reset", A_CANT, 0); class_addmethod(c, (method)MaxGraphSetup, "graph.setup", A_CANT, 0); class_addmethod(c, (method)MaxGraphDrop, "graph.drop", A_CANT, 0); class_addmethod(c, (method)MaxGraphObject, "graph.object", A_CANT, 0); class_addmethod(c, (method)PackNotify, "notify", A_CANT, 0); class_addmethod(c, (method)PackAssist, "assist", A_CANT, 0); class_addmethod(c, (method)object_obex_dumpout, "dumpout", A_CANT, 0); class_register(_sym_box, c); sPackClass = c; return 0; }
int C74_EXPORT main(void) { t_class* c; TTGraphInit(); common_symbols_init(); c = class_new("j.append-", (method)AppendNew, (method)AppendFree, sizeof(Append), (method)0L, A_GIMME, 0); class_addmethod(c, (method)MaxGraphReset, "graph.reset", A_CANT, 0); class_addmethod(c, (method)MaxGraphSetup, "graph.setup", A_CANT, 0); class_addmethod(c, (method)MaxGraphConnect, "graph.connect", A_OBJ, A_LONG, 0); class_addmethod(c, (method)MaxGraphDrop, "graph.drop", A_CANT, 0); class_addmethod(c, (method)MaxGraphObject, "graph.object", A_CANT, 0); class_addmethod(c, (method)AppendAssist, "assist", A_CANT, 0); class_addmethod(c, (method)object_obex_dumpout, "dumpout", A_CANT, 0); CLASS_ATTR_SYM(c, "key", 0, Append, attrKey); CLASS_ATTR_ACCESSORS(c, "key", NULL, AppendSetKey); CLASS_ATTR_FLOAT(c, "value", 0, Append, attrValue); CLASS_ATTR_ACCESSORS(c, "value", NULL, AppendSetValue); class_register(_sym_box, c); sAppendClass = c; return 0; }
extern "C" TT_EXTENSION_EXPORT TTErr TTLoadJamomaExtension_DictionaryLib(void) { TTGraphInit(); TTDictionaryAppend::registerClass(); return kTTErrNone; }
int C74_EXPORT main(void) { t_class *c; TTGraphInit(); common_symbols_init(); c = class_new("j.unpack-", (method)UnpackNew, (method)UnpackFree, sizeof(Unpack), (method)0L, A_GIMME, 0); class_addmethod(c, (method)MaxGraphReset, "graph.reset", A_CANT, 0); class_addmethod(c, (method)MaxGraphConnect, "graph.connect", A_OBJ, A_LONG, 0); class_addmethod(c, (method)MaxGraphDrop, "graph.drop", A_CANT, 0); class_addmethod(c, (method)MaxGraphObject, "graph.object", A_CANT, 0); class_addmethod(c, (method)UnpackAssist, "assist", A_CANT, 0); class_addmethod(c, (method)object_obex_dumpout, "dumpout", A_CANT, 0); class_register(_sym_box, c); sUnpackClass = c; return 0; }
TTErr wrapAsMaxGraph(TTSymbol& ttClassName, char* maxClassName, WrappedClassPtr* c, WrappedClassOptionsPtr options) { TTObjectBasePtr o = NULL; TTValue v; TTUInt16 numChannels = 1; WrappedClass* wrappedMaxClass = NULL; TTSymbol name; TTCString nameCString = NULL; t_symbol* nameMaxSymbol = NULL; TTUInt32 nameSize = 0; common_symbols_init(); TTGraphInit(); if (!wrappedMaxClasses) wrappedMaxClasses = hashtab_new(0); wrappedMaxClass = new WrappedClass; wrappedMaxClass->maxClassName = gensym(maxClassName); wrappedMaxClass->maxClass = class_new( maxClassName, (method)wrappedClass_new, (method)wrappedClass_free, sizeof(WrappedInstance), (method)0L, A_GIMME, 0); wrappedMaxClass->ttClassName = ttClassName; wrappedMaxClass->validityCheck = NULL; wrappedMaxClass->validityCheckArgument = NULL; wrappedMaxClass->options = options; wrappedMaxClass->maxNamesToTTNames = hashtab_new(0); // Create a temporary instance of the class so that we can query it. TTObjectBaseInstantiate(ttClassName, &o, numChannels); o->getMessageNames(v); for (TTUInt16 i=0; i<v.size(); i++) { name = v[i]; nameSize = strlen(name.c_str()); nameCString = new char[nameSize+1]; strncpy_zero(nameCString, name.c_str(), nameSize+1); nameMaxSymbol = gensym(nameCString); hashtab_store(wrappedMaxClass->maxNamesToTTNames, nameMaxSymbol, (t_object*)name.rawpointer()); class_addmethod(wrappedMaxClass->maxClass, (method)wrappedClass_anything, nameCString, A_GIMME, 0); delete nameCString; nameCString = NULL; } o->getAttributeNames(v); for (TTUInt16 i=0; i<v.size(); i++) { TTAttributePtr attr = NULL; t_symbol* maxType = _sym_long; name = v[i]; nameSize = strlen(name.c_str()); nameCString = new char[nameSize+1]; strncpy_zero(nameCString, name.c_str(), nameSize+1); nameMaxSymbol = gensym(nameCString); if (name == TT("MaxNumChannels")) continue; // don't expose these attributes to Max users if (name == TT("Bypass")) { if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("generator"), v)) continue; // generators don't have inputs, and so don't really provide a bypass } o->findAttribute(name, &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; hashtab_store(wrappedMaxClass->maxNamesToTTNames, nameMaxSymbol, (t_object*)name.rawpointer()); class_addattr(wrappedMaxClass->maxClass, attr_offset_new(nameCString, maxType, 0, (method)wrappedClass_attrGet, (method)wrappedClass_attrSet, 0)); // Add display styles for the Max 5 inspector if (attr->type == kTypeBoolean) CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)name.c_str(), 0, "onoff"); if (name == TT("fontFace")) CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, "fontFace", 0, "font"); delete nameCString; nameCString = NULL; } TTObjectBaseRelease(&o); class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphReset, "graph.reset", A_CANT, 0); class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphSetup, "graph.setup", A_CANT, 0); class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphConnect, "graph.connect", A_OBJ, A_LONG, 0); class_addmethod(wrappedMaxClass->maxClass, (method)object_obex_dumpout, "dumpout", A_CANT, 0); class_addmethod(wrappedMaxClass->maxClass, (method)wrappedClass_assist, "assist", A_CANT, 0L); class_addmethod(wrappedMaxClass->maxClass, (method)stdinletinfo, "inletinfo", A_CANT, 0); class_register(_sym_box, wrappedMaxClass->maxClass); if (c) *c = wrappedMaxClass; hashtab_store(wrappedMaxClasses, wrappedMaxClass->maxClassName, (t_object*)wrappedMaxClass); return kTTErrNone; }