25 TTPtr graphOutlets[16];
28 typedef Unpack* UnpackPtr;
32 UnpackPtr UnpackNew (t_symbol *msg,
long argc, t_atom* argv);
33 void UnpackFree (UnpackPtr
self);
34 void UnpackAssist (UnpackPtr
self,
void* b,
long msg,
long arg,
char* dst);
35 void UnpackGraphCallback (UnpackPtr
self,
TTValue& arg);
39 static t_class* sUnpackClass;
50 common_symbols_init();
52 c = class_new(
"j.unpack-", (method)UnpackNew, (method)UnpackFree,
sizeof(Unpack), (method)0L, A_GIMME, 0);
54 class_addmethod(c, (method)MaxGraphReset,
"graph.reset", A_CANT, 0);
55 class_addmethod(c, (method)MaxGraphConnect,
"graph.connect", A_OBJ, A_LONG, 0);
56 class_addmethod(c, (method)MaxGraphDrop,
"graph.drop", A_CANT, 0);
57 class_addmethod(c, (method)MaxGraphObject,
"graph.object", A_CANT, 0);
59 class_addmethod(c, (method)UnpackAssist,
"assist", A_CANT, 0);
60 class_addmethod(c, (method)object_obex_dumpout,
"dumpout", A_CANT, 0);
62 class_register(_sym_box, c);
71 UnpackPtr UnpackNew(t_symbol *msg,
long argc, t_atom* argv)
77 self = UnpackPtr(object_alloc(sUnpackClass));
79 object_obex_store((
void*)
self, _sym_dumpout, (t_object*)outlet_new(
self, NULL));
80 self->graphOutlets[0] = outlet_new(
self, NULL);
83 v[0] =
"graph.output";
87 if (!self->graphObject->mKernel.valid()) {
88 object_error(SELF,
"cannot load Jamoma object");
92 self->callback =
new TTObject(
"callback");
93 self->callback->set(
TT(
"function"),
TTPtr(&UnpackGraphCallback));
94 self->callback->set(
TT(
"baton"),
TTPtr(
self));
99 self->graphObject->mKernel.registerObserverForNotifications(*self->callback);
101 attr_args_process(
self, argc, argv);
108 void UnpackFree(UnpackPtr
self)
118 void UnpackAssist(UnpackPtr
self,
void* b,
long msg,
long arg,
char* dst)
121 strcpy (dst,
"multichannel input and control messages");
124 strcpy(dst,
"multichannel output");
126 strcpy(dst,
"dumpout");
132 void UnpackGraphCallback(UnpackPtr
self,
TTValue& arg)
147 for (
int i=0; i<ac; i++) {
160 atom_setlong(ap+i, ival);
164 atom_setfloat(ap+i, v[i]);
171 atom_setsym(ap+i, gensym((
char*)s.
c_str()));
173 firstItemASymbol = YES;
179 if (firstItemASymbol)
180 outlet_anything(self->graphOutlets[0], gensym((
char*)firstItem.
c_str()), ac-1, ap+1);
182 outlet_float(self->graphOutlets[0], atom_getfloat(ap));
184 outlet_anything(self->graphOutlets[0], _sym_list, ac, ap);
The TTGraphObjectBase wraps a TTDSP object such that it is possible to build a dynamic graph of audio...
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
TTErr TTObjectBaseRelease(TTObjectBasePtr *anObject)
DEPRECATED.
8-bit unsigned integer, range is 0 through 255.
Create and use Jamoma object instances.
64-bit unsigned integer, range is 0 through 18,446,744,073,709,551,615.
size_type size() const noexcept
Return the number of elements.
Base class for all first-class Jamoma objects.
TTErr(TTObjectBase::* TTMethod)(const TTSymbol methodName, const TTValue &anInputValue, TTValue &anOutputValue)
A type that can be used to store a pointer to a message for an object.
TTErr getValue(T &aReturnedValue) const
Get the dictionary's primary value.
16-bit unsigned integer, range is 0 through 65,535.
A type that represents the key as a C-String and the value as a pointer to the matching TTSymbol obje...
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
void * TTPtr
A generic pointer.
int C74_EXPORT main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.
This class is used to create a backward communication channel to notify a client that something chang...
16-bit signed integer, range is −32,768 through 32,767.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
TTErr TTObjectBaseInstantiate(const TTSymbol className, TTObjectBasePtr *returnedObjectPtr, const TTValue arguments)
DEPRECATED.
const char * c_str() const
Return a pointer to the internal string as a C-string.
std::int32_t TTInt32
32 bit signed integer
64-bit signed integer, ragne is −9,223,372,036,854,775,808 through 9,223,372,036,854,775,807
Set this flag if the method you are binding to this message is prototyped with a single TTValue& argu...
32-bit signed integer, range is -2,147,483,648 through 2,147,483,647.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
32-bit unsigned integer, range is 0 through 4,294,967,295.
8-bit signed integer, range is -128 through 127.
TTErr notify(const TTValue &anInputValue, TTValue &anUnusedOutputValue)
Message called because we are registered as an observer to some other object, and then calls our exte...
TTDictionary * TTDictionaryPtr
[doxygenAppendixC_typedefExample]
void resize(size_type n)
Change the number of elements.
[doxygenAppendixC_copyExample]