Jamoma API  0.6.0.a19
Max/source/j.parameter_array/j.parameter_array.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup implementationMaxExternals
4  *
5  * @brief j.parameter_array / j.message_array / j.return_array : An array of nodes in a model
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 #define data_out 0
20 #define index_out 1
21 #define dump_out 2
22 
23 
24 // This is used to store extra data
25 typedef struct extra {
26 
27  TTBoolean changingAddress; // a flag to protect from succession of address changes
28  TTListPtr objectsSorted; // all objects sorted by index
29 
30 } t_extra;
31 #define EXTRA ((t_extra*)x->extra)
32 
33 
34 // Definitions
35 void WrapTTDataClass(WrappedClassPtr c);
36 void WrappedDataClass_new(TTPtr self, long argc, t_atom *argv);
37 void WrappedDataClass_free(TTPtr self);
38 
39 void data_assist(TTPtr self, TTPtr b, long msg, long arg, char *dst);
40 
41 void data_array_build(TTPtr self, t_symbol *msg, long argc, const t_atom *argv);
42 void data_array_build_index(TTPtr self, TTObject& returnedData, TTSymbol service, TTUInt32 index);
43 void data_address(TTPtr self, t_symbol *name);
44 
45 void data_array_return_value(const TTValue& baton, const TTValue& v);
46 void data_edit_array(TTPtr self, TTValue& array);
47 
48 void WrappedDataClass_anything(TTPtr self, t_symbol *msg, long argc, t_atom *argv);
49 void data_bang(TTPtr self);
50 void data_int(TTPtr self, long value);
51 void data_float(TTPtr self, double value);
52 void data_list(TTPtr self, t_symbol *msg, long argc, const t_atom *argv);
53 
54 void data_array(TTPtr self, t_symbol *msg, long argc, const t_atom *argv);
55 
56 void data_inc(TTPtr self, t_symbol *msg, long argc, const t_atom *argv);
57 void data_dec(TTPtr self, t_symbol *msg, long argc, const t_atom *argv);
58 
59 int C74_EXPORT main(void)
60 {
61  ModularSpec *spec = new ModularSpec;
62  spec->_wrap = &WrapTTDataClass;
63  spec->_new = &WrappedDataClass_new;
64  spec->_free = &WrappedDataClass_free;
65  spec->_any = &WrappedDataClass_anything;
66 
67 #ifdef JMOD_MESSAGE
68  return wrapTTModularClassAsMaxClass(kTTSym_Data, "j.message_array", NULL, spec);
69 #endif
70 
71 #ifdef JMOD_RETURN
72  return wrapTTModularClassAsMaxClass(kTTSym_Data, "j.return_array", NULL, spec);
73 #endif
74 
75 #ifndef JMOD_MESSAGE
76 #ifndef JMOD_RETURN
77  return wrapTTModularClassAsMaxClass(kTTSym_Data, "j.parameter_array", NULL, spec);
78 #endif
79 #endif
80 }
81 
82 void WrapTTDataClass(WrappedClassPtr c)
83 {
84  class_addmethod(c->maxClass, (method)data_assist, "assist", A_CANT, 0L);
85 
86  class_addmethod(c->maxClass, (method)data_bang, "bang", 0L);
87  class_addmethod(c->maxClass, (method)data_int, "int", A_LONG, 0);
88  class_addmethod(c->maxClass, (method)data_float, "float", A_FLOAT, 0);
89  class_addmethod(c->maxClass, (method)data_list, "list", A_GIMME, 0);
90 
91  class_addmethod(c->maxClass, (method)data_array, "array", A_GIMME, 0);
92 
93  class_addmethod(c->maxClass, (method)data_inc, "+", A_GIMME, 0);
94  class_addmethod(c->maxClass, (method)data_dec, "-", A_GIMME, 0);
95 
96  class_addmethod(c->maxClass, (method)data_address, "address", A_SYM,0);
97 }
98 
99 void WrappedDataClass_new(TTPtr self, long argc, t_atom *argv)
100 {
102  t_symbol *relativeAddress;
103  long attrstart = attr_args_offset(argc, argv); // support normal arguments
104  TTValue none;
105 
106  // check address argument
107  relativeAddress = _sym_nothing;
108  if (attrstart && argv)
109  if (atom_gettype(argv) == A_SYM)
110  relativeAddress = atom_getsym(argv);
111 
112  if (relativeAddress == _sym_nothing) {
113  object_error((t_object*)x, "needs a name as first argument");
114  x->extra = NULL;
115  return;
116  }
117 
118  // add an inlet for the index
119  x->inlets = (TTHandle)sysmem_newptr(sizeof(TTPtr) * 1);
120  x->inlets[0] = proxy_new(x, 1, &x->index); // use this member to store index (because index is used for data array)
121 
122  // Make outlets (before attr_args_process)
123  /////////////////////////////////////////////////////////////////////////////////
124 
125  // Don't create outlets during dynamic changes
126  x->outlets = (TTHandle)sysmem_newptr(sizeof(TTPtr) * 2);
127  x->outlets[index_out] = outlet_new(x, NULL); // long outlet to output data index
128  x->outlets[data_out] = outlet_new(x, NULL); // anything outlet to output data
129 
130  x->useInternals = YES;
131  x->internals->setThreadProtection(YES);
132 
133  x->arraySize = 0;
134  x->arrayIndex = 0;
135  x->arrayAddress = kTTAdrsEmpty;
136  x->arrayArgs = none;
137  x->arrayAttrFormat = gensym("single");
138 
139  // Prepare extra data for parameters and messages
140  x->extra = (t_extra*)malloc(sizeof(t_extra));
141 
142  EXTRA->changingAddress = NO;
143  EXTRA->objectsSorted = new TTList();
144 
145  // handle args
146  if (argc && argv) {
147 
148  // set the external attribute
149  attr_args_process(x, argc, argv);
150 
151  // keep args to set the wrapped object attributes
152  if (argc > 1)
153  jamoma_ttvalue_from_Atom(x->arrayArgs, _sym_list, argc--, argv++);
154  }
155 
156  // set array address and parse number between brackets
157  x->arrayAddress = relativeAddress->s_name;
158  if (x->arrayAddress.getType() != kAddressRelative)
159  {
160  x->arrayAddress = kTTAdrsEmpty;
161  object_error((t_object*)x, "can't register because %s is not a relative address", relativeAddress->s_name);
162  }
163 
164  t_atom number;
165  atom_setlong(&number, jamoma_parse_bracket(relativeAddress, x->arrayFormatInteger, x->arrayFormatString));
166 
167  // The following must be deferred because we have to interrogate our box,
168  // and our box is not yet valid until we have finished instantiating the object.
169  // Trying to use a loadbang method instead is also not fully successful (as of Max 5.0.6)
170  defer_low((t_object*)x, (method)data_array_build, _sym_nothing, 1, &number);
171 }
172 
173 void WrappedDataClass_free(TTPtr self)
174 {
176 
177  if (EXTRA) {
178 
179  delete EXTRA->objectsSorted;
180  free(EXTRA);
181  }
182 }
183 
184 void data_array_build(TTPtr self, t_symbol *msg, long argc, const t_atom *argv)
185 {
187 
188  t_symbol *instanceAddress;
189  TTObject anObject;
190 
191  TTUInt32 newSize = atom_getlong(argv);
192  TTUInt32 lastSize = x->arraySize;
193 
194  if (newSize > MAX_ARRAY_SIZE)
195  {
196  object_error((t_object*)x, "the size is greater than the maximum array size (%d)", MAX_ARRAY_SIZE);
197  return;
198  }
199 
200  x->arraySize = newSize;
201  x->cursor = kTTSymEmpty;
202 
203  // Starts iteration on internals
204  x->iterateInternals = YES;
205 
206  // if the array size increase : build only new index
207  if (newSize > lastSize)
208  {
209  for (TTUInt32 i = lastSize + 1; i <= newSize; i++)
210  {
211  jamoma_edit_numeric_instance(x->arrayFormatInteger, &instanceAddress, i);
212 
213  // create a data
214 #ifdef JMOD_MESSAGE
215  data_array_build_index(self, anObject, kTTSym_message, i);
216 #endif
217 
218 #if JMOD_RETURN
219  data_array_build_index(self, anObject, kTTSym_return, i);
220 #endif
221 
222 #ifndef JMOD_MESSAGE
223 #ifndef JMOD_RETURN
224  data_array_build_index(self, anObject, kTTSym_parameter, i);
225 #endif
226 #endif
227  // append the data to the internals table (without subscriber)
228  TTValue cache(anObject);
229  cache.append(TTSymbol(instanceAddress->s_name));
230 
231  x->internals->append(TTSymbol(instanceAddress->s_name), cache);
232 
233  // inverse objects order for iteration purpose (see in data_array_return_value : array mode)
234  EXTRA->objectsSorted->insert(0, anObject);
235  }
236  }
237 
238  // if the array size decrease : delete only former index
239  else
240  {
241  for (TTUInt32 i = lastSize; i > newSize; i--)
242  {
243  jamoma_edit_numeric_instance(x->arrayFormatInteger, &instanceAddress, i);
244 
245  TTValue cache;
246  x->internals->lookup(TTSymbol(instanceAddress->s_name), cache);
247  anObject = cache[0];
248 
249  // remove the data from the internal table (this will also unregister the data as the subscriber is stored into the table)
250  x->internals->remove(TTSymbol(instanceAddress->s_name));
251 
252  // remove objects from the beginning because they are ordered for iteration purpose (see in data_array_return_value : array mode)
253  EXTRA->objectsSorted->getIndex(0, cache);
254  EXTRA->objectsSorted->remove(cache);
255  cache.clear();
256 
257  if (anObject.instance()->getReferenceCount() > 1)
258  object_error((t_object*)x, "there are still unreleased reference of a %s wrappedObject(refcount = %d)", instanceAddress->s_name, anObject.instance()->getReferenceCount() - 1);
259  }
260  }
261 
262  // Ends iteration on internals
263  x->iterateInternals = NO;
264 
265  // handle args BEFORE to subscribe the object
266  // TODO : for new index only
267  long ac = 0;
268  t_atom *av = NULL;
269  jamoma_ttvalue_to_Atom(x->arrayArgs, &ac, &av);
270  if (ac && av)
271  attr_args_process(x, ac, av);
272 
273  // Starts iteration on internals
274  x->iterateInternals = YES;
275 
276  // subscribe (and init) new index only
277  for (TTUInt32 i = lastSize + 1; i <= newSize; i++)
278  {
279  // select data at index
280  jamoma_edit_numeric_instance(x->arrayFormatInteger, &instanceAddress, i);
281 
282  TTValue cache;
283  x->internals->lookup(TTSymbol(instanceAddress->s_name), cache);
284  anObject = cache[0];
285 
286  // subscribe the data
287  TTAddress returnedAddress;
288  TTNodePtr returnedNode = NULL;
289  TTNodePtr returnedContextNode = NULL;
290  TTObject aSubscriber;
291 
292  if (!jamoma_subscriber_create((t_object*)x, anObject, TTAddress(instanceAddress->s_name), aSubscriber, returnedAddress, &returnedNode, &returnedContextNode))
293  {
294  if (aSubscriber.valid())
295  {
296  // append the subscriber to the internals table
297  x->internals->remove(TTSymbol(instanceAddress->s_name));
298 
299  cache.append(aSubscriber);
300  x->internals->append(TTSymbol(instanceAddress->s_name), cache);
301  }
302  }
303 
304 #ifndef JMOD_MESSAGE
305  anObject.send("Init");
306 #endif
307  }
308 
309  // Ends iteration on internals
310  x->iterateInternals = NO;
311 
312  // select all datas
313  if (x->arraySize > 0)
314  wrappedModularClass_ArraySelect(self, gensym("*"), 0, NULL);
315 }
316 
317 void data_array_build_index(TTPtr self, TTObject& returnedData, TTSymbol service, TTUInt32 index)
318 {
320  t_symbol *iAdrs;
321  TTValue baton;
322 
323  returnedData = TTObject(kTTSym_Data, service);
324 
325  jamoma_edit_numeric_instance(x->arrayFormatInteger, &iAdrs, index);
326 
327  baton = TTValue(self, index, TTSymbol(iAdrs->s_name));
328  returnedData.set(kTTSym_baton, baton);
329  returnedData.set(kTTSym_function, TTPtr(&data_array_return_value));
330 }
331 
332 void data_address(TTPtr self, t_symbol *address)
333 {
335 
336  // Avoid succession of address changes
337  if (!EXTRA->changingAddress)
338  {
339  EXTRA->changingAddress = YES;
340 
341  // filter repetitions
342  if (!(x->arrayAddress == TTAddress(address->s_name)))
343  {
344  if (!x->iterateInternals)
345  {
346  // set array address and parse number between brackets
347  x->arrayAddress = address->s_name;
348  if (x->arrayAddress.getType() != kAddressRelative)
349  {
350  x->arrayAddress = kTTAdrsEmpty;
351  object_error((t_object*)x, "can't register because %s is not a relative address", address->s_name);
352  }
353 
354  t_atom number;
355  TTString newArrayFormatInteger;
356  TTString newArrayFormatString;
357  atom_setlong(&number, jamoma_parse_bracket(address, newArrayFormatInteger, newArrayFormatString));
358 
359  // if the address format change
360  if (newArrayFormatInteger != x->arrayFormatInteger &&
361  newArrayFormatString != x->arrayFormatString &&
362  x->arraySize > 0)
363  {
364  // delete all formers addresses
365  t_atom zero;
366  atom_setlong(&zero, 0);
367  defer(self,(method)data_array_build, _sym_nothing, 1, &zero);
368  }
369 
370  x->arrayFormatInteger = newArrayFormatInteger;
371  x->arrayFormatString = newArrayFormatString;
372 
373  // build internals
374  defer(self,(method)data_array_build, _sym_nothing, 1, &number);
375 
376  // for array mode : output the array once afterward
377  if (x->arrayAttrFormat == gensym("array"))
378  {
379  TTValue array;
380  t_symbol *msg;
381  long argc = 0;
382  t_atom *argv = NULL;
383  TTBoolean shifted = NO;
384 
385  data_edit_array(self, array);
386 
387  jamoma_ttvalue_to_typed_Atom(array, &msg, &argc, &argv, shifted);
388 
389  // avoid blank before data
390  if (msg == _sym_nothing)
391  outlet_atoms(x->outlets[data_out], argc, argv);
392  else
393  outlet_anything(x->outlets[data_out], msg, argc, argv);
394 
395  if (shifted)
396  argv--;
397  sysmem_freeptr(argv);
398  }
399  }
400  }
401 
402  EXTRA->changingAddress = NO;
403  return;
404  }
405 
406  object_error((t_object*)x, "can't change to %s address. Please defer low", address->s_name);
407 }
408 
409 // Method for Assistance Messages
410 void data_assist(TTPtr self, TTPtr b, long msg, long arg, char *dst)
411 {
412  if (msg == 1) { // Inlet
413  switch(arg) {
414  case 0 :
415  strcpy(dst, "set the value of the selected instance(s)");
416  break;
417  case 1 :
418  strcpy(dst, "index (use * to bind all instances)");
419  break;
420  }
421  }
422  else { // Outlets
423  switch(arg) {
424  case data_out:
425  strcpy(dst, "direct: values");
426  break;
427  case index_out:
428  strcpy(dst, "index");
429  break;
430  case dump_out:
431  strcpy(dst, "dumpout");
432  break;
433  }
434  }
435 }
436 
437 void data_bang(TTPtr self)
438 {
440 
441  if (!x->internals->isEmpty()) {
442  data_list(self, _sym_bang, 0, NULL);
443  }
444  else
445  object_error((t_object*)x, "bang : the array is empty");
446 }
447 
448 void data_int(TTPtr self, long value)
449 {
451  t_atom a;
452 
453  if (proxy_getinlet((t_object*)x)) {
454  atom_setlong(&a, value);
455  wrappedModularClass_ArraySelect(self, _sym_nothing, 1, &a);
456  }
457  else {
458  if (!x->internals->isEmpty()) {
459  atom_setlong(&a, value);
460  data_list(self, _sym_int, 1, &a);
461  }
462  else
463  object_error((t_object*)x, "int : the array is empty");
464  }
465 }
466 
467 void data_float(TTPtr self, double value)
468 {
470  t_atom a;
471 
472  if (!x->internals->isEmpty()) {
473  atom_setfloat(&a, value);
474  data_list(self, _sym_float, 1, &a);
475  }
476  else
477  object_error((t_object*)x, "float : the array is empty");
478 }
479 
480 void data_list(TTPtr self, t_symbol *msg, long argc, const t_atom *argv)
481 {
483  TTObject o;
484 
485  if (!x->internals->isEmpty()) {
486 
487  // send to each data
488  if (x->arrayIndex == 0) {
489 
490  TTValue keys;
491 
492  x->internals->getKeys(keys);
493  for (TTUInt32 i = 0; i < keys.size(); i++) {
494  x->cursor = keys[i];
495  o = selectedObject;
496  jamoma_data_command(o, msg, argc, argv);
497  }
498 
499  // watch an instance by default
500  x->cursor = keys[0];
501  }
502  else {
503  o = selectedObject;
504  jamoma_data_command(o, msg, argc, argv);
505  }
506 
507  }
508  else
509  object_error((t_object*)x, "list : the array is empty");
510 }
511 
512 void WrappedDataClass_anything(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
513 {
515  TTObject o;
516 
517  if (proxy_getinlet((t_object*)x))
518  wrappedModularClass_ArraySelect(self, msg, argc, argv);
519  else
520  data_list(self, msg, argc, argv);
521 }
522 
523 void data_array(TTPtr self, t_symbol *msg, long argc, const t_atom *argv)
524 {
526  TTInt32 d, i;
527  t_symbol *instanceAddress;
528  TTSymbol memoCursor;
529 
530  if (!x->internals->isEmpty()) {
531 
532  // is the incoming data size is a multiple of the array size ?
533  // TODO why not mod ?
534  d = argc / x->arraySize;
535  if ((d * x->arraySize) == argc) {
536 
537  memoCursor = x->cursor;
538 
539  for (i = 1; i <= (TTInt32) x->arraySize; i++) {
540 
541  jamoma_edit_numeric_instance(x->arrayFormatInteger, &instanceAddress, i);
542  x->cursor = TTSymbol(instanceAddress->s_name);
543  TTObject o = selectedObject;
544  jamoma_data_command(o, _sym_nothing, d, argv+((i-1)*d));
545  }
546 
547  x->cursor = memoCursor;
548  }
549  else
550  object_error((t_object*)x, "array : the array message size have to be a multiple of the array size");
551 
552  }
553  else
554  object_error((t_object*)x, "array : the array is empty");
555 }
556 
557 void data_inc(TTPtr self, t_symbol *msg, long argc, const t_atom *argv)
558 {
560  TTValue v, none;
561 
562  jamoma_ttvalue_from_Atom(v, _sym_nothing, argc, argv);
563  selectedObject->sendMessage(TTSymbol("Inc"), v, none);
564 }
565 
566 void data_dec(TTPtr self, t_symbol *msg, long argc, const t_atom *argv)
567 {
569  TTValue v, none;
570 
571  jamoma_ttvalue_from_Atom(v, _sym_nothing, argc, argv);
572  selectedObject->sendMessage(TTSymbol("Dec"), v, none);
573 }
574 
575 void data_array_return_value(const TTValue& baton, const TTValue& v)
576 {
578  TTValue array;
579  t_symbol *msg;
580  TTUInt32 i;
581  long argc = 0;
582  t_atom *argv = NULL;
583  TTBoolean shifted = NO;
584 
585  // unpack baton (a t_object, the index of the value and the instance symbol)
586  x = WrappedModularInstancePtr((TTPtr)baton[0]);
587  i = baton[1];
588 
589  // output index
590  if (x->arrayIndex == 0)
591  x->cursor = baton[2];
592 
593  outlet_int(x->outlets[index_out], i);
594 
595  // in array output mode
596  // edit a value containing all values
597  if (x->arrayAttrFormat == gensym("array")) {
598 
599  // don't output array when changing address
600  if (EXTRA->changingAddress)
601  return;
602 
603  data_edit_array(x, array);
604 
605  jamoma_ttvalue_to_typed_Atom(array, &msg, &argc, &argv, shifted);
606  }
607  else
608  // output single value
609  jamoma_ttvalue_to_typed_Atom(v, &msg, &argc, &argv, shifted);
610 
611  // avoid blank before data
612  if (msg == _sym_nothing)
613  outlet_atoms(x->outlets[data_out], argc, argv);
614  else
615  outlet_anything(x->outlets[data_out], msg, argc, argv);
616 
617  if (shifted)
618  argv--;
619  sysmem_freeptr(argv);
620 }
621 
622 void data_edit_array(TTPtr self, TTValue& array)
623 {
625  TTValue keys, object, grab, t;
626  TTSymbol key, type;
627  TTObject aData;
628 
629  // get each value from the data object itself
630  for (EXTRA->objectsSorted->begin();
631  EXTRA->objectsSorted->end();
632  EXTRA->objectsSorted->next()) {
633 
634  aData = EXTRA->objectsSorted->current()[0];
635 
636  // try to get the value or the value default
637  if (aData.get(kTTSym_value, grab))
638  aData.get(kTTSym_valueDefault, grab);
639 
640  // if there is no value
641  if (grab.size() == 0) {
642 
643  aData.get(kTTSym_type, t);
644 
645  type = t[0];
646 
647  if (type == kTTSym_string)
648  grab = kTTSym_none;
649  else
650  grab = 0;
651  }
652 
653  array.prepend(grab);
654  }
655 }
656 
657 t_max_err data_get_format(TTPtr self, TTPtr attr, long *ac, t_atom **av)
658 {
660 
661  if ((*ac)&&(*av)) {
662  //memory passed in, use it
663  } else {
664  //otherwise allocate memory
665  *ac = 1;
666  if (!(*av = (t_atom*)getbytes(sizeof(t_atom)*(*ac)))) {
667  *ac = 0;
668  return MAX_ERR_OUT_OF_MEM;
669  }
670  }
671 
672  atom_setsym(*av, x->arrayAttrFormat);
673 
674  return MAX_ERR_NONE;
675 }
676 
677 t_max_err data_set_format(TTPtr self, TTPtr attr, long ac, const t_atom *av)
678 {
680 
681  if (ac&&av) {
682  x->arrayAttrFormat = atom_getsym(av);
683  } else {
684  // no args, set to single
685  x->arrayAttrFormat = gensym("single");
686  }
687  return MAX_ERR_NONE;
688 }
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTErr send(const TTSymbol aName)
Send a message to this object with no arguments.
Definition: TTObject.cpp:135
void JAMOMA_EXPORT jamoma_edit_numeric_instance(TTString format, t_symbol **returnedName, long i)
Edit a new instance of the given format address using interger.
TTHandle outlets
an array of outlet
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
void data_int(TTPtr self, long value)
Process an incoming integer value.
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Definition: TTNode.h:59
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
size_type size() const noexcept
Return the number of elements.
Data structure for storing extra data.
void * extra
used to keep very specific things
this flag means that an address have no leading slash
Definition: TTAddressBase.h:64
TTErr getKeys(TTValue &hashKeys)
Get an array of all of the keys for the hash table.
Definition: TTHash.cpp:126
TTHashPtr internals
An hash table to store any internal TTObjectBases (like TTData, TTViewer, ...)
void prepend(const TTValue &aValueToPrepend)
Insert another TTValue before the first element.
Definition: TTValue.h:162
void append(const T &anElementValueToAppend)
Insert a single TTElement at the end.
Definition: TTValue.h:243
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 data_inc(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
Increase parameter value in steps.
void JAMOMA_EXPORT jamoma_ttvalue_to_Atom(const TTValue &v, long *argc, t_atom **argv)
Make an Atom array from a TTValue.
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
TTErr append(const TTSymbol key, const TTValue &value)
Insert an item into the hash table.
Definition: TTHash.cpp:70
TTHandle inlets
an array of inlets
TTErr JAMOMA_EXPORT jamoma_data_command(TTObject &aData, t_symbol *msg, long argc, const t_atom *argv)
Set the TTData value attribute using the #TTData::Command method.
int C74_EXPORT main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.
TTBoolean iterateInternals
The flag is true when an iteration is done on the internals.
TTBoolean isEmpty()
Return true if the hash has nothing stored in it.
Definition: TTHash.cpp:205
void JAMOMA_EXPORT jamoma_ttvalue_to_typed_Atom(const TTValue &v, t_symbol **msg, long *argc, t_atom **argv, TTBoolean &shifted)
Make a typed Atom array from a TTValue.
void data_list(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
Process an incoming message containing a list.
std::int32_t TTInt32
32 bit signed integer
Definition: TTBase.h:177
void JAMOMA_EXPORT jamoma_ttvalue_from_Atom(TTValue &v, t_symbol *msg, long argc, const t_atom *argv)
Make a TTValue from Atom array.
void data_bang(TTPtr self)
Process an incoming 'bang' message.
void clear()
Clear all values from the vector, leaving with size of 0.
Definition: TTValue.h:131
Data Structure for this object.
TTErr remove(const TTSymbol key)
Remove an item from the hash table.
Definition: TTHash.cpp:108
Wraps Jamoma Core classes as objects for Max/MSP.
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
TTBoolean useInternals
The hash table can be used as an array of wrappedObject.
void data_dec(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
Decrease parameter value in steps.
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...
The TTString class is used to represent a string.
Definition: TTString.h:34
TTUInt32 JAMOMA_EXPORT jamoma_parse_bracket(t_symbol *s, TTString &si_format, TTString &ss_format)
Returned the N inside "pp/xx.[N]/yyy" and a format string as "pp/xx.%d/yy" and a format string as "pp...
long index
index of the inlet used
TTSymbol cursor
to select an entry in x->internals
void data_float(TTPtr self, double value)
Process an incoming float value.
void data_assist(TTPtr self, TTPtr b, long msg, long arg, char *dst)
Provide assistance on input and output while patching.
TTBoolean valid() const
Determine if the object contained by this TTObject is truly ready for use.
Definition: TTObject.cpp:179
WrappedModularInstance * WrappedModularInstancePtr
Pointer to a wrapped instance of our object.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTUInt16 getReferenceCount()
Query an object to get its current reference count.
Definition: TTObjectBase.h:144