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