19 t_object* jamoma_new(t_symbol *s,
long argc, t_atom* argv);
20 t_object* MaxAudioGraphWrappedClass_new(t_symbol *name,
long argc, t_atom* argv);
23 static t_class* s_jamoma_class;
24 static t_hashtab* s_jamoma_class_hash = NULL;
32 s_jamoma_class = class_new(
"j=", (method)jamoma_new, (method)NULL, 0 , (method)0L, A_GIMME, 0);
33 class_register(CLASS_BOX, s_jamoma_class);
35 common_symbols_init();
45 t_object* jamoma_new(t_symbol *s,
long argc, t_atom* argv)
47 int attrstart = attr_args_offset(argc, argv);
50 t_symbol *className = gensym(
"gain");
52 char maxClassName[256];
55 error(
"must specify a jamoma class as the first argument");
59 if (atom_gettype(argv+i) == A_LONG)
60 channelCount = atom_getlong(argv+i);
61 else if (atom_gettype(argv+i) == A_SYM)
62 className = atom_getsym(argv+i);
66 snprintf(maxClassName, 256,
"j.%s=", className->s_name);
68 if (!s_jamoma_class_hash)
69 s_jamoma_class_hash = hashtab_new(0);
70 hashtab_lookup(s_jamoma_class_hash, className, (t_object**)&classWrapper);
74 hashtab_store(s_jamoma_class_hash, className, (t_object*)(classWrapper));
77 return MaxAudioGraphWrappedClass_new(gensym(maxClassName), argc-1, argv+1);
TTErr wrapAsMaxAudioGraph(TTSymbol ttClassName, char *maxClassName, MaxAudioGraphWrappedClassPtr *c)
Wrap an AudioGraph class as a Max class.
Type definition for an AudioGraph class wrapped as a Max external.
A thin wrapper of Jamoma AudioGraph for use in the Cycling '74 Max/MSP environment.
int C74_EXPORT main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.