24 TTPtr graphOutlets[16];
25 t_symbol* attrDataspace;
29 typedef Dataspace* DataspacePtr;
33 DataspacePtr DataspaceNew (t_symbol* msg,
long argc, t_atom* argv);
34 void DataspaceFree (DataspacePtr
self);
35 void DataspaceAssist (DataspacePtr
self,
void* b,
long msg,
long arg,
char* dst);
36 t_max_err DataspaceSetDataspace (DataspacePtr
self,
void* attr,
long argc, t_atom* argv);
37 t_max_err DataspaceSetInput (DataspacePtr
self,
void* attr,
long argc, t_atom* argv);
38 t_max_err DataspaceGetInput (DataspacePtr
self,
void* attr,
long* argc, t_atom** argv);
39 t_max_err DataspaceSetOutput (DataspacePtr
self,
void* attr,
long argc, t_atom* argv);
40 t_max_err DataspaceGetOutput (DataspacePtr
self,
void* attr,
long* argc, t_atom** argv);
44 static t_class* sDataspaceClass;
55 common_symbols_init();
57 c = class_new(
"j.unit-", (method)DataspaceNew, (method)DataspaceFree,
sizeof(Dataspace), (method)0L, A_GIMME, 0);
59 class_addmethod(c, (method)MaxGraphReset,
"graph.reset", A_CANT, 0);
60 class_addmethod(c, (method)MaxGraphSetup,
"graph.setup", A_CANT, 0);
61 class_addmethod(c, (method)MaxGraphConnect,
"graph.connect", A_OBJ, A_LONG, 0);
62 class_addmethod(c, (method)MaxGraphDrop,
"graph.drop", A_CANT, 0);
63 class_addmethod(c, (method)MaxGraphObject,
"graph.object", A_CANT, 0);
65 class_addmethod(c, (method)DataspaceAssist,
"assist", A_CANT, 0);
66 class_addmethod(c, (method)object_obex_dumpout,
"dumpout", A_CANT, 0);
68 CLASS_ATTR_SYM(c,
"dataspace", 0, Dataspace, attrDataspace);
69 CLASS_ATTR_ACCESSORS(c,
"dataspace", NULL, DataspaceSetDataspace);
71 CLASS_ATTR_SYM(c,
"input", 0, Dataspace, attrInput);
72 CLASS_ATTR_ACCESSORS(c,
"input", DataspaceGetInput, DataspaceSetInput);
74 CLASS_ATTR_SYM(c,
"output", 0, Dataspace, attrOutput);
75 CLASS_ATTR_ACCESSORS(c,
"output", DataspaceGetInput, DataspaceSetOutput);
77 class_register(_sym_box, c);
86 DataspacePtr DataspaceNew(t_symbol* msg,
long argc, t_atom* argv)
92 self = DataspacePtr(object_alloc(sDataspaceClass));
94 object_obex_store((
void*)
self, _sym_dumpout, (t_object*)outlet_new(
self, NULL));
95 self->graphOutlets[0] = outlet_new(
self,
"graph.connect");
96 self->attrDataspace = _sym_none;
103 if (!self->graphObject->mKernel.valid()) {
104 object_error(SELF,
"cannot load Jamoma object");
108 attr_args_process(
self, argc, argv);
115 void DataspaceFree(DataspacePtr
self)
125 void DataspaceAssist(DataspacePtr
self,
void* b,
long msg,
long arg,
char* dst)
128 strcpy (dst,
"dictionary input and control messages");
131 strcpy(dst,
"dictionary output");
133 strcpy(dst,
"dumpout");
140 t_max_err DataspaceSetDataspace(DataspacePtr
self,
void* attr,
long argc, t_atom* argv)
143 self->attrDataspace = atom_getsym(argv);
144 self->graphObject->mKernel.set(
TT(
"dataspace"),
TT(self->attrDataspace->s_name));
150 t_max_err DataspaceSetInput(DataspacePtr
self,
void* attr,
long argc, t_atom* argv)
153 self->attrInput = atom_getsym(argv);
154 self->graphObject->mKernel.set(
TT(
"inputUnit"),
TT(self->attrInput->s_name));
160 t_max_err DataspaceGetInput(DataspacePtr
self,
void* attr,
long* argc, t_atom** argv)
165 if (*argc && *argv) {
166 self->graphObject->mKernel.get(
TT(
"inputUnit"), v);
168 atom_setsym(*argv, gensym(s.
c_str()));
174 t_max_err DataspaceSetOutput(DataspacePtr
self,
void* attr,
long argc, t_atom* argv)
177 self->attrOutput = atom_getsym(argv);
178 self->graphObject->mKernel.set(
TT(
"outputUnit"),
TT(self->attrOutput->s_name));
184 t_max_err DataspaceGetOutput(DataspacePtr
self,
void* attr,
long* argc, t_atom** argv)
189 if (*argc && *argv) {
190 self->graphObject->mKernel.get(
TT(
"outputUnit"), v);
192 atom_setsym(*argv, gensym(s.
c_str()));
The TTGraphObjectBase wraps a TTDSP object such that it is possible to build a dynamic graph of audio...
TTErr TTObjectBaseRelease(TTObjectBasePtr *anObject)
DEPRECATED.
Base class for all first-class Jamoma objects.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
void * TTPtr
A generic pointer.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
int C74_EXPORT main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.
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.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
void resize(size_type n)
Change the number of elements.
[doxygenAppendixC_copyExample]