22 typedef struct _audioreceive{
31 float *audio_out[MAX_NUM_CHANNELS];
32 void *outlets[MAX_NUM_CHANNELS];
89 static t_class *s_audioreceive_class;
94 void receive_tilde_initclass(
void)
108 class_addmethod(c, (method)object_obex_dumpout,
"dumpout", A_CANT,0);
111 attr = attr_offset_new(
"target", _sym_symbol, attrflags,
113 class_addattr(c, attr);
120 class_register(CLASS_BOX, c);
121 s_audioreceive_class = c;
131 long attrstart = attr_args_offset(argc, argv);
136 x->
dumpout = outlet_new(x, NULL);
137 object_obex_store(x, _sym_dumpout, (t_object *)x->
dumpout);
142 for (i=0; i<attrstart; i++) {
143 if (argv[i].a_type == A_LONG)
145 else if (argv[i].a_type == A_SYM)
149 dsp_setup((t_pxobject *)x, 1);
151 x->outlets[i] = outlet_new(x,
"signal");
153 x->obj.z_misc = Z_NO_INPLACE;
154 attr_args_process(x, argc, argv);
162 dsp_free((t_pxobject *)x);
173 strcpy(dst,
"input to send to a named module");
175 strcpy(dst,
"dumpout");
183 t_symbol **moduleNames = NULL;
187 jamoma_get_all_module_names(&numModules, &moduleNames);
189 atom_setsym(a+0, SymbolGen(
"clear"));
190 outlet_anything(x->
dumpout, SymbolGen(
"menu"), 1, a);
192 atom_setsym(a+0, SymbolGen(
"append"));
193 for (i=0; i<numModules; i++) {
194 atom_setsym(a+1, moduleNames[i]);
195 outlet_anything(x->
dumpout, SymbolGen(
"menu"), 2, a);
198 sysmem_freeptr(moduleNames);
208 float *vector = NULL;
212 for (channel = 0; channel < x->
num_outputs; channel++) {
214 object_method(x->
obj_direct_target, SymbolGen(
"getAudioForChannel"), channel, &vector);
233 hub = jamoma_get_hub_for_module_named(x->
attr_target);
239 x->
obj_direct_target = (t_object*)object_method(hub, SymbolGen(
"getobj_audioout"));
243 for (i=0, j=0; i<numOutputs; i++) {
246 x->
audio_out[i] = (t_float*)sp[i+1]->s_vec;
264 hub = jamoma_get_hub_for_module_named(x->
attr_target);
267 x->
obj_direct_target = (t_object*)object_method(hub, SymbolGen(
"getobj_audioout"));
void audioreceive_bang(t_audioreceive *x)
When banged, fill a menu with potential targets.
void * audioreceive_new(t_symbol *s, long argc, t_atom *argv)
Object instantiation.
t_object * obj_direct_target
the j.in~ object in the module we are sending to
void audioreceive_assist(t_audioreceive *x, void *b, long msg, long arg, char *dst)
Method for displaying assist strings for inlets and outlets.
Object receiving remote audio signals within a module.
void audioreceive_free(t_audioreceive *x)
This method is called when the object is free (deleted).
float * audio_out[MAX_NUM_CHANNELS]
pointers to the audio vectors
long num_outputs
spec'd as an argument
void * dumpout
dumpout outlet
int vs
cached vector-size for audio
t_symbol * attr_target
name of the module we are sending to
void audioreceive_dsp(t_audioreceive *x, t_signal **sp, short *count)
The DSP method for the object, called when compiling the audio chain.
t_object * obj_target
the hub of the module we are sending to
t_max_err audioreceive_attr_settarget(t_audioreceive *x, void *attr, long argc, t_atom *argv)
Set the name of the module we are part of as an attribute.
t_int * audioreceive_perform(t_int *w)
Audio perform method for the object.