Jamoma API  0.6.0.a19
Max/source/j.send/j.send.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup implementationMaxExternals
4  *
5  * @brief j.send / j.send~ : Send messages and audio through remote communication
6  *
7  * @details
8  *
9  * @authors Théo de la Hogue, Trond Lossius
10  *
11  * @copyright © 2010 by Théo de la Hogue @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
18 
19 #ifdef JCOM_SEND_TILDE
20 
21 #define info_numChannels 0
22 #define info_vectorSize 1
23 
24 #endif
25 
26 // Definitions
27 
28 /** Wrap the j.send class as a Max object.
29  @param c The class to be wrapped
30  @see WrappedSenderClass_new, WrappedSenderClass_free
31  */
32 void WrapTTSenderClass(WrappedClassPtr c);
33 
34 /** Wrapper for the j.send constructor class, called when an instance is created.
35  @param self Pointer to this object.
36  @param argc The number of arguments passed to the object.
37  @param argv Pointer to an array of atoms passed to the object.
38  @see WrappedSenderClass_free, send_subscribe
39  */
40 void WrappedSenderClass_new(TTPtr self, long argc, t_atom *argv);
41 
42 /** Wrapper for the j.send deconstructor class, called when an instance is destroyed.
43  @param self Pointer to this object.
44  @see WrappedSenderClass_new
45  */
47 
48 /** Assistance Method.
49  @param self Pointer to this object.
50  @param b Pointer to (exactly what?)
51  @param msg The message passed to the object.
52  @param arg
53  @param dst Pointer to the destination that assistance strings are passed to for display.
54  */
55 void send_assist(TTPtr self, void *b, long msg, long arg, char *dst);
56 
57 /** Associate j.send(~) with NodeLib. This is a prerequisit for communication with other Jamoma object in the module and beyond. */
58 void send_subscribe(TTPtr self);
59 
60 /** Internal method called when the model:address parameter changed. It allows relative address binding.
61  @param self Pointer to this object.
62  @param msg The message sent to this object.
63  @param argc The number of arguments passed to the object.
64  @param argv Pointer to an array of atoms passed to the object.
65  @see send_subscribe
66  */
67 void send_return_model_address(TTPtr self, t_symbol *msg, long argc, t_atom *argv);
68 
69 #ifdef JCOM_SEND_TILDE
70 
71 /** j.send~ 32-bit MSP perform method (for Max 5). Only defineed for j.send~. */
72 t_int* send_perform(t_int *w);
73 
74 /** j.send~ 32-bit DSP method (for Max 5).Only defineed for j.send~. */
75 void send_dsp(TTPtr self, t_signal **sp, short *count);
76 
77 /** j.send~ 64-bit MSP perform method (for Max 6). Only defineed for j.send~. */
78 void send_perform64(TTPtr self, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam);
79 
80 /** j.send~ 64-bit DSP method (for Max 6). Only defineed for j.send~. */
81 void send_dsp64(TTPtr self, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags);
82 
83 #else
84 
85 /** bang handler for j.send
86  @param self Pointer to this object.
87  @see send_int, send_float, send_list, WrappedSenderClass_anything
88  */
89 void send_bang(TTPtr self);
90 
91 /** int handler for j.send
92  @param self Pointer to this object.
93  @param value The value sent to this object.
94  @see send_bang, send_float, send_list, WrappedSenderClass_anything
95  */
96 void send_int(TTPtr self, long value);
97 
98 /** float handler for j.send
99  @param self Pointer to this object.
100  @param value The value sent to this object.
101  @see send_bang, send_int, send_list, WrappedSenderClass_anything
102  */
103 void send_float(TTPtr self, double value);
104 
105 /** list handler for j.send
106  @param self Pointer to this object.
107  @param msg The message sent to this object.
108  @param argc The number of arguments passed to the object.
109  @param argv Pointer to an array of atoms passed to the object.
110  @see send_bang, send_int, send_float, WrappedSenderClass_anything
111  */
112 void send_list(TTPtr self, t_symbol *msg, long argc, t_atom *argv);
113 
114 /** anything else handler for j.send
115  @param self Pointer to this object.
116  @param msg The message sent to this object.
117  @param argc The number of arguments passed to the object.
118  @param argv Pointer to an array of atoms passed to the object.
119  @see send_bang, send_int, send_float, send_list
120  */
121 void WrappedSenderClass_anything(TTPtr self, t_symbol *msg, long argc, t_atom *argv);
122 
123 /** Internal method used to send data to a j.in.
124  @param self Pointer to this object.
125  @param msg The message sent to this object.
126  @param argc The number of arguments passed to the object.
127  @param argv Pointer to an array of atoms passed to the object.
128  @see send_list
129  */
130 void send_input(TTPtr self, t_symbol *msg, long argc, t_atom *argv);
131 
132 #endif
133 
134 /** address message handler for j.send. To change the address to bind.
135  @param self Pointer to this object.
136  @param address The address to bind
137  @see send_subscribe
138  */
139 void send_address(TTPtr self, t_symbol *address);
140 
141 #pragma mark -
142 #pragma mark main
143 
144 int C74_EXPORT main(void)
145 {
146  ModularSpec *spec = new ModularSpec;
147  spec->_wrap = &WrapTTSenderClass;
148  spec->_new = &WrappedSenderClass_new;
149  spec->_free = &WrappedSenderClass_free;
150 #ifdef JCOM_SEND_TILDE
151  spec->_any = NULL;
152 #else
153  spec->_any = &WrappedSenderClass_anything;
154 #endif
155 
156 #ifdef JCOM_SEND_TILDE
157  return wrapTTModularClassAsMaxClass(kTTSym_Sender, "j.send~", NULL, spec);
158 #else
159  return wrapTTModularClassAsMaxClass(kTTSym_Sender, "j.send", NULL, spec);
160 #endif
161 }
162 
163 void WrapTTSenderClass(WrappedClassPtr c)
164 {
165  class_addmethod(c->maxClass, (method)send_assist, "assist", A_CANT, 0L);
166 
167  class_addmethod(c->maxClass, (method)send_return_model_address, "return_model_address", A_CANT, 0);
168 
169 #ifdef JCOM_SEND_TILDE
170  class_addmethod(c->maxClass, (method)send_dsp, "dsp", A_CANT, 0L);
171  class_addmethod(c->maxClass, (method)send_dsp64, "dsp64", A_CANT, 0);
172 #else
173  class_addmethod(c->maxClass, (method)send_bang, "bang", 0L);
174  class_addmethod(c->maxClass, (method)send_int, "int", A_LONG, 0L);
175  class_addmethod(c->maxClass, (method)send_float, "float", A_FLOAT, 0L);
176  class_addmethod(c->maxClass, (method)send_list, "list", A_GIMME, 0L);
177  class_addmethod(c->maxClass, (method)WrappedSenderClass_anything, "symbol", A_SYM, 0L);
178 #endif
179 
180  class_addmethod(c->maxClass, (method)send_address, "address", A_SYM, 0L);
181 
182  // no class_dspinit : it is done in wrapTTModularClassAsMaxClass for AUDIO_EXTERNAL
183 }
184 
185 #pragma mark -
186 #pragma mark Object life
187 
188 void WrappedSenderClass_new(TTPtr self, long argc, t_atom *argv)
189 {
191  t_symbol *address;
192  long attrstart = attr_args_offset(argc, argv); // support normal arguments
193  t_atom a[1];
194 
195  // read first argument
196  if (attrstart && argv)
197  address = atom_getsym(argv);
198  else
199  address = _sym_nothing;
200 
201  x->address = TTAddress(jamoma_parse_dieze((t_object*)x, address)->s_name);
202 
203  // if the j.send tries to bind an Input object : bind the signal attribute
204  if (x->address.getName() == TTSymbol("in"))
205  x->address = x->address.appendAttribute(kTTSym_signal);
206 
207  x->argc = 0; // the argc member is usefull to count how many time the external tries to bind
208 
209 #ifdef JCOM_SEND_TILDE
210  // create a sender to handle an audio signal
211  jamoma_sender_create_audio((t_object*)x, x->wrappedObject);
212 
213  // create an inlet to handle audio signal
214  dsp_setup((t_pxobject *)x, 1);
215  x->obj.z_misc = Z_NO_INPLACE | Z_PUT_FIRST;
216 #else
217  // create a sender to handle any data signal
218  jamoma_sender_create((t_object*)x, x->wrappedObject);
219 #endif
220 
221  // handle attribute args
222  attr_args_process(x, argc, argv);
223 
224  // for absolute address
225  if (x->address.getType() == kAddressAbsolute) {
226 
227  x->wrappedObject.set(kTTSym_address, x->address);
228 
229  atom_setsym(a, gensym((char*)x->address.c_str()));
230  object_obex_dumpout((t_object*)x, gensym("address"), 1, a);
231  return;
232  }
233 
234  // The following must be deferred because we have to interrogate our box,
235  // and our box is not yet valid until we have finished instantiating the object.
236  // Trying to use a loadbang method instead is also not fully successful (as of Max 5.0.6)
237  defer_low((t_object*)x, (method)send_subscribe, NULL, 0, 0);
238 }
239 
241 {
243 
244  x->wrappedObject.set(kTTSym_address, kTTAdrsEmpty);
245 
246 #ifdef JCOM_SEND_TILDE
247 
248  // Always call dsp_free first in this routine
249  dsp_free((t_pxobject *)x);
250 #endif
251 }
252 
253 #pragma mark -
254 #pragma mark NodeLib association
255 
257 {
259  TTValue v;
260  t_atom a[1];
261  TTAddress contextAddress = kTTAdrsEmpty;
262  TTAddress absoluteAddress, returnedAddress;
263  TTNodePtr returnedNode = NULL;
264  TTNodePtr returnedContextNode = NULL;
265  TTObject anObject, empty;
266 
267  if (x->address == kTTAdrsEmpty)
268  return;
269 
270  // for relative address
272 
273  if (!jamoma_subscriber_create((t_object*)x, empty, TTAddress("model"), x->subscriberObject, returnedAddress, &returnedNode, &returnedContextNode)) {
274 
275  // get the context address to make
276  // a viewer on the contextAddress/model:address attribute
277  x->subscriberObject.get("contextAddress", v);
278  contextAddress = v[0];
279 
280  // release the subscriber
281  x->subscriberObject = TTObject();
282 
283  if (x->patcherContext != kTTSymEmpty) {
284 
285  // observe model:address attribute (in view patcher : deferlow return_model_address)
286  makeInternals_receiver(x, contextAddress, TTSymbol("/model:address"), gensym("return_model_address"), anObject, x->patcherContext == kTTSym_view);
287 
288  return;
289  }
290  }
291 
292  // else, if no context, set address directly
293  else if (x->patcherContext == kTTSymEmpty) {
294 
295  // release the subscriber
296  x->subscriberObject = TTObject();
297 
298  contextAddress = kTTAdrsRoot;
299  absoluteAddress = contextAddress.appendAddress(x->address);
300  x->wrappedObject.set(kTTSym_address, absoluteAddress);
301 
302  atom_setsym(a, gensym((char*)absoluteAddress.c_str()));
303  object_obex_dumpout((t_object*)x, gensym("address"), 1, a);
304  return;
305  }
306 
307  // otherwise while the context node is not registered : try to binds again :(
308  // (to -- this is not a good way todo. For binding we should make a subscription
309  // to a notification mechanism and each time an TTObjet subscribes to the namespace
310  // using jamoma_subscriber_create we notify all the externals which have used
311  // jamoma_subscriber_create with NULL object to bind)
312 
313  // release the subscriber
314  x->subscriberObject = TTObject();
315 
316  x->argc++; // the index member is usefull to count how many time the external tries to bind
317  if (x->argc > 100) {
318  object_error((t_object*)x, "tries to bind too many times on %s", x->address.c_str());
319  object_obex_dumpout((t_object*)x, gensym("error"), 0, NULL);
320  return;
321  }
322 
323  // The following must be deferred because we have to interrogate our box,
324  // and our box is not yet valid until we have finished instantiating the object.
325  // Trying to use a loadbang method instead is also not fully successful (as of Max 5.0.6)
326  defer_low((t_object*)x, (method)send_subscribe, NULL, 0, 0);
327 }
328 
329 void send_return_model_address(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
330 {
332  TTAddress absoluteAddress;
333  t_atom a[1];
334 
335  if (argc && argv && x->wrappedObject.valid() && x->address.getType() == kAddressRelative) {
336 
337  // set address attribute of the wrapped Receiver object
338  absoluteAddress = TTAddress(atom_getsym(argv)->s_name).appendAddress(x->address);
339  x->wrappedObject.set(kTTSym_address, absoluteAddress);
340  x->argc = 0; // the index member is usefull to count how many time the external tries to bind
341 
342  atom_setsym(a, gensym((char*)absoluteAddress.c_str()));
343  object_obex_dumpout((t_object*)x, gensym("address"), 1, a);
344 
345  JamomaDebug object_post((t_object*)x, "binds on %s", absoluteAddress.c_str());
346  }
347 }
348 
349 #pragma mark -
350 #pragma mark Methods bound to input/inlets
351 
352 // Method for Assistance Messages
353 void send_assist(TTPtr self, void *b, long msg, long arg, char *dst)
354 {
355  if (msg==1) // Inlets
356 #ifdef JCOM_SEND_TILDE
357  strcpy(dst, "signal: Forwarded to node, address of node");
358 #else
359  strcpy(dst, "value(s): Forwarded to node, address of node");
360 #endif
361  else // Dump outlet
362  strcpy(dst, "dumpout");
363 }
364 
365 #ifndef JCOM_SEND_TILDE
366 
367 void send_bang(TTPtr self)
368 {
369  send_list(self, _sym_bang, 0, NULL);
370 }
371 
372 void send_int(TTPtr self, long value)
373 {
374  t_atom a;
375 
376  atom_setlong(&a, value);
377  send_list(self, _sym_int, 1, &a);
378 }
379 
380 void send_float(TTPtr self, double value)
381 {
382  t_atom a;
383 
384  atom_setfloat(&a, value);
385  send_list(self, _sym_float, 1, &a);
386 }
387 
388 void send_list(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
389 {
391 
392  // dynamic address setting for j.send without address
393  if (x->address == kTTAdrsEmpty) {
394 
395  TTAddress anAddress = TTAddress(msg->s_name);
396  t_symbol *newMsg;
397 
398  // send only to absolute address
399  if (anAddress.getType() == kAddressAbsolute) {
400 
401  x->wrappedObject.set(kTTSym_address, anAddress);
402 
403  // edit message type
404  if (argc == 0)
405  newMsg = _sym_nothing;
406  else if (argc > 1)
407  newMsg = _sym_list;
408  else if (atom_gettype(argv) == A_LONG)
409  newMsg = _sym_int;
410  else if (atom_gettype(argv) == A_FLOAT)
411  newMsg = _sym_float;
412  else if (atom_gettype(argv) == A_SYM)
413  newMsg = _sym_symbol;
414  else
415  return;
416 
417  jamoma_sender_send(x->wrappedObject, newMsg, argc, argv);
418  }
419  }
420  else
421  jamoma_sender_send(x->wrappedObject, msg, argc, argv);
422 }
423 
424 void WrappedSenderClass_anything(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
425 {
426  send_list(self, msg, argc, argv);
427 }
428 
429 #endif
430 
431 void send_address(TTPtr self, t_symbol *address)
432 {
434  t_atom a[1];
435  TTAddress newAddress = TTAddress(jamoma_parse_dieze((t_object*)x, address)->s_name);
436 
437  // if the former address was relative and the new one is absolute :
438  // we don't need model:address receiver anymore
439  if (x->address.getType() == kAddressRelative &&
440  newAddress.getType() == kAddressAbsolute) {
441 
442  TTValue v;
443  TTErr err = x->internals->lookup(TTSymbol("/model:address"), v);
444 
445  if (!err) {
446 
447  TTObject aReceiver = v[0];
448  aReceiver.set(kTTSym_address, kTTAdrsEmpty);
449 
450  x->internals->remove(TTSymbol("/model:address"));
451  }
452  }
453 
454  // assign the new address
455  x->address = newAddress;
456 
457  // for absolute address
458  if (x->address.getType() == kAddressAbsolute) {
459 
460  x->wrappedObject.set(kTTSym_address, x->address);
461 
462  atom_setsym(a, gensym((char*)x->address.c_str()));
463  object_obex_dumpout((t_object*)x, gensym("address"), 1, a);
464 
465  JamomaDebug object_post((t_object*)x, "binds on %s", x->address.c_str());
466 
467  return;
468  }
469 
470  send_subscribe(self);
471 }
472 
473 #pragma mark -
474 #pragma mark Methods relating to audio processing
475 
476 #ifdef JCOM_SEND_TILDE
477 // Perform Method - just pass the whole vector straight through
478 // (the work is all done in the dsp method)
479 t_int *send_perform(t_int *w)
480 {
483  TTListPtr objectCache = NULL;
484  TTObject anObject;
485  TTUInt16 vectorSize = 0;
486  TTUInt16 n;
487  t_float* envelope;
488  TTFloat32 sum = 0, mean;
489  TTValue v, none;
490 
491  if (x->obj.z_disabled)
492  return w + 4;
493 
494  if (aSender) {
495 
496  // get the object cache of the Sender object
497  if (!aSender->getAttributeValue(kTTSym_objectCache, v)) {
498 
499  objectCache = TTListPtr((TTPtr)v[0]);
500 
501  if (objectCache) {
502 
503  // get signal vectorSize
504  aSender->mSignal.get(kTTSym_vectorSize, vectorSize);
505 
506  // store the input from the inlet
507  TTAudioSignalPtr(aSender->mSignal.instance())->setVector(0, vectorSize, (TTFloat32*)w[2]);
508 
509  // process the mean value
510  envelope = (t_float *)(w[3]);
511  n = vectorSize;
512  while (n--) {
513  sum += *envelope;
514  envelope++;
515  }
516  mean = sum / vectorSize;
517  v = TTValue(mean);
518 
519  // send signal or mean to each object
520  for (objectCache->begin(); objectCache->end(); objectCache->next()) {
521 
522  anObject = objectCache->current()[0];
523 
524  if (anObject.valid()) {
525 
526  // INPUT AUDIO case : cache the signal into the input
527  if (anObject.name() == kTTSym_InputAudio)
528  TTInputPtr(anObject.instance())->mSignalCache.appendUnique(aSender->mSignal);
529 
530  // DATA case : send the mean value of the sample
531  else if (anObject.name() == kTTSym_Data)
532  anObject.send(kTTSym_Command, v);
533 
534  }
535  }
536  }
537  }
538  }
539 
540  return w + 4;
541 }
542 
543 // Perform Method 64 bit - just pass the whole vector straight through
544 // (the work is all done in the dsp 64 bit method)
545 void send_perform64(TTPtr self, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam)
546 {
549  TTListPtr objectCache = NULL;
550  TTObject anObject;
551  TTUInt16 vectorSize = 0;
552  TTUInt16 n;
553  TTSampleValue* envelope;
554  TTFloat32 sum = 0, mean;
555  TTValue v, none;
556 
557  if (x->obj.z_disabled)
558  return;
559 
560  if (aSender) {
561 
562  // get the object cache of the Sender object
563  if (!aSender->getAttributeValue(kTTSym_objectCache, v)) {
564 
565  objectCache = TTListPtr((TTPtr)v[0]);
566 
567  if (objectCache) {
568 
569  // get signal vectorSize
570  aSender->mSignal.get(kTTSym_vectorSize, vectorSize);
571 
572  // store the input from the inlet
573  TTAudioSignalPtr(aSender->mSignal.instance())->setVector64Copy(0, vectorSize, ins[0]);
574 
575  // process the mean value
576  envelope = ins[0];
577  n = vectorSize;
578  while (n--) {
579  sum += *envelope;
580  envelope++;
581  }
582  mean = sum / vectorSize;
583  v = TTValue(mean);
584 
585  // send signal or mean to each object
586  for (objectCache->begin(); objectCache->end(); objectCache->next()) {
587 
588  anObject = objectCache->current()[0];
589 
590  if (anObject.valid()) {
591 
592  // INPUT case : cache the signal into the input
593  if (anObject.name() == kTTSym_InputAudio)
594  TTInputPtr(anObject.instance())->mSignalCache.appendUnique(aSender->mSignal);
595 
596  // DATA case : send the mean value of the sample
597  else if (anObject.name() == kTTSym_Data)
598  anObject.send(kTTSym_Command, v);
599  }
600  }
601  }
602  }
603  }
604 }
605 
606 // DSP Method
607 void send_dsp(TTPtr self, t_signal **sp, short *count)
608 {
611  void** audioVectors = NULL;
612  TTUInt16 vectorSize = 0;
613 
614  if (aSender) {
615 
616  audioVectors = (void**)sysmem_newptr(sizeof(void*) * 3);
617  audioVectors[0] = x;
618 
619  if (count[0] || count[1]) {
620  if (sp[0]->s_n > vectorSize)
621  vectorSize = sp[0]->s_n;
622 
623  audioVectors[1] = sp[0]->s_vec;
624  audioVectors[2] = sp[1]->s_vec;
625  }
626 
627  // set signal numChannels and vectorSize
628  aSender->mSignal.set(kTTSym_numChannels, 1);
629  aSender->mSignal.set(kTTSym_vectorSize, vectorSize);
630 
631  dsp_addv(send_perform, 3, audioVectors);
632  sysmem_freeptr(audioVectors);
633  }
634 }
635 
636 // DSP64 method
637 void send_dsp64(TTPtr self, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
638 {
641 
642  if (aSender) {
643 
644  // set signal numChannels and vectorSize
645  aSender->mSignal.set(kTTSym_numChannels, 1);
646  aSender->mSignal.set(kTTSym_vectorSize, (TTUInt16)maxvectorsize);
647 
648  // mSignal will be set in the perform method
649  object_method(dsp64, gensym("dsp_add64"), x, send_perform64, 0, NULL);
650  }
651 }
652 #endif
void send_int(TTPtr self, long value)
int handler for j.send
TTErr JAMOMA_EXPORT jamoma_patcher_get_info(t_object *obj, t_object **returnedPatcher, TTSymbol &returnedContext, TTSymbol &returnedClass, TTSymbol &returnedName)
Get all context info from an object (his patcher and the context, the class and the name of his patch...
TTAddress appendAddress(const TTAddress &toAppend)
Return a new TTAddress with the appended part.
Definition: TTAddress.h:167
TTObject subscriberObject
The instance of a TTSubscriber object used to register the wrapped object in the tree structure...
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
void send_assist(TTPtr self, void *b, long msg, long arg, char *dst)
Assistance Method.
TTErr send(const TTSymbol aName)
Send a message to this object with no arguments.
Definition: TTObject.cpp:135
void WrappedSenderClass_anything(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
anything else handler for j.send
TTAddress appendAttribute(TTSymbol anAttribute)
Return a new TTAddress with attribute part.
Definition: TTAddress.h:161
void send_bang(TTPtr self)
bang handler for j.send
TTErr wrapTTModularClassAsMaxClass(TTSymbol &ttblueClassName, const char *maxClassName, WrappedClassPtr *c, ModularSpec *specificities)
Wrap a Jamoma class as a Max class.
TTErr lookup(const TTSymbol key, TTValue &value)
Find the value for the given key.
Definition: TTHash.cpp:76
t_symbol JAMOMA_EXPORT * jamoma_parse_dieze(t_object *x, t_symbol *address)
Parse #N inside address and replace them by parent patcher arguments if there are.
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Definition: TTNode.h:59
TTAddress address
sometime external needs to store an address (e.g. send, receive, view, ...)
TTErr JAMOMA_EXPORT jamoma_sender_create_audio(t_object *x, TTObject &returnedSender)
Create a TTSender object for audio signal.
TTSymbol patcherClass
the patcher class in which the external is
TTObject mSignal
any data structure to send complex signal
Definition: TTSender.h:33
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Definition: TTAddress.h:29
Create and use Jamoma object instances.
Definition: TTObject.h:29
void send_float(TTPtr self, double value)
float handler for j.send
TTErr getAttributeValue(const TTSymbol name, TTValue &value)
Get an attribute value for an object.
t_object * patcherPtr
the patcher in which the external is (ignoring subpatcher)
this flag means that an address have no leading slash
Definition: TTAddressBase.h:64
void WrapTTSenderClass(WrappedClassPtr c)
Wrap the j.send class as a Max object.
TTHashPtr internals
An hash table to store any internal TTObjectBases (like TTData, TTViewer, ...)
void send_return_model_address(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
Internal method called when the model:address parameter changed.
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
TTErr get(const TTSymbol aName, T &aReturnedValue) const
Get an attribute value for an object.
void send_input(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
Internal method used to send data to a j.in.
TTSymbol name() const
Return the name of this class.
Definition: TTObject.cpp:129
t_object obj
Max control object header.
TTErr set(const TTSymbol aName, T aValue)
Set an attribute value for an object.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
float TTFloat32
32 bit floating point number
Definition: TTBase.h:187
TTObject wrappedObject
The instance of the Jamoma object we are wrapping.
The TTAudioSignal class represents N vectors of audio samples for M channels.
Definition: TTAudioSignal.h:57
this flag means that an address have a leading slash
Definition: TTAddressBase.h:65
const char * c_str() const
Return a pointer to the internal string as a C-string.
Definition: TTSymbol.h:77
void WrappedSenderClass_new(TTPtr self, long argc, t_atom *argv)
Wrapper for the j.send constructor class, called when an instance is created.
TTErr JAMOMA_EXPORT jamoma_sender_send(TTObject &aSender, t_symbol *msg, long argc, const t_atom *argv)
Send Max data using a TTSender object.
Data Structure for this object.
TTAddressType getType()
Get the type.
Definition: TTAddress.h:136
TTErr remove(const TTSymbol key)
Remove an item from the hash table.
Definition: TTHash.cpp:108
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
void send_subscribe(TTPtr self)
Associate j.send(~) with NodeLib.
Wraps Jamoma Core classes as objects for Max/MSP.
int C74_EXPORT main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.
TTSymbol patcherContext
the patcher context in which the external is (model, view)
TTSymbol patcherName
the patcher name in which the external is
TTObjectBase * instance() const
Return a direct pointer to the internal instance.
Definition: TTObject.cpp:105
TTErr JAMOMA_EXPORT jamoma_subscriber_create(t_object *x, TTObject &anObject, TTAddress relativeAddress, TTObject &returnedSubscriber, TTSymbol &returnedAddress, TTNodePtr *returnedNode, TTNodePtr *returnedContextNode)
Create a #TTSubscriber object and register a TTObject into the tree or, if aTTObject is NULL...
TTSender ...
Definition: TTSender.h:27
void send_address(TTPtr self, t_symbol *address)
address message handler for j.send.
TTBoolean valid() const
Determine if the object contained by this TTObject is truly ready for use.
Definition: TTObject.cpp:179
TTSymbol & getName()
Get the name part.
Definition: TTAddress.h:118
WrappedModularInstance * WrappedModularInstancePtr
Pointer to a wrapped instance of our object.
TTFloat64 TTSampleValue
A value representing a single audio sample.
Definition: TTBase.h:230
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void WrappedSenderClass_free(TTPtr self)
Wrapper for the j.send deconstructor class, called when an instance is destroyed. ...
void send_list(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
list handler for j.send
TTErr JAMOMA_EXPORT jamoma_sender_create(t_object *x, TTObject &returnedSender)
Create a TTSender object.