Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3669
Modified Files:
Tag: desiredata
makefile.in d_ugen.c desire.c
Log Message:
d_ugen.c goes c++
Index: makefile.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile.in,v
retrieving revision 1.4.4.2.2.21.2.27
retrieving revision 1.4.4.2.2.21.2.28
diff -C2 -d -r1.4.4.2.2.21.2.27 -r1.4.4.2.2.21.2.28
*** makefile.in 28 Jun 2007 06:41:25 -0000 1.4.4.2.2.21.2.27
--- makefile.in 28 Jun 2007 08:33:34 -0000 1.4.4.2.2.21.2.28
***************
*** 22,27 ****
SRCXX = desire.c kernel.c builtins.c builtins_dsp.c s_path.c s_inter.c s_main.c \
! m_sched.c s_loader.c d_soundfile.c
! SRC = m_fifo.c m_simd.c s_audio.c s_midi.c d_ugen.c d_mayer_fft.c d_fftroutine.c d_resample.c
# audio drivers and midi drivers
--- 22,27 ----
SRCXX = desire.c kernel.c builtins.c builtins_dsp.c s_path.c s_inter.c s_main.c \
! m_sched.c s_loader.c d_soundfile.c d_ugen.c
! SRC = m_fifo.c m_simd.c s_audio.c s_midi.c d_mayer_fft.c d_fftroutine.c d_resample.c
# audio drivers and midi drivers
Index: d_ugen.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_ugen.c,v
retrieving revision 1.3.4.1.2.5.2.5
retrieving revision 1.3.4.1.2.5.2.6
diff -C2 -d -r1.3.4.1.2.5.2.5 -r1.3.4.1.2.5.2.6
*** d_ugen.c 9 Jan 2007 16:59:00 -0000 1.3.4.1.2.5.2.5
--- d_ugen.c 28 Jun 2007 08:33:34 -0000 1.3.4.1.2.5.2.6
***************
*** 37,40 ****
--- 37,41 ----
struct _voutlet;
+ extern "C" {
void vinlet_dspprolog(struct _vinlet *x, t_signal **parentsigs,
int myvecsize, int calcsize, int phase, int period, int frequency,
***************
*** 46,49 ****
--- 47,51 ----
int myvecsize, int calcsize, int phase, int period, int frequency,
int downsample, int upsample, int reblock, int switched);
+ };
t_int *zero_perform(t_int *w) /* zero out a vector */
***************
*** 159,164 ****
{
int upsample, downsample; /* IOhannes */
! int calcsize = fcalcsize;
! int overlap = foverlap;
int dspstate = canvas_suspend_dsp();
int vecsize;
--- 161,166 ----
{
int upsample, downsample; /* IOhannes */
! int calcsize = (int)fcalcsize;
! int overlap = (int)foverlap;
int dspstate = canvas_suspend_dsp();
int vecsize;
***************
*** 171,178 ****
if (fupsample <= 0) upsample = downsample = 1;
else if (fupsample >= 1) {
! upsample = fupsample;
downsample = 1;
} else {
! downsample = 1.0 / fupsample;
upsample = 1;
}
--- 173,180 ----
if (fupsample <= 0) upsample = downsample = 1;
else if (fupsample >= 1) {
! upsample = (int)fupsample;
downsample = 1;
} else {
! downsample = int(1.0 / fupsample);
upsample = 1;
}
***************
*** 378,405 ****
/* call this when DSP is stopped to free all the signals */
! void signal_cleanup(void)
! {
t_signal *sig;
! int i;
! while (sig = signal_usedlist)
! {
signal_usedlist = sig->s_nextused;
! if (!sig->s_isborrowed)
! {
#ifndef VECTORALIGNMENT
! free(sig->s_vec);
#else
! freealignedbytes(sig->s_vec, sig->s_vecsize * sizeof (*sig->s_vec));
#endif
! }
free(sig);
}
! for (i = 0; i <= MAXLOGSIG; i++)
! signal_freelist[i] = 0;
signal_freeborrowed = 0;
}
/* mark the signal "reusable." */
! void signal_makereusable(t_signal *sig)
{
int logn = ilog2(sig->s_vecsize);
--- 380,403 ----
/* call this when DSP is stopped to free all the signals */
! void signal_cleanup() {
t_signal *sig;
! while ((sig = signal_usedlist)) {
signal_usedlist = sig->s_nextused;
! if (!sig->s_isborrowed) {
#ifndef VECTORALIGNMENT
! free(sig->s_vec);
#else
! freealignedbytes(sig->s_vec, sig->s_vecsize * sizeof (*sig->s_vec));
#endif
! }
free(sig);
}
! int i;
! for (i = 0; i <= MAXLOGSIG; i++) signal_freelist[i] = 0;
signal_freeborrowed = 0;
}
/* mark the signal "reusable." */
! extern "C" void signal_makereusable(t_signal *sig)
{
int logn = ilog2(sig->s_vecsize);
***************
*** 456,461 ****
t_signal *ret, **whichlist;
logn = ilog2(n);
! if (n)
! {
if ((vecsize = (1<<logn)) != n)
vecsize *= 2;
--- 454,458 ----
t_signal *ret, **whichlist;
logn = ilog2(n);
! if (n) {
if ((vecsize = (1<<logn)) != n)
vecsize *= 2;
***************
*** 463,475 ****
bug("signal buffer too large");
whichlist = signal_freelist + logn;
! }
! else
! whichlist = &signal_freeborrowed;
/* first try to reclaim one from the free list */
! if (ret = *whichlist)
*whichlist = ret->s_nextfree;
! else
! {
/* LATER figure out what to do for out-of-space here! */
ret = (t_signal *)t_getbytes(sizeof *ret);
--- 460,470 ----
bug("signal buffer too large");
whichlist = signal_freelist + logn;
! } else whichlist = &signal_freeborrowed;
/* first try to reclaim one from the free list */
! ret = *whichlist;
! if (ret)
*whichlist = ret->s_nextfree;
! else {
/* LATER figure out what to do for out-of-space here! */
ret = (t_signal *)t_getbytes(sizeof *ret);
***************
*** 483,489 ****
#endif
ret->s_isborrowed = 0;
! }
! else
! {
ret->s_vec = 0;
ret->s_isborrowed = 1;
--- 478,482 ----
#endif
ret->s_isborrowed = 0;
! } else {
ret->s_vec = 0;
ret->s_isborrowed = 1;
***************
*** 506,510 ****
}
! void signal_setborrowed(t_signal *sig, t_signal *sig2)
{
if (!sig->s_isborrowed || sig->s_borrowedfrom)
--- 499,503 ----
}
! extern "C" void signal_setborrowed(t_signal *sig, t_signal *sig2)
{
if (!sig->s_isborrowed || sig->s_borrowedfrom)
***************
*** 630,635 ****
/* start building the graph for a canvas */
! t_dspcontext *ugen_start_graph(int toplevel, t_signal **sp,
! int ninlets, int noutlets)
{
t_dspcontext *dc = (t_dspcontext *)getbytes(sizeof(*dc));
--- 623,627 ----
/* start building the graph for a canvas */
! extern "C" t_dspcontext *ugen_start_graph(int toplevel, t_signal **sp, int ninlets, int noutlets)
{
t_dspcontext *dc = (t_dspcontext *)getbytes(sizeof(*dc));
***************
*** 646,651 ****
/* first the canvas calls this to create all the boxes... */
! void ugen_add(t_dspcontext *dc, t_object *obj)
! {
t_ugenbox *x = (t_ugenbox *)getbytes(sizeof *x);
int i;
--- 638,642 ----
/* first the canvas calls this to create all the boxes... */
! extern "C" void ugen_add(t_dspcontext *dc, t_object *obj) {
t_ugenbox *x = (t_ugenbox *)getbytes(sizeof *x);
int i;
***************
*** 667,673 ****
/* and then this to make all the connections. */
! void ugen_connect(t_dspcontext *dc, t_object *x1, int outno, t_object *x2,
! int inno)
! {
t_ugenbox *u1, *u2;
t_sigoutlet *uout;
--- 658,662 ----
/* and then this to make all the connections. */
! extern "C" void ugen_connect(t_dspcontext *dc, t_object *x1, int outno, t_object *x2, int inno) {
t_ugenbox *u1, *u2;
t_sigoutlet *uout;
***************
*** 753,757 ****
/* post("%s: unconnected signal inlet set to zero",
class_getname(u->u_obj->ob_pd)); */
! if (scalar = obj_findsignalscalar(u->u_obj, i))
dsp_add_scalarcopy(scalar, s3->s_vec, s3->s_n);
else
--- 742,746 ----
/* post("%s: unconnected signal inlet set to zero",
class_getname(u->u_obj->ob_pd)); */
! if ((scalar = obj_findsignalscalar(u->u_obj, i)))
dsp_add_scalarcopy(scalar, s3->s_vec, s3->s_n);
else
***************
*** 832,838 ****
u2 = oc->oc_who;
uin = &u2->u_in[oc->oc_inno];
! /* if there's already someone here, sum the two */
! if (s2 = uin->i_signal)
! {
s1->s_refcount--;
s2->s_refcount--;
--- 821,827 ----
u2 = oc->oc_who;
uin = &u2->u_in[oc->oc_inno];
! /* if there's already someone here, sum the two */
! s2 = uin->i_signal;
! if (s2) {
s1->s_refcount--;
s2->s_refcount--;
***************
*** 1167,1171 ****
} t_samplerate;
! void *canvas_getblock(t_class *blockclass, t_canvas **canvasp);
static void samplerate_tilde_bang(t_samplerate *x)
--- 1156,1160 ----
} t_samplerate;
! extern "C" void *canvas_getblock(t_class *blockclass, t_canvas **canvasp);
static void samplerate_tilde_bang(t_samplerate *x)
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.139
retrieving revision 1.1.2.217.2.140
diff -C2 -d -r1.1.2.217.2.139 -r1.1.2.217.2.140
*** desire.c 28 Jun 2007 07:53:10 -0000 1.1.2.217.2.139
--- desire.c 28 Jun 2007 08:33:34 -0000 1.1.2.217.2.140
***************
*** 938,947 ****
typedef struct _dspcontext t_dspcontext;
! extern "C" void ugen_start ();
! extern "C" void ugen_stop ();
extern "C" t_dspcontext *ugen_start_graph(int toplevel, t_signal **sp, int ninlets, int noutlets);
extern "C" void ugen_add(t_dspcontext *dc, t_object *x);
extern "C" void ugen_connect(t_dspcontext *dc, t_object *from, int outlet, t_object *to, int inlet);
! extern "C" void ugen_done_graph(t_dspcontext *dc);
/* schedule one canvas for DSP. This is called below for all "root"
--- 938,947 ----
typedef struct _dspcontext t_dspcontext;
! extern void ugen_start ();
! extern void ugen_stop ();
extern "C" t_dspcontext *ugen_start_graph(int toplevel, t_signal **sp, int ninlets, int noutlets);
extern "C" void ugen_add(t_dspcontext *dc, t_object *x);
extern "C" void ugen_connect(t_dspcontext *dc, t_object *from, int outlet, t_object *to, int inlet);
! extern void ugen_done_graph(t_dspcontext *dc);
/* schedule one canvas for DSP. This is called below for all "root"
***************
*** 3200,3204 ****
/* set up prolog DSP code */
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) {
t_signal *insig;
--- 3200,3204 ----
/* 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) {
t_signal *insig;
***************
*** 3401,3406 ****
back to whatever we see on our input during the "dsp" method
called later. */
! extern "C"
! void voutlet_dspprolog(t_voutlet *x, t_signal **parentsigs, int myvecsize, int calcsize, int phase, int period,
int frequency, int downsample, int upsample, int reblock, int switched) {
x->updown.downsample=downsample; x->updown.upsample=upsample; /* IOhannes */
--- 3401,3405 ----
back to whatever we see on our input during the "dsp" method
called later. */
! extern "C" void voutlet_dspprolog(t_voutlet *x, t_signal **parentsigs, int myvecsize, int calcsize, int phase, int period,
int frequency, int downsample, int upsample, int reblock, int switched) {
x->updown.downsample=downsample; x->updown.upsample=upsample; /* IOhannes */
***************
*** 7884,7888 ****
#define S(name) void name##_setup (); name##_setup();
void conf_init_plus () {
! S(builtins) S(builtins_dsp) S(desire) S(d_soundfile)
}
--- 7883,7887 ----
#define S(name) void name##_setup (); name##_setup();
void conf_init_plus () {
! S(builtins) S(builtins_dsp) S(desire) S(d_soundfile) S(d_ugen)
}
***************
*** 7891,7895 ****
void conf_init () {
conf_init_plus();
- S(d_ugen)
}
};
--- 7890,7893 ----