21 typedef struct _receive{
37 void *
receive_new(t_symbol *s,
long argc, t_atom *argv);
55 t_max_err receive_setaddress(
t_receive *x,
void *attr,
long argc, t_atom *argv);
56 t_max_err receive_getaddress(
t_receive *x,
void *attr, AtomCount *argc, AtomPtr *argv);
58 t_max_err receive_setattribute(
t_receive *x,
void *attr,
long argc, t_atom *argv);
59 t_max_err receive_getattribute(
t_receive *x,
void *attr, AtomCount *argc, AtomPtr *argv);
61 t_max_err receive_setenable(
t_receive *x,
void *attr,
long argc, t_atom *argv);
62 t_max_err receive_getenable(
t_receive *x,
void *attr, AtomCount *argc, AtomPtr *argv);
64 void receive_return_address(
t_receive *x, t_symbol *mess,
long argc, t_atom *argv);
65 void receive_return_value(
t_receive *x, t_symbol *mess,
long argc, t_atom *argv);
67 void receive_build(
t_receive *x, t_symbol *address);
73 void receive_symbol(
t_receive *x, t_symbol *mess,
long argc, t_atom *argv);
76 static t_class *s_receive_class;
81 void receive_initclass()
87 c = class_new(
"j.receive",
96 class_addmethod(c, (method)receive_return_address,
"return_address", A_CANT, 0);
97 class_addmethod(c, (method)receive_return_value,
"return_value", A_CANT, 0);
99 class_addmethod(c, (method)object_obex_dumpout,
"dumpout", A_CANT, 0);
102 class_addmethod(c, (method)receive_get,
"bang", 0);
105 class_addmethod(c, (method)receive_symbol,
"anything", A_GIMME, 0);
108 attr = attr_offset_new(
"address", _sym_symbol, 0, (method)receive_getaddress, (method)receive_setaddress, NULL);
109 class_addattr(c, attr);
112 attr = attr_offset_new(
"attribute", _sym_symbol, 0, (method)receive_getattribute, (method)receive_setattribute, NULL);
113 class_addattr(c, attr);
116 attr = attr_offset_new(
"enable", _sym_long, 0, (method)receive_getenable, (method)receive_setenable, NULL);
117 class_addattr(c, attr);
120 class_register(CLASS_BOX, c);
131 long attrstart = attr_args_offset(argc, argv);
138 attr_args_process(x, argc, argv);
162 strcpy(dst,
"(signal) input to the module");
165 strcpy(dst,
"output from remote");
167 strcpy(dst,
"dumpout");
173 t_max_err receive_setaddress(
t_receive *x,
void *attr,
long argc, t_atom *argv)
177 if (atom_gettype(argv) == A_SYM) {
179 v.
append(
TT(atom_getsym(argv)->s_name));
184 return MAX_ERR_GENERIC;
189 t_max_err receive_getaddress(
t_receive *x,
void *attr, AtomCount *argc, AtomPtr *argv)
197 *argv = (t_atom *)sysmem_newptr(
sizeof(t_atom));
202 atom_setsym(*argv, gensym((
char*)s.
c_str()));
205 return MAX_ERR_GENERIC;
212 t_max_err receive_setattribute(
t_receive *x,
void *attr,
long argc, t_atom *argv)
216 if (atom_gettype(argv) == A_SYM) {
218 v.
append(
TT(atom_getsym(argv)->s_name));
223 return MAX_ERR_GENERIC;
228 t_max_err receive_getattribute(
t_receive *x,
void *attr, AtomCount *argc, AtomPtr *argv)
236 *argv = (t_atom *)sysmem_newptr(
sizeof(t_atom));
241 atom_setsym(*argv, gensym((
char*)s.
c_str()));
244 return MAX_ERR_GENERIC;
250 t_max_err receive_setenable(
t_receive *x,
void *attr,
long argc, t_atom *argv)
254 if (atom_gettype(argv) == A_LONG) {
256 if (atom_getlong(argv))
265 return MAX_ERR_GENERIC;
270 t_max_err receive_getenable(
t_receive *x,
void *attr, AtomCount *argc, AtomPtr *argv)
278 *argv = (t_atom *)sysmem_newptr(
sizeof(t_atom));
283 atom_setlong(*argv, b);
286 return MAX_ERR_GENERIC;
298 void receive_symbol(
t_receive *x, t_symbol* msg,
long argc, t_atom* argv)
303 if (msg->s_name[0] == C_SEPARATOR)
312 void receive_return_address(
t_receive *x, SymbolPtr msg, AtomCount argc, AtomPtr argv)
317 void receive_return_value(
t_receive *x, SymbolPtr msg, AtomCount argc, AtomPtr argv)
319 outlet_anything(x->
data_out, msg, argc, argv);
TTErr sendMessage(const TTSymbol name)
TODO: Document this function.
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
TTErr getAttributeValue(const TTSymbol name, TTValue &value)
Get an attribute value for an object.
void receive_free(t_receive *x)
This method is called when the object is free (deleted).
TTReceiverPtr receiver
the TTObject class to receive data
TTErr setAttributeValue(const TTSymbol name, TTValue &value)
Set an attribute value for an object.
void * receive_new(t_symbol *s, long argc, t_atom *argv)
Object instantiation.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
void append(const T &anElementValueToAppend)
Insert a single TTElement at the end.
void * data_out
outlet used to output received data
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
void get(const TTUInt16 index, T &returnedElementValue) const
DEPRECATED.
t_object ob
REQUIRED: Our object.
const char * c_str() const
Return a pointer to the internal string as a C-string.
void receive_assist(t_receive *x, void *b, long msg, long arg, char *dst)
Method for displaying assist strings for inlets and outlets.
void * address_out
outlet used to output address of received data
[doxygenAppendixC_copyExample]