Jamoma API  0.6.0.a19
PureDataAudioGraph.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup audioGraphMax
4  *
5  * @brief A thin wrapper of Jamoma AudioGraph for use in the Cycling '74 Max/MSP environment.
6  *
7  * @details Includes an automated class wrapper to make Jamoma DSP object's available as objects for Max/MSP.
8  *
9  * @authors Timothy Place, Trond Lossius
10  *
11  * @copyright Copyright © 2008, Timothy Place @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #include "maxAudioGraph.h"
18 #include "ext_hashtab.h"
19 
20 using namespace std;
21 
22 #define MAX_NUM_INLETS 32
23 #define MAX_NUM_OUTLETS 32
24 
25 // Data Structure for this object
26 typedef struct _wrappedInstance {
27  t_object obj; ///< Max audio object header
28  TTAudioGraphObjectBasePtr audioGraphObject; ///< The DSP instance we are wrapping -- MUST BE 2nd!
29  TTPtr audioGraphOutlets[MAX_NUM_OUTLETS]; ///< Array of outlets, may eventually want this to be more dynamic
30  TTPtr inlets[MAX_NUM_INLETS]; ///< Array of proxy inlets beyond the first inlet
31  MaxAudioGraphWrappedClassPtr wrappedClassDefinition; ///< A pointer to the class definition
32  TTUInt8 numInputs;
33  TTUInt8 numOutputs;
34 } WrappedInstance;
35 
36 typedef WrappedInstance* WrappedInstancePtr; ///< Pointer to a wrapped instance of our object.
37 
38 
39 /** A hash of all wrapped clases, keyed on the Max class name. */
40 static t_hashtab* wrappedMaxClasses = NULL;
41 
42 
43 t_object* MaxAudioGraphWrappedClass_new(t_symbol* name, long argc, t_atom* argv)
44 {
45  MaxAudioGraphWrappedClassPtr wrappedMaxClass = NULL;
46  WrappedInstancePtr self = NULL;
47  TTValue v;
48  TTErr err = kTTErrNone;
49 
50  long attrstart = attr_args_offset(argc, argv); // support normal arguments
51 
52  // Find the WrappedClass
53  hashtab_lookup(wrappedMaxClasses, name, (t_object**)&wrappedMaxClass);
54 
55  // If the WrappedClass has a validity check defined, then call the validity check function.
56  // If it returns an error, then we won't instantiate the object.
57  if (wrappedMaxClass) {
58  if (wrappedMaxClass->validityCheck)
59  err = wrappedMaxClass->validityCheck(wrappedMaxClass->validityCheckArgument);
60  else
61  err = kTTErrNone;
62  }
63  else
64  err = kTTErrGeneric;
65 
66  if (!err)
67  self = (WrappedInstancePtr)object_alloc(wrappedMaxClass->maxClass);
68  if (self) {
69  self->numInputs = 1;
70  self->numOutputs = 1;
71  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("argumentDefinesNumInlets"), v)) {
72  int argumentOffsetToDefineTheNumberOfInlets = v;
73  if ((attrstart-argumentOffsetToDefineTheNumberOfInlets > 0) && argv+argumentOffsetToDefineTheNumberOfInlets)
74  self->numInputs = atom_getlong(argv+argumentOffsetToDefineTheNumberOfInlets);
75  }
76  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("wrapperDefinesNumInlets"), v)) {
77  int wrapperDefinedNumberOfInlets = v;
78  if (wrapperDefinedNumberOfInlets > 0)
79  self->numInputs = wrapperDefinedNumberOfInlets;
80  }
81  // make sure that numInputs is not too large
82  self->numInputs = min(self->numInputs, (TTUInt8)MAX_NUM_INLETS);
83 
84  for (TTUInt16 i=self->numInputs-1; i>0; i--)
85  self->inlets[i-1] = proxy_new(self, i, NULL);
86 
87  object_obex_store((void*)self, _sym_dumpout, (object*)outlet_new(self, NULL)); // dumpout
88  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("argumentDefinesNumOutlets"), v)) {
89  int argumentOffsetToDefineTheNumberOfOutlets = v;
90  if ((attrstart-argumentOffsetToDefineTheNumberOfOutlets > 0) && argv+argumentOffsetToDefineTheNumberOfOutlets)
91  self->numOutputs = atom_getlong(argv+argumentOffsetToDefineTheNumberOfOutlets);
92  }
93  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("wrapperDefinesNumOutlets"), v)) {
94  int wrapperDefinedNumberOfOutlets = v;
95  if (wrapperDefinedNumberOfOutlets > 0)
96  self->numOutputs = wrapperDefinedNumberOfOutlets;
97  }
98  // make sure that numOutputs is not too large
99  self->numOutputs = min(self->numOutputs, (TTUInt8)MAX_NUM_OUTLETS);
100 
101  for (TTInt16 i=self->numOutputs-1; i>=0; i--)
102  self->audioGraphOutlets[i] = outlet_new(self, "audio.connect");
103 
104 
105  self->wrappedClassDefinition = wrappedMaxClass;
106  v.resize(3);
107  v[0] = wrappedMaxClass->ttClassName;
108  v[1] = self->numInputs;
109  v[2] = self->numOutputs;
110  err = TTObjectBaseInstantiate(TT("audio.object"), (TTObjectBasePtr*)&self->audioGraphObject, v);
111  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("generator"), v))
112  self->audioGraphObject->addAudioFlag(kTTAudioGraphGenerator);
113  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("nonadapting"), v))
114  self->audioGraphObject->addAudioFlag(kTTAudioGraphNonAdapting);
115  attr_args_process(self, argc, argv);
116  }
117  return (t_object*)self;
118 }
119 
120 
121 void MaxAudioGraphWrappedClass_free(WrappedInstancePtr self)
122 {
123  if (self->audioGraphObject)
124  TTObjectBaseRelease((TTObjectBasePtr*)&self->audioGraphObject);
125 
126  for (int i=0; i<MAX_NUM_INLETS; i++) {
127  if (self->inlets[i])
128  object_free(self->inlets[i]);
129  }
130 }
131 
132 
133 
134 // METHODS SPECIFIC TO AUDIO GRAPH EXTERNALS
135 
136 TTErr MaxAudioGraphReset(t_object* x, long vectorSize)
137 {
139  return self->audioGraphObject->resetAudio();
140 }
141 
142 
144 {
146  t_atom a[2];
147  TTUInt16 i=0;
148 
149  atom_setobj(a+0, (t_object*)self->audioGraphObject);
150  while (self->audioGraphOutlets[i]) {
151  atom_setlong(a+1, i);
152  outlet_anything(self->audioGraphOutlets[i], gensym("audio.connect"), 2, a);
153  i++;
154  }
155  return kTTErrNone;
156 }
157 
158 
159 /* A graph link has been established */
160 TTErr MaxAudioGraphConnect(t_object* x, TTAudioGraphObjectBasePtr audioSourceObject, TTUInt16 sourceOutletNumber)
161 {
163  long inletNumber = proxy_getinlet(SELF);
164 
165  return self->audioGraphObject->connectAudio(audioSourceObject, sourceOutletNumber, inletNumber);
166 }
167 
168 
169 /* A graph link has been dropped */
170 TTErr MaxAudioGraphDrop(t_object* x, long inletNumber, t_object* sourceMaxObject, long sourceOutletNumber)
171 {
173  TTAudioGraphObjectBasePtr sourceObject = NULL;
174  TTErr err;
175 
176  err = (TTErr)long(object_method(sourceMaxObject, gensym("audio.object"), &sourceObject));
177  if (self->audioGraphObject && sourceObject && !err)
178  err = self->audioGraphObject->dropAudio(sourceObject, sourceOutletNumber, inletNumber);
179  return err;
180 }
181 
182 
183 TTErr MaxAudioGraphObject(t_object* x, TTAudioGraphObjectBasePtr* returnedAudioGraphObject)
184 {
186 
187  *returnedAudioGraphObject = self->audioGraphObject;
188  return kTTErrNone;
189 }
190 
191 
192 /* The attribute getter */
193 t_max_err MaxAudioGraphWrappedClass_attrGet(WrappedInstancePtr self, t_object* attr, long* argc, t_atom** argv)
194 {
195  t_symbol* attrName = (t_symbol*)object_method(attr, _sym_getname);
196  TTValue v;
197  long i;
198 
199  TTSymbol ttAttrName(attrName->s_name);
200 
201  self->audioGraphObject->getUnitGenerator().get(ttAttrName, v);
202 
203  *argc = v.size();
204  if (!(*argv)) // otherwise use memory passed in
205  *argv = (t_atom *)sysmem_newptr(sizeof(t_atom) * v.size());
206 
207  for (i=0; i<v.size(); i++) {
208  if (v[i].type() == kTypeFloat32 || v[i].type() == kTypeFloat64) {
209  TTFloat64 value = v[i];
210  atom_setfloat(*argv+i, value);
211  }
212  else if (v[i].type() == kTypeSymbol) {
213  TTSymbol value = v[i];
214  atom_setsym(*argv+i, gensym((char*)value.c_str()));
215  }
216  else { // assume int
217  TTInt32 value = v[i];
218  atom_setlong(*argv+i, value);
219  }
220  }
221  return MAX_ERR_NONE;
222 }
223 
224 
225 /* The attribute setter */
226 t_max_err MaxAudioGraphWrappedClass_attrSet(WrappedInstancePtr self, t_object* attr, long argc, t_atom* argv)
227 {
228  if (argc && argv) {
229  t_symbol* attrName = (t_symbol*)object_method(attr, _sym_getname);
230  TTValue v;
231  long i;
232 
233  TTSymbol ttAttrName(attrName->s_name);
234 
235  v.resize(argc);
236  for (i=0; i<argc; i++) {
237  if (atom_gettype(argv+i) == A_LONG)
238  v[i] = (TTInt32)atom_getlong(argv+i);
239  else if (atom_gettype(argv+i) == A_FLOAT)
240  v[i] = atom_getfloat(argv+i);
241  else if (atom_gettype(argv+i) == A_SYM)
242  v[i] = TT(atom_getsym(argv+i)->s_name);
243  else
244  object_error(SELF, "bad type for attribute setter");
245  }
246  self->audioGraphObject->getUnitGenerator().set(ttAttrName, v);
247  return MAX_ERR_NONE;
248  }
249  return MAX_ERR_GENERIC;
250 }
251 
252 
253 /* Get number of channels of the audio graph signal */
254 t_max_err MaxAudioGraphWrappedClass_attrGetNumChannels(WrappedInstancePtr self, t_object* attr, long* argc, t_atom** argv)
255 {
256  *argc = 1;
257  if (!(*argv)) // otherwise use memory passed in
258  *argv = (t_atom*)sysmem_newptr(sizeof(t_atom));
259 
260  atom_setlong(*argv, self->audioGraphObject->getOutputNumChannels(0));
261  return MAX_ERR_NONE;
262 }
263 
264 
265 /* Set number of channels of the audio graph signal */
266 t_max_err MaxAudioGraphWrappedClass_attrSetNumChannels(WrappedInstancePtr self, t_object* attr, long argc, t_atom* argv)
267 {
268  if (argc)
269  self->audioGraphObject->setOutputNumChannels(0, atom_getlong(argv));
270  return MAX_ERR_NONE;
271 }
272 
273 
274 /* Method for "anything" messages */
275 void MaxAudioGraphWrappedClass_anything(WrappedInstancePtr self, t_symbol* s, long argc, t_atom* argv)
276 {
277  TTValue v_in;
278  TTValue v_out;
279  TTSymbol ttName(s->s_name);
280 
281  if (argc && argv) {
282  v_in.resize(argc);
283 
284  // Typechecking - we only want ints, floats and symbols
285  for (long i=0; i<argc; i++) {
286  if (atom_gettype(argv+i) == A_LONG)
287  v_in[i] = (TTInt32)atom_getlong(argv+i);
288  else if (atom_gettype(argv+i) == A_FLOAT)
289  v_in[i] = atom_getfloat(argv+i);
290  else if (atom_gettype(argv+i) == A_SYM)
291  v_in[i] = TT(atom_getsym(argv+i)->s_name);
292  else
293  object_error(SELF, "bad type for message arg");
294  }
295  }
296  // Now that we know that the message is OK we send it on to the wrapped class
297  self->audioGraphObject->getUnitGenerator().send(ttName, v_in, v_out);
298 
299  // process the returned value for the dumpout outlet
300  {
301  long ac = v_out.size();
302 
303  if (ac) {
304  t_atom* av = (t_atom*)malloc(sizeof(t_atom) * ac);
305 
306  for (long i=0; i<ac; i++) {
307  if (v_out[0].type() == kTypeSymbol) {
308  TTSymbol ttSym = v_out[i];
309  atom_setsym(av+i, gensym((char*)ttSym.c_str()));
310  }
311  else if (v_out[0].type() == kTypeFloat32 || v_out[0].type() == kTypeFloat64) {
312  TTFloat64 f = 0.0;
313  f = v_out[i];
314  atom_setfloat(av+i, f);
315  }
316  else {
317  TTInt32 l = v_out[i];
318  atom_setfloat(av+i, l);
319  }
320  }
321  object_obex_dumpout(self, s, ac, av);
322  free(av);
323  }
324  }
325 }
326 
327 
328 // Method for Assistance Messages
329 void MaxAudioGraphWrappedClass_assist(WrappedInstancePtr self, void *b, long msg, long arg, char *dst)
330 {
331  if (msg==1) { // Inlets
332  if (arg == 0)
333  strcpy(dst, "multichannel input and control messages");
334  else if (arg > 0)
335  snprintf(dst, 256, "multichannel input %ld", arg+1);
336  }
337 
338  else if (msg==2) {// Outlets
339  if (arg == self->numOutputs)
340  strcpy(dst, "dumpout");
341  else
342  snprintf(dst, 256, "multichannel output %ld", arg+1);
343  }
344 }
345 
346 
347 
348 
349 
350 
352 {
353  return wrapAsMaxAudioGraph(ttClassName, maxClassName, c, (MaxAudioGraphWrappedClassOptionsPtr)NULL);
354 }
355 
357 {
358  TTObjectBasePtr o = NULL;
359  TTValue v;
360  TTUInt16 numChannels = 1;
361  MaxAudioGraphWrappedClassPtr wrappedMaxClass = NULL;
362  TTSymbol name;
363  TTCString nameCString = NULL;
364  t_symbol* nameMaxSymbol = NULL;
365  TTUInt32 nameSize = 0;
366 
367  common_symbols_init();
368  TTAudioGraphInit();
369 
370  if (!wrappedMaxClasses)
371  wrappedMaxClasses = hashtab_new(0);
372 
373  wrappedMaxClass = new MaxAudioGraphWrappedClass;
374  wrappedMaxClass->maxClassName = gensym(maxClassName);
375  wrappedMaxClass->maxClass = class_new( maxClassName,
376  (method)MaxAudioGraphWrappedClass_new,
377  (method)MaxAudioGraphWrappedClass_free,
378  sizeof(WrappedInstance),
379  (method)0L,
380  A_GIMME,
381  0);
382  wrappedMaxClass->ttClassName = ttClassName;
383  wrappedMaxClass->validityCheck = NULL;
384  wrappedMaxClass->validityCheckArgument = NULL;
385  wrappedMaxClass->options = options;
386 
387  // Create a temporary instance of the class so that we can query it.
388  TTObjectBaseInstantiate(ttClassName, &o, numChannels);
389 
390  o->getMessageNames(v);
391  for (TTUInt16 i=0; i<v.size(); i++) {
392  name = v[i];
393  nameSize = strlen(name.c_str());
394  nameCString = new char[nameSize+1];
395  strncpy_zero(nameCString, name.c_str(), nameSize+1);
396 
397  nameMaxSymbol = gensym(nameCString);
398  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphWrappedClass_anything, nameCString, A_GIMME, 0);
399 
400  delete nameCString;
401  nameCString = NULL;
402  }
403 
404  o->getAttributeNames(v);
405  for (TTUInt16 i=0; i<v.size(); i++) {
406  TTAttributePtr attr = NULL;
407  t_symbol* maxType = _sym_long;
408  TTValue isGenerator = NO;
409 
410  name = v[i];
411  nameSize = strlen(name.c_str());
412  nameCString = new char[nameSize+1];
413  strncpy_zero(nameCString, name.c_str(), nameSize+1);
414  nameMaxSymbol = gensym(nameCString);
415 
416  if (name == TT("maxNumChannels"))
417  continue; // don't expose these attributes to Max users
418  if (name == TT("bypass")) {
419  if (wrappedMaxClass->options && !wrappedMaxClass->options->lookup(TT("generator"), isGenerator))
420  continue; // generators don't have inputs, and so don't really provide a bypass
421  }
422 
423  o->findAttribute(name, &attr);
424 
425  if (attr->type == kTypeFloat32)
426  maxType = _sym_float32;
427  else if (attr->type == kTypeFloat64)
428  maxType = _sym_float64;
429  else if (attr->type == kTypeSymbol || attr->type == kTypeString)
430  maxType = _sym_symbol;
431 
432  class_addattr(wrappedMaxClass->maxClass, attr_offset_new(nameCString, maxType, 0, (method)MaxAudioGraphWrappedClass_attrGet, (method)MaxAudioGraphWrappedClass_attrSet, 0));
433 
434  // Add display styles for the Max 5 inspector
435  if (attr->type == kTypeBoolean)
436  CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)name.c_str(), 0, (char*)"onoff");
437  if (name == TT("fontFace"))
438  CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)"fontFace", 0, (char*)"font");
439 
440  delete nameCString;
441  nameCString = NULL;
442  }
443 
445 
446  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphReset, "audio.reset", A_CANT, 0);
447  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphSetup, "audio.setup", A_CANT, 0);
448  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphConnect, "audio.connect", A_OBJ, A_LONG, 0);
449  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphDrop, "audio.drop", A_CANT, 0);
450  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphObject, "audio.object", A_CANT, 0);
451  class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphConnect, "graph.connect", A_OBJ, A_LONG, 0);
452  class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphDrop, "graph.drop", A_CANT, 0);
453  class_addmethod(wrappedMaxClass->maxClass, (method)MaxGraphObject, "graph.object", A_CANT, 0);
454  class_addmethod(wrappedMaxClass->maxClass, (method)object_obex_dumpout, "dumpout", A_CANT, 0);
455  class_addmethod(wrappedMaxClass->maxClass, (method)MaxAudioGraphWrappedClass_assist, "assist", A_CANT, 0L);
456  class_addmethod(wrappedMaxClass->maxClass, (method)stdinletinfo, "inletinfo", A_CANT, 0);
457 
458 
459  if (wrappedMaxClass->options) {
460  TTValue userCanSetNumChannels = NO;
461  TTErr err = wrappedMaxClass->options->lookup(TT("userCanSetNumChannels"), userCanSetNumChannels);
462 
463  if (!err && userCanSetNumChannels == TTValue(YES))
464  class_addattr(wrappedMaxClass->maxClass, attr_offset_new("numChannels", _sym_long, 0,
465  (method)MaxAudioGraphWrappedClass_attrGetNumChannels,
466  (method)MaxAudioGraphWrappedClass_attrSetNumChannels,
467  0));
468  }
469 
470  class_register(_sym_box, wrappedMaxClass->maxClass);
471  if (c)
472  *c = wrappedMaxClass;
473 
474  hashtab_store(wrappedMaxClasses, wrappedMaxClass->maxClassName, (t_object*)wrappedMaxClass);
475  return kTTErrNone;
476 }
477 
478 
479 TTErr wrapAsMaxAudioGraph(TTSymbol ttClassName, char* maxClassName, MaxAudioGraphWrappedClassPtr* c, TTValidityCheckFunction validityCheck)
480 {
481  TTErr err = wrapAsMaxAudioGraph(ttClassName, maxClassName, c);
482 
483  if (!err) {
484  (*c)->validityCheck = validityCheck;
485  (*c)->validityCheckArgument = (*c)->maxClass;
486  }
487  return err;
488 }
489 
491 {
492  TTErr err = wrapAsMaxAudioGraph(ttClassName, maxClassName, c, options);
493 
494  if (!err) {
495  (*c)->validityCheck = validityCheck;
496  (*c)->validityCheckArgument = (*c)->maxClass;
497  }
498  return err;
499 }
500 
501 
502 TTErr wrapAsMaxAudioGraph(TTSymbol ttClassName, char* maxClassName, MaxAudioGraphWrappedClassPtr* c, TTValidityCheckFunction validityCheck, TTPtr validityCheckArgument)
503 {
504  TTErr err = wrapAsMaxAudioGraph(ttClassName, maxClassName, c);
505 
506  if (!err) {
507  (*c)->validityCheck = validityCheck;
508  (*c)->validityCheckArgument = validityCheckArgument;
509  }
510  return err;
511 }
512 
513 TTErr wrapAsMaxAudioGraph(TTSymbol ttClassName, char* maxClassName, MaxAudioGraphWrappedClassPtr* c, TTValidityCheckFunction validityCheck, TTPtr validityCheckArgument, MaxAudioGraphWrappedClassOptionsPtr options)
514 {
515  TTErr err = wrapAsMaxAudioGraph(ttClassName, maxClassName, c, options);
516 
517  if (!err) {
518  (*c)->validityCheck = validityCheck;
519  (*c)->validityCheckArgument = validityCheckArgument;
520  }
521  return err;
522 }
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
TTErr MaxAudioGraphDrop(t_object *x, long inletNumber, t_object *sourceMaxObject, long sourceOutletNumber)
Method called when a connection from an upstream node is dropped.
TTErr TTObjectBaseRelease(TTObjectBasePtr *anObject)
DEPRECATED.
TTErr lookup(const TTSymbol &optionName, TTValue &optionValue)
Loopup the value of an option.
Definition: MaxAudioGraph.h:94
TTDataType type
The data type of the attribute value.
Definition: TTAttribute.h:84
TTErr MaxAudioGraphConnect(t_object *x, TTAudioGraphObjectBasePtr audioSourceObject, TTUInt16 sourceOutletNumber)
Method called when an upstream node is connected to this node.
TTErr wrapAsMaxAudioGraph(TTSymbol ttClassName, char *maxClassName, MaxAudioGraphWrappedClassPtr *c)
Wrap an AudioGraph class as a Max class.
WrappedInstance * WrappedInstancePtr
Pointer to a wrapped instance of our object.
size_type size() const noexcept
Return the number of elements.
STL namespace.
TTErr MaxAudioGraphObject(t_object *x, TTAudioGraphObjectBasePtr *returnedAudioGraphObject)
Returns a pointer to the Jamoma Audio Graph object that is wrapped by this Max object.
This class represents a single attribute, as used by the TTObjectBase class.
Definition: TTAttribute.h:79
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
This object is an audio generator, and do not expect audio input.
Definition: TTAudioGraph.h:73
t_symbol * maxClassName
The name to give the Max class.
Definition: MaxAudioGraph.h:46
Symbol type.
Definition: TTBase.h:282
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
MaxAudioGraphWrappedClassOptions * options
Additional configuration options specified for the class.
Definition: MaxAudioGraph.h:50
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
Definition: TTSymbol.h:155
WrappedInstance * WrappedInstancePtr
Pointer to a wrapped instance of our object.
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
std::int16_t TTInt16
16 bit signed integer
Definition: TTBase.h:175
A class representing the options of a MaxAudioGraphWrappedClass.
Definition: MaxAudioGraph.h:56
t_class * maxClass
The Max class pointer.
Definition: MaxAudioGraph.h:45
Type definition for an AudioGraph class wrapped as a Max external.
Definition: MaxAudioGraph.h:44
TTErr(* TTValidityCheckFunction)(const TTPtr data)
A type that can be used to store a pointer to a validity checking function.
Definition: MaxAudioGraph.h:36
64-bit floating point
Definition: TTBase.h:272
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
void getMessageNames(TTValue &messageNameList)
Return a list of names of the available messages.
This object does not adapt its number of output channels to the number of input channels.
Definition: TTAudioGraph.h:74
TTErr TTObjectBaseInstantiate(const TTSymbol className, TTObjectBasePtr *returnedObjectPtr, const TTValue arguments)
DEPRECATED.
TTErr MaxAudioGraphReset(t_object *x, long vectorSize)
Clear the list of source objects from which this object will try to pull audio.
Boolean (1/0) or (true/false) flag.
Definition: TTBase.h:281
const char * c_str() const
Return a pointer to the internal string as a C-string.
Definition: TTSymbol.h:77
std::int32_t TTInt32
32 bit signed integer
Definition: TTBase.h:177
A thin wrapper of Jamoma AudioGraph for use in the Cycling '74 Max/MSP environment.
TTErr MaxAudioGraphSetup(t_object *x)
Set up fresh connections from this object to nodes that are connected downstream. ...
32-bit floating point
Definition: TTBase.h:271
TTPtr validityCheckArgument
An argument to pass to the validityCheck function when it is called.
Definition: MaxAudioGraph.h:49
Something went wrong, but what exactly is not known. Typically used for context-specific problems...
Definition: TTBase.h:344
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
The TTAudioGraphObjectBase wraps a TTDSP object such that it is possible to build a dynamic graph of ...
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
No Error.
Definition: TTBase.h:343
String type.
Definition: TTBase.h:285
TTValidityCheckFunction validityCheck
A function to call to validate the context for an object before it is instantiated.
Definition: MaxAudioGraph.h:48
void resize(size_type n)
Change the number of elements.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void getAttributeNames(TTValue &attributeNameList)
Return a list of names of the available attributes.
TTSymbol ttClassName
The name of the class as registered with the Jamoma framework.
Definition: MaxAudioGraph.h:47
TTErr findAttribute(const TTSymbol name, TTAttribute **attr)
Find an attribute.
unsigned char TTUInt8
8 bit unsigned integer (char)
Definition: TTBase.h:174