Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9531
Modified Files:
Tag: desiredata
desire.c
Log Message:
cleanup
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.198
retrieving revision 1.1.2.217.2.199
diff -C2 -d -r1.1.2.217.2.198 -r1.1.2.217.2.199
*** desire.c 9 Aug 2007 07:59:07 -0000 1.1.2.217.2.198
--- desire.c 11 Aug 2007 21:13:39 -0000 1.1.2.217.2.199
***************
*** 2194,2197 ****
--- 2194,2198 ----
t_gobj *y, **maxp;
canvas_each(y,x) if (y->_class==vinlet_class) n++;
+ //post("canvas_resortinlets %d",n);
if (n<2) return;
t_gobj **vec = (t_gobj **)getbytes(n*sizeof(*vec)), **vp = vec;
***************
*** 2984,2988 ****
}
! /* prolog code: loads buffer from parent patch */
t_int *vinlet_doprolog(t_int *w) {
t_vinlet *x = (t_vinlet *)w[1];
--- 2985,2989 ----
}
! /* prolog code: loads buffer from parent patch */
t_int *vinlet_doprolog(t_int *w) {
t_vinlet *x = (t_vinlet *)w[1];
***************
*** 3004,3008 ****
/* set up prolog DSP code */
- extern "C"
extern "C" void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, int myvecsize, int calcsize, int phase, int period,
int frequency, int downsample, int upsample, int reblock, int switched) {
--- 3005,3008 ----
***************
*** 3029,3035 ****
re_parentvecsize = 1;
}
! bufsize = re_parentvecsize;
! if (bufsize < myvecsize) bufsize = myvecsize;
! if (bufsize != (oldbufsize = x->bufsize)) {
t_float *buf = x->buf;
buf = (t_float *)resizealignedbytes(buf,oldbufsize * sizeof(*buf), bufsize * sizeof(*buf));
--- 3029,3035 ----
re_parentvecsize = 1;
}
! bufsize = max(re_parentvecsize,myvecsize);
! oldbufsize = x->bufsize;
! if (bufsize != oldbufsize) {
t_float *buf = x->buf;
buf = (t_float *)resizealignedbytes(buf,oldbufsize * sizeof(*buf), bufsize * sizeof(*buf));
***************
*** 3050,3061 ****
}
/* } IOhannes */
! /* if the input signal's reference count is zero, we have
! to free it here because we didn't in ugen_doit(). */
if (!insig->refcount) signal_makereusable(insig);
! } else memset((char *)(x->buf), 0, bufsize * sizeof(*x->buf));
x->directsignal = 0;
} else {
! /* no reblocking; in this case our output signal is "borrowed"
! and merely needs to be pointed to the real one. */
x->directsignal = parentsigs[inlet_getsignalindex(x->inlet)];
}
--- 3050,3059 ----
}
/* } IOhannes */
! /* if the input signal's reference count is zero, we have to free it here because we didn't in ugen_doit(). */
if (!insig->refcount) signal_makereusable(insig);
! } else memset((char *)x->buf, 0, bufsize * sizeof(*x->buf));
x->directsignal = 0;
} else {
! /* no reblocking; in this case our output signal is "borrowed" and merely needs to be pointed to the real one. */
x->directsignal = parentsigs[inlet_getsignalindex(x->inlet)];
}
***************
*** 3071,3082 ****
outlet_new(x, &s_signal);
resample_init(&x->updown);
! /* this should be though over:
! it might prove hard to provide consistency between labeled up- & downsampling methods
! maybe indeces would be better...
! up till now we provide several upsampling methods and 1 single downsampling method (no filtering !)
! */
if (s) {
char c=*s->name;
! switch(c){
case'h':case'H':x->updown.method=RESAMPLE_HOLD; break; /* up: sample and hold */
case'l':case'L':x->updown.method=RESAMPLE_LINEAR; break; /* up: linear interpolation */
--- 3069,3078 ----
outlet_new(x, &s_signal);
resample_init(&x->updown);
! /* this should be thought over: it might prove hard to provide consistency between labeled up- & downsampling methods
! maybe indices would be better...
! up till now we provide several upsampling methods and 1 single downsampling method (no filtering !) */
if (s) {
char c=*s->name;
! switch(c) {
case'h':case'H':x->updown.method=RESAMPLE_HOLD; break; /* up: sample and hold */
case'l':case'L':x->updown.method=RESAMPLE_LINEAR; break; /* up: linear interpolation */