here I am stumbling upon something that I thought I knew, but seemingly I don't... I need to write an UI MSP object with no audio inlets or outlets. The only reason why it needs to be an MSP object is because I need to retrieve the sampling rate... exactly like filtergraph~ does it.
So in my new_method I write:
obj->inletnum = 0;
obj->proxy = proxy_new((t_object *)x, 1, &x->inletnum);
dsp_setupjbox((t_pxjbox *)x, 0);
x->out = listout((t_object *)x);
This should give me 2 non-audio proxy inlets and 1 list outlet, and it does...
Problem is that in my dsp method I need to write something like:
void myobj_dsp(t_myobj *x, t_signal **sp, short *count)
x->samplerate = sp->s_sr;
and at this point Max crashes.
So my question is do I need to instantiate a dummy signal inlet or outlet in order to retrieve the sampling rate from the t_signal structure ?
If I write:
dsp_setupjbox((t_pxjbox *)x, 1);
then everything works fine.