Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17855
Modified Files: Tag: desiredata makefile.in desire.c x_midi.c s_midi.c s_stuff.h x_net.c Log Message: switch to C++ compilation for rest of x_*.c
Index: s_stuff.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_stuff.h,v retrieving revision 1.5.4.10.2.8.2.6 retrieving revision 1.5.4.10.2.8.2.7 diff -C2 -d -r1.5.4.10.2.8.2.6 -r1.5.4.10.2.8.2.7 *** s_stuff.h 20 Dec 2006 04:01:33 -0000 1.5.4.10.2.8.2.6 --- s_stuff.h 3 Jan 2007 07:31:58 -0000 1.5.4.10.2.8.2.7 *************** *** 379,382 **** --- 379,393 ---- /* } jsarlo */
+ /* functions in x_midi.c */ + void inmidi_realtimein(int portno, int cmd); + void inmidi_byte(int portno, int byte); + void inmidi_sysex(int portno, int byte); + void inmidi_noteon(int portno, int channel, int pitch, int velo); + void inmidi_controlchange(int portno, int channel, int ctlnumber, int value); + void inmidi_programchange(int portno, int channel, int value); + void inmidi_pitchbend(int portno, int channel, int value); + void inmidi_aftertouch(int portno, int channel, int value); + void inmidi_polyaftertouch(int portno, int channel, int pitch, int value); + #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) }
Index: makefile.in =================================================================== RCS file: /cvsroot/pure-data/pd/src/makefile.in,v retrieving revision 1.4.4.2.2.21.2.18 retrieving revision 1.4.4.2.2.21.2.19 diff -C2 -d -r1.4.4.2.2.21.2.18 -r1.4.4.2.2.21.2.19 *** makefile.in 31 Dec 2006 07:27:54 -0000 1.4.4.2.2.21.2.18 --- makefile.in 3 Jan 2007 07:31:56 -0000 1.4.4.2.2.21.2.19 *************** *** 21,38 **** CFLAGS += -DINSTALL_PREFIX="$(prefix)"
! # from DesireData (matju & chun) ! SRCXX = desire.c kernel.c ! SRC = ! ! # from devel_0_39 (thomas & tim) ! SRC += m_fifo.c m_simd.c ! ! # from pd miller ! SRC += m_sched.c s_main.c s_inter.c s_loader.c s_path.c s_audio.c s_midi.c \ ! d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc.c \ ! d_math.c d_fft.c d_mayer_fft.c d_fftroutine.c d_array.c d_global.c \ ! d_delay.c d_resample.c d_soundfile.c \ x_arithmetic.c x_connective.c x_midi.c x_misc.c \ x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c x_list.c
# audio drivers and midi drivers --- 21,32 ---- CFLAGS += -DINSTALL_PREFIX="$(prefix)"
! SRCXX = desire.c kernel.c \ x_arithmetic.c x_connective.c x_midi.c x_misc.c \ x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c x_list.c + SRC = m_fifo.c m_simd.c \ + m_sched.c s_main.c s_inter.c s_loader.c s_path.c s_audio.c s_midi.c \ + d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc.c \ + d_math.c d_fft.c d_mayer_fft.c d_fftroutine.c d_array.c d_global.c \ + d_delay.c d_resample.c d_soundfile.c
# audio drivers and midi drivers
Index: s_midi.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_midi.c,v retrieving revision 1.4.4.1.2.12.2.5 retrieving revision 1.4.4.1.2.12.2.6 diff -C2 -d -r1.4.4.1.2.12.2.5 -r1.4.4.1.2.12.2.6 *** s_midi.c 20 Dec 2006 08:12:26 -0000 1.4.4.1.2.12.2.5 --- s_midi.c 3 Jan 2007 07:31:58 -0000 1.4.4.1.2.12.2.6 *************** *** 6,9 **** --- 6,10 ----
#include "desire.h" + #include "s_stuff.h" #ifdef UNISTD #include <unistd.h> *************** *** 247,261 **** #define MIDIRESET 0xff /* 0 */
- /* functions in x_midi.c */ - void inmidi_realtimein(int portno, int cmd); - void inmidi_byte(int portno, int byte); - void inmidi_sysex(int portno, int byte); - void inmidi_noteon(int portno, int channel, int pitch, int velo); - void inmidi_controlchange(int portno, int channel, int ctlnumber, int value); - void inmidi_programchange(int portno, int channel, int value); - void inmidi_pitchbend(int portno, int channel, int value); - void inmidi_aftertouch(int portno, int channel, int value); - void inmidi_polyaftertouch(int portno, int channel, int pitch, int value); - static void sys_dispatchnextmidiin( void) { static t_midiparser parser[MAXMIDIINDEV], *parserp; --- 248,251 ----
Index: x_midi.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_midi.c,v retrieving revision 1.2.8.6 retrieving revision 1.2.8.6.2.1 diff -C2 -d -r1.2.8.6 -r1.2.8.6.2.1 *** x_midi.c 28 Aug 2006 13:48:15 -0000 1.2.8.6 --- x_midi.c 3 Jan 2007 07:31:58 -0000 1.2.8.6.2.1 *************** *** 6,9 **** --- 6,12 ----
#include "m_pd.h" + #include "s_stuff.h" + + extern "C" { void outmidi_noteon(int portno, int channel, int pitch, int velo); void outmidi_controlchange(int portno, int channel, int ctlno, int value); *************** *** 13,17 **** void outmidi_polyaftertouch(int portno, int channel, int pitch, int value); void outmidi_mclk(int portno); ! /* ----------------------- midiin and sysexin ------------------------- */
--- 16,20 ---- void outmidi_polyaftertouch(int portno, int channel, int pitch, int value); void outmidi_mclk(int portno); ! }; /* ----------------------- midiin and sysexin ------------------------- */
*************** *** 189,197 **** static void *ctlin_new(t_symbol *s, int argc, t_atom *argv) { - int ctlno, channel; t_ctlin *x = (t_ctlin *)pd_new(ctlin_class); ! if (!argc) ctlno = -1; ! else ctlno = atom_getfloatarg(0, argc, argv); ! channel = atom_getfloatarg(1, argc, argv); x->x_channel = channel; x->x_ctlno = ctlno; --- 192,198 ---- static void *ctlin_new(t_symbol *s, int argc, t_atom *argv) { t_ctlin *x = (t_ctlin *)pd_new(ctlin_class); ! int ctlno = (int)(argc ? atom_getfloatarg(0, argc, argv) : -1); ! int channel = (int)atom_getfloatarg(1, argc, argv); x->x_channel = channel; x->x_ctlno = ctlno; *************** *** 562,583 **** void inmidi_clk(double timing) { - static float prev = 0; static float count = 0; ! float cur,diff; ! ! if (midiclkin_sym->s_thing) ! { t_atom at[2]; ! diff =timing - prev; count++; ! ! if (count == 3) ! { /* 24 count per quoter note */ ! SETFLOAT(at, 1 ); count = 0; ! } ! else SETFLOAT(at, 0); ! SETFLOAT(at+1, diff); pd_list(midiclkin_sym->s_thing, &s_list, 2, at); --- 563,576 ---- void inmidi_clk(double timing) { static float prev = 0; static float count = 0; ! if (midiclkin_sym->s_thing) { t_atom at[2]; ! float diff = timing - prev; count++; ! if (count == 3) { /* 24 count per quoter note */ ! SETFLOAT(at, 1); count = 0; ! } else SETFLOAT(at, 0); SETFLOAT(at+1, diff); pd_list(midiclkin_sym->s_thing, &s_list, 2, at); *************** *** 668,674 **** }
! static void midiout_float(t_midiout *x, t_floatarg f) ! { ! sys_putmidibyte(x->x_portno - 1, f); }
--- 661,666 ---- }
! static void midiout_float(t_midiout *x, t_floatarg f){ ! sys_putmidibyte((int)x->x_portno-1, (int)f); }
*************** *** 703,713 **** }
! static void noteout_float(t_noteout *x, t_float f) ! { ! int binchan = x->x_channel - 1; ! if (binchan < 0) ! binchan = 0; ! outmidi_noteon((binchan >> 4), ! (binchan & 15), (int)f, (int)x->x_velo); }
--- 695,702 ---- }
! static void noteout_float(t_noteout *x, t_float f) { ! int binchan = (int)x->x_channel - 1; ! if (binchan < 0) binchan = 0; ! outmidi_noteon((binchan >> 4), (binchan & 15), (int)f, (int)x->x_velo); }
*************** *** 745,749 **** static void ctlout_float(t_ctlout *x, t_float f) { ! int binchan = x->x_channel - 1; if (binchan < 0) binchan = 0; --- 734,738 ---- static void ctlout_float(t_ctlout *x, t_float f) { ! int binchan = (int)x->x_channel - 1; if (binchan < 0) binchan = 0; *************** *** 782,793 **** static void pgmout_float(t_pgmout *x, t_floatarg f) { ! int binchan = x->x_channel - 1; ! int n = f - 1; ! if (binchan < 0) ! binchan = 0; ! if (n < 0) n = 0; ! else if (n > 127) n = 127; ! outmidi_programchange((binchan >> 4), ! (binchan & 15), n); }
--- 771,779 ---- static void pgmout_float(t_pgmout *x, t_floatarg f) { ! int binchan = (int)x->x_channel - 1; ! int n = (int)f - 1; ! if (binchan < 0) binchan = 0; ! if (n < 0) n = 0; else if (n > 127) n = 127; ! outmidi_programchange((binchan >> 4), (binchan & 15), n); }
*************** *** 822,826 **** static void bendout_float(t_bendout *x, t_float f) { ! int binchan = x->x_channel - 1; int n = (int)f + 8192; if (binchan < 0) --- 808,812 ---- static void bendout_float(t_bendout *x, t_float f) { ! int binchan = (int)x->x_channel - 1; int n = (int)f + 8192; if (binchan < 0) *************** *** 858,862 **** static void touchout_float(t_touchout *x, t_float f) { ! int binchan = x->x_channel - 1; if (binchan < 0) binchan = 0; --- 844,848 ---- static void touchout_float(t_touchout *x, t_float f) { ! int binchan = (int)x->x_channel - 1; if (binchan < 0) binchan = 0; *************** *** 896,903 **** static void polytouchout_float(t_polytouchout *x, t_float n) { ! int binchan = x->x_channel - 1; ! if (binchan < 0) ! binchan = 0; ! outmidi_polyaftertouch((binchan >> 4), (binchan & 15), x->x_pitch, n); }
--- 882,888 ---- static void polytouchout_float(t_polytouchout *x, t_float n) { ! int binchan = (int)x->x_channel - 1; ! if (binchan < 0) binchan = 0; ! outmidi_polyaftertouch((binchan >> 4), (binchan & 15), (int)x->x_pitch, (int)n); }
*************** *** 953,960 **** outlet_float(x->x_pitchout, hang->h_pitch); if (x->x_hang == hang) x->x_hang = hang->h_next; ! else for (h2 = x->x_hang; h3 = h2->h_next; h2 = h3) ! { ! if (h3 == hang) ! { h2->h_next = h3->h_next; break; --- 938,943 ---- outlet_float(x->x_pitchout, hang->h_pitch); if (x->x_hang == hang) x->x_hang = hang->h_next; ! else for (h2 = x->x_hang; (h3 = h2->h_next); h2 = h3) { ! if (h3 == hang) { h2->h_next = h3->h_next; break; *************** *** 983,987 **** { t_hang *hang; ! while (hang = x->x_hang) { outlet_float(x->x_velout, 0); --- 966,970 ---- { t_hang *hang; ! while ((hang = x->x_hang)) { outlet_float(x->x_velout, 0); *************** *** 996,1001 **** { t_hang *hang; ! while (hang = x->x_hang) ! { x->x_hang = hang->h_next; clock_free(hang->h_clock); --- 979,983 ---- { t_hang *hang; ! while ((hang = x->x_hang)) { x->x_hang = hang->h_next; clock_free(hang->h_clock); *************** *** 1036,1043 **** return (x); } ! ! static void stripnote_float(t_stripnote *x, t_float f) ! { ! t_hang *hang; if (!x->x_velo) return; outlet_float(x->x_velout, x->x_velo); --- 1018,1023 ---- return (x); } ! ! static void stripnote_float(t_stripnote *x, t_float f) { if (!x->x_velo) return; outlet_float(x->x_velout, x->x_velo); *************** *** 1077,1081 **** static void *poly_new(float fnvoice, float fsteal) { ! int i, n = fnvoice; t_poly *x = (t_poly *)pd_new(poly_class); t_voice *v; --- 1057,1061 ---- static void *poly_new(float fnvoice, float fsteal) { ! int i, n = (int)fnvoice; t_poly *x = (t_poly *)pd_new(poly_class); t_voice *v; *************** *** 1224,1234 **** else /* LATER replace with a faster algorithm */ { ! for (e2 = x->x_first; e3 = e2->e_next; e2 = e3) ! ; e2->e_next = bagelem; } ! } ! else ! { if (!x->x_first) return; if (x->x_first->e_value == f) --- 1204,1211 ---- else /* LATER replace with a faster algorithm */ { ! for (e2 = x->x_first; (e3 = e2->e_next); e2 = e3) {} e2->e_next = bagelem; } ! } else { if (!x->x_first) return; if (x->x_first->e_value == f) *************** *** 1239,1245 **** return; } ! for (e2 = x->x_first; e3 = e2->e_next; e2 = e3) ! if (e3->e_value == f) ! { e2->e_next = e3->e_next; freebytes(e3, sizeof(*e3)); --- 1216,1220 ---- return; } ! for (e2 = x->x_first; (e3 = e2->e_next); e2 = e3) if (e3->e_value == f) { e2->e_next = e3->e_next; freebytes(e3, sizeof(*e3)); *************** *** 1252,1257 **** { t_bagelem *bagelem; ! while (bagelem = x->x_first) ! { outlet_float(x->x_obj.ob_outlet, bagelem->e_value); x->x_first = bagelem->e_next; --- 1227,1231 ---- { t_bagelem *bagelem; ! while ((bagelem = x->x_first)) { outlet_float(x->x_obj.ob_outlet, bagelem->e_value); x->x_first = bagelem->e_next; *************** *** 1263,1268 **** { t_bagelem *bagelem; ! while (bagelem = x->x_first) ! { x->x_first = bagelem->e_next; freebytes(bagelem, sizeof(*bagelem)); --- 1237,1241 ---- { t_bagelem *bagelem; ! while ((bagelem = x->x_first)) { x->x_first = bagelem->e_next; freebytes(bagelem, sizeof(*bagelem));
Index: x_net.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_net.c,v retrieving revision 1.2.4.2.2.2.2.4 retrieving revision 1.2.4.2.2.2.2.5 diff -C2 -d -r1.2.4.2.2.2.2.4 -r1.2.4.2.2.2.2.5 *** x_net.c 3 Jan 2007 07:12:50 -0000 1.2.4.2.2.2.2.4 --- x_net.c 3 Jan 2007 07:31:58 -0000 1.2.4.2.2.2.2.5 *************** *** 248,252 **** }
! void *netreceive_new(t_symbol *compatflag, t_floatarg fportno, t_floatarg udpflag) { --- 248,252 ---- }
! extern "C" void *netreceive_new(t_symbol *compatflag, t_floatarg fportno, t_floatarg udpflag) { *************** *** 357,361 **** }
! t_socketreceiver *netreceive_newest_receiver(t_netreceive *x) { ! return x->sr; ! } \ No newline at end of file --- 357,360 ---- }
! extern "C" t_socketreceiver *netreceive_newest_receiver(t_netreceive *x) {return x->sr;} !
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.107 retrieving revision 1.1.2.217.2.108 diff -C2 -d -r1.1.2.217.2.107 -r1.1.2.217.2.108 *** desire.c 3 Jan 2007 06:39:24 -0000 1.1.2.217.2.107 --- desire.c 3 Jan 2007 07:31:56 -0000 1.1.2.217.2.108 *************** *** 7490,7494 **** }
- extern "C" void desire_setup(void) { t_class *c; --- 7490,7493 ---- *************** *** 7984,7996 ****
#define S(name) void name##_setup(void); name##_setup(); ! extern "C" { ! void conf_init(void) { S(x_acoustics) S(x_connective) S(x_time) S(x_arithmetic) S(x_midi) S(x_misc) S(x_net) S(x_qlist) ! S(x_gui) S(x_list) S(d_arithmetic) S(d_array) S(d_ctl) S(d_dac) ! S(d_delay) S(d_fft) S(d_filter) S(d_global) ! S(d_math) S(d_misc) S(d_osc) S(d_soundfile) S(d_ugen) S(desire) } };
--- 7983,8000 ----
#define S(name) void name##_setup(void); name##_setup(); ! void conf_init_plus(void) { S(x_acoustics) S(x_connective) S(x_time) S(x_arithmetic) S(x_midi) S(x_misc) S(x_net) S(x_qlist) ! S(x_gui) S(x_list) S(desire) } + + #define S(name) void name##_setup(void); name##_setup(); + extern "C" { + void conf_init(void) { + conf_init_plus(); + S(d_arithmetic) S(d_array) S(d_ctl) S(d_dac) S(d_delay) S(d_fft) S(d_filter) S(d_global) + S(d_math) S(d_misc) S(d_osc) S(d_soundfile) S(d_ugen) + } };