From a346d52dfffc44999d3f10226642f7baa9c5463b Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Sun, 28 Nov 2004 21:20:43 +0000 Subject: unified "array" and "struct array" code. Vast changes to "g_array.c" and "g_template.c", and many smaller changes to various files. Not yet well tested. svn path=/trunk/; revision=2341 --- pd/doc/1.manual/x3.htm | 6 +- pd/doc/5.reference/plot-help.pd | 43 +- pd/doc/7.stuff/data-structures/5.array.pd | 15 +- pd/portmidi_osx/README | 2 +- pd/portmidi_osx/pmdarwin.c | 2 +- pd/portmidi_osx/pmmacosx.c | 2 +- pd/portmidi_osx/ptdarwin.c | 2 +- pd/src/d_arithmetic.c | 1 - pd/src/d_delay.c | 10 +- pd/src/d_misc.c | 91 --- pd/src/d_resample.c | 9 - pd/src/d_ugen.c | 81 +-- pd/src/g_array.c | 1078 +++++++++++++++-------------- pd/src/g_canvas.c | 17 +- pd/src/g_canvas.h | 20 +- pd/src/g_editor.c | 13 +- pd/src/g_graph.c | 7 +- pd/src/g_io.c | 77 +-- pd/src/g_readwrite.c | 2 +- pd/src/g_scalar.c | 34 +- pd/src/g_template.c | 417 ++++++----- pd/src/m_binbuf.c | 9 +- pd/src/m_class.c | 2 +- pd/src/m_obj.c | 67 -- pd/src/m_pd.c | 2 + pd/src/m_pd.h | 9 +- pd/src/m_sched.c | 16 +- pd/src/makefile | 2 +- pd/src/makefile.dependencies | 938 +++++++++++++++++++++++++ pd/src/notes.txt | 28 +- pd/src/s_audio.c | 4 - pd/src/s_audio_mmio.c | 2 +- pd/src/s_audio_oss.c | 11 +- pd/src/s_audio_pablio.c | 2 +- pd/src/s_inter.c | 3 - pd/src/s_main.c | 67 +- pd/src/s_stuff.h | 2 +- pd/src/u_main.tk | 233 ++++++- 38 files changed, 2195 insertions(+), 1131 deletions(-) (limited to 'pd') diff --git a/pd/doc/1.manual/x3.htm b/pd/doc/1.manual/x3.htm index f23e09a6..5f4f178f 100644 --- a/pd/doc/1.manual/x3.htm +++ b/pd/doc/1.manual/x3.htm @@ -457,10 +457,10 @@ distribution (10.2) or later.

To install Pd you can always just download the sources and compile them yourself, or (easier) find a MacOSX-style "package". The first package was put together by Adam -Lindsay; the most current one seems to be the one by Hans +Lindsay; the most current one is by Hans-Christof Steiner on - -http://www.pure-data.info/Members/hans/. + +http://puredata.info/Members/hans. The package simply installs itself and you needn't follow the directions below.

diff --git a/pd/doc/5.reference/plot-help.pd b/pd/doc/5.reference/plot-help.pd index 2070ed69..050418d2 100644 --- a/pd/doc/5.reference/plot-help.pd +++ b/pd/doc/5.reference/plot-help.pd @@ -5,33 +5,36 @@ array array2 help-plot-array2-template array array3 help-plot-array3-template #N struct help-plot-array2-template float x float y; #N struct help-plot-array3-template float y float w; #N canvas 398 0 516 229 12; -#N canvas 173 285 626 539 help-plot-template 1; -#X text 29 34 creation arguments:; -#X text 48 71 - RGB color (0=black \, 999=white \, 900=red \, 90=green +#N canvas 288 75 606 588 help-plot-template 1; +#X text 35 30 creation arguments:; +#X text 51 48 - RGB color (0=black \, 999=white \, 900=red \, 90=green \, 9=blue \, 555=grey \, etc.); -#X text 47 52 - OPTIONAL word "curve" to specify bezier; -#X text 46 98 - line width; -#X text 46 114 - relative x and y location; -#X text 47 130 - x spacing; -#X obj 39 217 plot curve array2 70 3 100 0; -#X obj 30 308 plot curve array3 9 1 120 50 20; -#X obj 45 12 plot array1 500 1 10 15 20; -#X text 29 147 This first example plots the red trace (500) \, width +#X text 50 97 - relative x and y location; +#X text 50 114 - x spacing; +#X text 40 150 This first example plots the red trace (500) \, width 1 \, at point (10 \, 15) \, with horizontal spacing 20 The black diamonds come from the template of the array1 element itself.; -#X text 62 239 This is the green spiral (color 70 \, line width 3 \, -location (100 \, 0). Since the template for array2 contains an "x" -cariable \, play ignores x spacing requests and takes x from the data -itself.; -#X text 50 328 If a "w" variable is present in the template as for +#X text 44 327 If a "w" variable is present in the template as for array3 \, it is added to the line width.; -#X obj 27 501 filledpolygon 509 509 0 -10 -10 10 -10 10 10 -10 10; -#X text 27 454 To see the data itself \, select "properties" for the +#X obj 37 493 filledpolygon 509 509 0 -10 -10 10 -10 10 10 -10 10; +#X text 34 454 To see the data itself \, select "properties" for the scalar by right clicking on the purple square.; -#X obj 24 387 struct help-plot-template float x float y array array1 +#X obj 36 390 struct help-plot-template float x float y array array1 help-plot-array1-template array array2 help-plot-array2-template array array3 help-plot-array3-template; -#X text 33 366 here's the "struct" for all this:; +#X text 45 369 here's the "struct" for all this:; +#X obj 51 8 plot array1 500 1 10 15 20 1; +#X obj 39 217 plot array2 70 3 100 0 0 2; +#X text 30 542 obsolete feature: the arguments can be preceded by the +word "curve" to specify bezier curves. This will be phased out.; +#X text 52 80 - line width in pixels; +#X text 51 130 - style (0 for points \, 1 for polygon \, 2 for Bezier +curve); +#X text 40 236 This is the green spiral (color 70 \, line width 3 \, +location (100 \, 0). Since the template for array2 contains an "x" +cariable \, play ignores x spacing requests and takes x from the data +itself. The style is 2 for a Bezier curve.; +#X obj 43 309 plot array3 9 1 120 50 20 1; #X restore 243 78 pd help-plot-template; #N canvas 196 292 273 120 help-plot-array1-template 0; #X obj 30 71 filledpolygon 0 0 0 -5 0 0 5 5 0 0 -5; diff --git a/pd/doc/7.stuff/data-structures/5.array.pd b/pd/doc/7.stuff/data-structures/5.array.pd index 234d039d..9f11e17c 100644 --- a/pd/doc/7.stuff/data-structures/5.array.pd +++ b/pd/doc/7.stuff/data-structures/5.array.pd @@ -13,15 +13,15 @@ #X obj 318 163 pointer; #X msg 449 194 bang; #N canvas 0 0 384 196 data5 1; -#X scalar template5 50 150 30 9 \; 0 \; 0 \; 0 \; 0 \; 0 \; 3 \; 0 -\; 0 \; 0 \; 7 \; -30 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 -\; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; -0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 0 \; 43 \; 0 -\; 0 \; 0 \; 0 \; \;; +#X scalar template5 50 150 30 9 \; 6 \; 10 \; 12 \; 14 \; 20 \; 26 +\; 32 \; 31 \; 26 \; 26 \; 23 \; 19 \; 15 \; 11 \; 7 \; 5 \; -55 \; +-56 \; -58 \; -1 \; -1 \; -6 \; -7 \; -8 \; -10 \; -11.3333 \; -12.6667 +\; -14 \; -18 \; -20 \; -22 \; -24 \; -26 \; -28 \; -31 \; -35 \; -37 +\; -37 \; -37 \; -37 \; -38 \; -39 \; -40 \; -41 \; -42 \; -43 \; -47 +\; -49 \; -51 \; -52 \; \;; #X restore 508 314 pd data5; -#N canvas 5 272 646 260 template5 1; +#N canvas 90 339 646 260 template5 1; #X obj 8 91 filledpolygon 244 q 3 0 0 20 z 40 0; -#X obj 8 113 plot bazoo 700 3 30 10 4; #X text 6 44 this declares an array named "bazoo" whose elements are described by "template5-element." Array declarations take three arguments while "float" declarations take only two.; @@ -32,6 +32,7 @@ spaced 4 apart.; variable---see the help window for "plot".; #X obj 6 8 struct template5 float x float y float z float q array bazoo template5-element; +#X obj 8 113 plot bazoo 700 3 30 10 4 1; #X restore 508 337 pd template5; #N canvas 65 248 568 128 template5-element 0; #X text 12 36 This says that array elements will have a single floating-point diff --git a/pd/portmidi_osx/README b/pd/portmidi_osx/README index 1629c584..a5416b56 100644 --- a/pd/portmidi_osx/README +++ b/pd/portmidi_osx/README @@ -1,6 +1,6 @@ PortMidi for MacOS X / Darwin Jon Parise -$Date: 2004-11-11 04:58:20 $ +$Date: 2004-11-28 21:20:42 $ This is the MacOS X / Darwin port of the PortMidi library from the Carnegie Mellon Computer Music Group. It is based on the Apple CoreAudio MIDI diff --git a/pd/portmidi_osx/pmdarwin.c b/pd/portmidi_osx/pmdarwin.c index 2df9e5f3..d8d6df31 100644 --- a/pd/portmidi_osx/pmdarwin.c +++ b/pd/portmidi_osx/pmdarwin.c @@ -2,7 +2,7 @@ * PortMidi OS-dependent interface for Darwin (MacOS X) * Jon Parise * - * $Id: pmdarwin.c,v 1.6 2004-11-11 04:58:20 millerpuckette Exp $ + * $Id: pmdarwin.c,v 1.7 2004-11-28 21:20:42 millerpuckette Exp $ * * CHANGE LOG: * 03Jul03 - X. J. Scott (xjs): diff --git a/pd/portmidi_osx/pmmacosx.c b/pd/portmidi_osx/pmmacosx.c index fa7c3beb..5acb2210 100644 --- a/pd/portmidi_osx/pmmacosx.c +++ b/pd/portmidi_osx/pmmacosx.c @@ -3,7 +3,7 @@ * * Jon Parise * - * $Id: pmmacosx.c,v 1.6 2004-11-11 04:58:20 millerpuckette Exp $ + * $Id: pmmacosx.c,v 1.7 2004-11-28 21:20:42 millerpuckette Exp $ * * 27Jun02 XJS (X. J. Scott) * - midi_length(): diff --git a/pd/portmidi_osx/ptdarwin.c b/pd/portmidi_osx/ptdarwin.c index 35c69bae..acb95dd7 100644 --- a/pd/portmidi_osx/ptdarwin.c +++ b/pd/portmidi_osx/ptdarwin.c @@ -3,7 +3,7 @@ * * Jon Parise * - * $Id: ptdarwin.c,v 1.6 2004-11-11 04:58:20 millerpuckette Exp $ + * $Id: ptdarwin.c,v 1.7 2004-11-28 21:20:42 millerpuckette Exp $ */ #include diff --git a/pd/src/d_arithmetic.c b/pd/src/d_arithmetic.c index 47eb25c5..adbcfb15 100644 --- a/pd/src/d_arithmetic.c +++ b/pd/src/d_arithmetic.c @@ -482,7 +482,6 @@ t_int *over_perf8(t_int *w) return (w+5); } -/* T.Grill - added check for zero */ t_int *scalarover_perform(t_int *w) { t_float *in = (t_float *)(w[1]); diff --git a/pd/src/d_delay.c b/pd/src/d_delay.c index f808e292..8ba5a0a5 100644 --- a/pd/src/d_delay.c +++ b/pd/src/d_delay.c @@ -37,16 +37,16 @@ typedef struct _sigdelwrite /* routine to check that all delwrites/delreads/vds have same vecsize */ static void sigdelwrite_checkvecsize(t_sigdelwrite *x, int vecsize) { - /* - LATER this should really check sample rate and blocking, once that is - supported. Probably we don't actually care about vecsize. - For now just suppress this check... */ -#if 0 if (x->x_rsortno != ugen_getsortno()) { x->x_vecsize = vecsize; x->x_rsortno = ugen_getsortno(); } + /* + LATER this should really check sample rate and blocking, once that is + supported. Probably we don't actually care about vecsize. + For now just suppress this check. */ +#if 0 else if (vecsize != x->x_vecsize) pd_error(x, "delread/delwrite/vd vector size mismatch"); #endif diff --git a/pd/src/d_misc.c b/pd/src/d_misc.c index c67f4ba6..ea96c5ac 100644 --- a/pd/src/d_misc.c +++ b/pd/src/d_misc.c @@ -79,96 +79,6 @@ static void print_setup(void) class_addfloat(print_class, print_float); } -/* ------------------------- scope~ -------------------------- */ -/* this has been replaced by arrays; to be deleted later */ - -#include "g_canvas.h" - -static t_class *scope_class; - -#define SCOPESIZE 256 - -typedef struct _scope -{ - t_object x_obj; - t_sample x_samps[SCOPESIZE]; - int x_phase; - int x_drawn; - void *x_canvas; -} t_scope; - -static t_int *scope_perform(t_int *w) -{ - t_scope *x = (t_scope *)(w[1]); - t_float *in = (t_float *)(w[2]); - int n = (int)(w[3]), phase = x->x_phase; - while (n--) - { - x->x_samps[phase] = *in++; - phase = (phase + 1) & (SCOPESIZE-1); - } - x->x_phase = phase; - return (w+4); -} - -static void scope_dsp(t_scope *x, t_signal **sp) -{ - dsp_add(scope_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); -} - -static void scope_erase(t_scope *x) -{ - if (x->x_drawn) sys_vgui(".x%lx.c delete gumbo\n", x->x_canvas); -} - -#define X1 10. -#define X2 20. -#define YC 5. -static void scope_bang(t_scope *x) -{ - int n, phase; - char hugebuf[10000], *s = hugebuf; - scope_erase(x); - sys_vgui(".x%lx.c create line 10c 5c 20c 5c -tags gumbo\n", x->x_canvas); - sprintf(s, ".x%lx.c create line ", (t_int)x->x_canvas); - s += strlen(s); - for (n = 0, phase = x->x_phase; - n < SCOPESIZE; phase = ((phase+1) & (SCOPESIZE-1)), n++) - { - sprintf(s, "%fc %fc ", X1 + (X2 - X1) * (float)n * (1./SCOPESIZE), - YC - 5 * x->x_samps[phase]); - s += strlen(s); - /* post("phase %d", phase); */ - } - sprintf(s, "-tags gumbo\n"); - sys_gui(hugebuf); - x->x_drawn = 1; -} - -static void scope_free(t_scope *x) -{ - scope_erase(x); -} - -static void *scope_new(t_symbol *s) -{ - t_scope *x = (t_scope *)pd_new(scope_class); - error("scope: this is now obsolete; use arrays and tabwrite~ instead"); - x->x_phase = 0; - x->x_drawn = 0; - x->x_canvas = canvas_getcurrent(); - return (x); -} - -static void scope_setup(void) -{ - scope_class = class_new(gensym("scope~"), (t_newmethod)scope_new, - (t_method)scope_free, sizeof(t_scope), 0, A_DEFSYM, 0); - class_addmethod(scope_class, nullfn, gensym("signal"), 0); - class_addmethod(scope_class, (t_method)scope_dsp, gensym("dsp"), 0); - class_addbang(scope_class, scope_bang); -} - /* ------------------------ bang~ -------------------------- */ static t_class *bang_tilde_class; @@ -250,7 +160,6 @@ static void samplerate_tilde_setup(void) void d_misc_setup(void) { print_setup(); - scope_setup(); bang_tilde_setup(); samplerate_tilde_setup(); } diff --git a/pd/src/d_resample.c b/pd/src/d_resample.c index e8a0a598..97ba1743 100644 --- a/pd/src/d_resample.c +++ b/pd/src/d_resample.c @@ -2,15 +2,6 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -/* upsampling/downsampling methods for inlet~/outlet~ - * - * mfg.gfd.uil - * IOhannes - * - * 2509:forum::für::umläute:2001 - */ - - #include "m_pd.h" diff --git a/pd/src/d_ugen.c b/pd/src/d_ugen.c index b72bad50..124631e6 100644 --- a/pd/src/d_ugen.c +++ b/pd/src/d_ugen.c @@ -11,16 +11,6 @@ interconnections. */ -/* hacked to run subpatches with different samplerates - * only samplerates that are a power_of_2-multiple of the - * - * mfg.gfd.uil - * IOhannes - * - * edited lines are marked with "IOhannes" - * - */ - #include "m_pd.h" #include "m_imp.h" @@ -34,14 +24,14 @@ EXTERN_STRUCT _vinlet; EXTERN_STRUCT _voutlet; void vinlet_dspprolog(struct _vinlet *x, t_signal **parentsigs, - int myvecsize, int phase, int period, int frequency, int downsample, int upsample /* IOhannes */, int reblock, - int switched); + int myvecsize, int phase, int period, int frequency, + int downsample, int upsample, int reblock, int switched); void voutlet_dspprolog(struct _voutlet *x, t_signal **parentsigs, - int myvecsize, int phase, int period, int frequency, int downsample, int upsample /* IOhannes */, int reblock, - int switched); + int myvecsize, int phase, int period, int frequency, + int downsample, int upsample, int reblock, int switched); void voutlet_dspepilog(struct _voutlet *x, t_signal **parentsigs, - int myvecsize, int phase, int period, int frequency, int downsample, int upsample /* IOhannes */, int reblock, - int switched); + int myvecsize, 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 */ { @@ -125,8 +115,8 @@ typedef struct _block char x_switched; /* true if we're acting as a a switch */ char x_switchon; /* true if we're switched on */ char x_reblock; /* true if inlets and outlets are reblocking */ - int x_upsample; /* IOhannes: upsampling-factor */ - int x_downsample; /* IOhannes: downsampling-factor */ + int x_upsample; /* upsampling-factor */ + int x_downsample; /* downsampling-factor */ } t_block; @@ -134,7 +124,7 @@ static void block_set(t_block *x, t_floatarg fvecsize, t_floatarg foverlap, t_floatarg fupsample); static void *block_new(t_floatarg fvecsize, t_floatarg foverlap, - t_floatarg fupsample) /* IOhannes */ + t_floatarg fupsample) { t_block *x = (t_block *)pd_new(block_class); x->x_phase = 0; @@ -149,7 +139,7 @@ static void *block_new(t_floatarg fvecsize, t_floatarg foverlap, static void block_set(t_block *x, t_floatarg fvecsize, t_floatarg foverlap, t_floatarg fupsample) { - int upsample, downsample; /* IOhannes */ + int upsample, downsample; int vecsize = fvecsize; int overlap = foverlap; int dspstate = canvas_suspend_dsp(); @@ -158,16 +148,17 @@ static void block_set(t_block *x, t_floatarg fvecsize, t_floatarg foverlap, if (vecsize < 0) vecsize = 0; /* this means we'll get it from parent later. */ - /* IOhannes { */ - if (fupsample <= 0) upsample = downsample = 1; + if (fupsample <= 0) + upsample = downsample = 1; else if (fupsample >= 1) { - upsample = fupsample; - downsample = 1; - } else { - downsample = 1.0 / fupsample; - upsample = 1; + upsample = fupsample; + downsample = 1; + } + else + { + downsample = 1.0 / fupsample; + upsample = 1; } - /* } IOhannes */ if (vecsize && (vecsize != (1 << ilog2(vecsize)))) { @@ -179,7 +170,6 @@ static void block_set(t_block *x, t_floatarg fvecsize, t_floatarg foverlap, pd_error(x, "block~: overlap not a power of 2"); overlap = 1; } - /* IOhannes { */ if (downsample != (1 << ilog2(downsample))) { pd_error(x, "block~: downsampling not a power of 2"); @@ -190,22 +180,18 @@ static void block_set(t_block *x, t_floatarg fvecsize, t_floatarg foverlap, pd_error(x, "block~: upsampling not a power of 2"); upsample = 1; } - /* } IOhannes */ - x->x_vecsize = vecsize; x->x_overlap = overlap; - /* IOhannes { */ x->x_upsample = upsample; x->x_downsample = downsample; - /* } IOhannes */ canvas_resume_dsp(dspstate); } static void *switch_new(t_floatarg fvecsize, t_floatarg foverlap, - t_floatarg fupsample) /* IOhannes */ + t_floatarg fupsample) { - t_block *x = (t_block *)(block_new(fvecsize, foverlap, fupsample)); /* IOhannes */ + t_block *x = (t_block *)(block_new(fvecsize, foverlap, fupsample)); x->x_switched = 1; x->x_switchon = 0; return (x); @@ -840,7 +826,7 @@ void ugen_done_graph(t_dspcontext *dc) int chainblockend; /* and after block epilog code */ int chainafterall; /* and after signal outlet epilog */ int reblock = 0, switched; - int downsample = 1, upsample = 1; /* IOhannes */ + int downsample = 1, upsample = 1; /* debugging printout */ if (ugen_loud) @@ -890,18 +876,16 @@ void ugen_done_graph(t_dspcontext *dc) vecsize = parent_vecsize; realoverlap = blk->x_overlap; if (realoverlap > vecsize) realoverlap = vecsize; - /* IOhannes { */ downsample = blk->x_downsample; upsample = blk->x_upsample; - if (downsample > parent_vecsize) downsample=parent_vecsize; + if (downsample > parent_vecsize) + downsample = parent_vecsize; period = (vecsize * downsample)/ (parent_vecsize * realoverlap * upsample); frequency = (parent_vecsize * realoverlap * upsample)/ (vecsize * downsample); - /* } IOhannes*/ phase = blk->x_phase; srate = parent_srate * realoverlap * upsample / downsample; - /* IOhannes */ if (period < 1) period = 1; if (frequency < 1) frequency = 1; blk->x_frequency = frequency; @@ -909,7 +893,7 @@ void ugen_done_graph(t_dspcontext *dc) blk->x_phase = dsp_phase & (period - 1); if (! parent_context || (realoverlap != 1) || (vecsize != parent_vecsize) || - (downsample != 1) || (upsample != 1)) /* IOhannes */ + (downsample != 1) || (upsample != 1)) reblock = 1; switched = blk->x_switched; } @@ -917,7 +901,7 @@ void ugen_done_graph(t_dspcontext *dc) { srate = parent_srate; vecsize = parent_vecsize; - downsample = upsample = 1;/* IOhannes */ + downsample = upsample = 1; period = frequency = 1; phase = 0; if (!parent_context) reblock = 1; @@ -972,13 +956,11 @@ void ugen_done_graph(t_dspcontext *dc) if (pd_class(zz) == vinlet_class) vinlet_dspprolog((struct _vinlet *)zz, dc->dc_iosigs, vecsize, dsp_phase, period, frequency, - downsample, upsample, /* IOhannes */ - reblock, switched); + downsample, upsample, reblock, switched); else if (pd_class(zz) == voutlet_class) voutlet_dspprolog((struct _voutlet *)zz, outsigs, vecsize, dsp_phase, period, frequency, - downsample, upsample, /* IOhannes */ - reblock, switched); + downsample, upsample, reblock, switched); } chainblockbegin = dsp_chainsize; @@ -1051,8 +1033,7 @@ void ugen_done_graph(t_dspcontext *dc) if (iosigs) iosigs += dc->dc_ninlets; voutlet_dspepilog((struct _voutlet *)zz, iosigs, vecsize, dsp_phase, period, frequency, - downsample, upsample, /* IOhannes */ - reblock, switched); + downsample, upsample, reblock, switched); } } @@ -1115,9 +1096,9 @@ t_signal *ugen_getiosig(int index, int inout) void d_ugen_setup(void) /* really just block_setup */ { block_class = class_new(gensym("block~"), (t_newmethod)block_new, 0, - sizeof(t_block), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT/*IOhannes*/, 0); + sizeof(t_block), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addcreator((t_newmethod)switch_new, gensym("switch~"), - A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT/*IOhannes*/, 0); + A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(block_class, (t_method)block_set, gensym("set"), A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(block_class, (t_method)block_dsp, gensym("dsp"), 0); diff --git a/pd/src/g_array.c b/pd/src/g_array.c index 434cea72..dd1e88f2 100644 --- a/pd/src/g_array.c +++ b/pd/src/g_array.c @@ -9,6 +9,10 @@ #include "g_canvas.h" #include +/* jsarlo { */ +#define ARRAYPAGESIZE 1000 /* this should match the page size in u_main.tk */ +/* } jsarlo */ + /* see also the "plot" object in g_scalar.c which deals with graphing arrays which are fields in scalars. Someday we should unify the two, but how? */ @@ -56,18 +60,21 @@ t_array *array_new(t_symbol *templatesym, t_gpointer *parent) return (x); } -void array_resize(t_array *x, t_template *template, int n) +/* jsarlo { */ +void garray_arrayviewlist_close(t_garray *x); +/* } jsarlo */ + +void array_resize(t_array *x, int n) { int elemsize, oldn; t_gpointer *gp; - + t_template *template = template_findbyname(x->a_templatesym); if (n < 1) n = 1; oldn = x->a_n; elemsize = sizeof(t_word) * template->t_n; - - x->a_vec = (char *)resizebytes(x->a_vec, oldn * elemsize, - n * elemsize); + + x->a_vec = (char *)resizebytes(x->a_vec, oldn * elemsize, n * elemsize); x->a_n = n; if (n > oldn) { @@ -79,6 +86,20 @@ void array_resize(t_array *x, t_template *template, int n) word_init(wp, template, &x->a_gp); } } + x->a_valid = ++glist_valid; +} + +static void array_resize_and_redraw(t_array *array, t_glist *glist, int n) +{ + t_array *a2 = array; + int vis = glist_isvisible(glist); + while (a2->a_gp.gp_stub->gs_which == GP_ARRAY) + a2 = a2->a_gp.gp_stub->gs_un.gs_array; + if (vis) + gobj_vis(&a2->a_gp.gp_un.gp_scalar->sc_gobj, glist, 0); + array_resize(array, n); + if (vis) + gobj_vis(&a2->a_gp.gp_un.gp_scalar->sc_gobj, glist, 1); } void word_free(t_word *wp, t_template *template); @@ -87,8 +108,6 @@ void array_free(t_array *x) { int i; t_template *scalartemplate = template_findbyname(x->a_templatesym); - /* we don't unset our gpointer here since it was never "set." */ - /* gpointer_unset(&x->a_gp); */ gstub_cutoff(x->a_stub); for (i = 0; i < x->a_n; i++) { @@ -107,86 +126,208 @@ static int gcount = 0; struct _garray { t_gobj x_gobj; - t_glist *x_glist; - t_array x_array; /* actual array; note only 4 fields used as below */ - t_symbol *x_name; - t_symbol *x_realname; /* name with "$" expanded */ - t_float x_firstx; /* X value of first item */ - t_float x_xinc; /* X increment */ + t_scalar *x_scalar; /* scalar "containing" the array */ + t_glist *x_glist; /* containing glist */ + t_symbol *x_name; /* unexpanded name (possibly with leading '$') */ + t_symbol *x_realname; /* expanded name (symbol we're bound to) */ char x_usedindsp; /* true if some DSP routine is using this */ char x_saveit; /* true if we should save this with parent */ - char x_drawasrects; /* draw as rectangles, not a polygon */ + char x_listviewing; /* true if list view window is open */ }; - /* macros to get into the "array" structure */ -#define x_n x_array.a_n -#define x_elemsize x_array.a_elemsize -#define x_vec x_array.a_vec -#define x_templatesym x_array.a_templatesym +static t_pd *garray_arraytemplatecanvas; +static char garray_arraytemplatefile[] = "\ +#N canvas 0 0 458 153 10;\n\ +#X obj 43 31 struct _float_array array z float float style\n\ +float linewidth float color;\n\ +#X obj 43 70 plot z color linewidth 0 0 1 style;\n\ +"; +static char garray_floattemplatefile[] = "\ +#N canvas 0 0 458 153 10;\n\ +#X obj 39 26 struct float float y;\n\ +"; + +/* create invisible, built-in canvases to determine the templates for floats +and float-arrays. */ + +void garray_init( void) +{ + t_binbuf *b; + if (garray_arraytemplatecanvas) + return; + b = binbuf_new(); + + glob_setfilename(0, gensym("_float"), gensym(".")); + binbuf_text(b, garray_floattemplatefile, strlen(garray_floattemplatefile)); + binbuf_eval(b, 0, 0, 0); + vmess(s__X.s_thing, gensym("pop"), "i", 0); + + glob_setfilename(0, gensym("_float_array"), gensym(".")); + binbuf_text(b, garray_arraytemplatefile, strlen(garray_arraytemplatefile)); + binbuf_eval(b, 0, 0, 0); + garray_arraytemplatecanvas = s__X.s_thing; + vmess(s__X.s_thing, gensym("pop"), "i", 0); + + glob_setfilename(0, &s_, &s_); + binbuf_free(b); +} + +/* create a new scalar attached to a symbol. Used to make floating-point +arrays (the scalar will be of type "_float_array"). Currently this is +always called by graph_array() below; but when we make a more general way +to save and create arrays this might get called more directly. */ -t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templatesym, - t_floatarg f, t_floatarg fflags) +static t_garray *graph_scalar(t_glist *gl, t_symbol *s, t_symbol *templatesym, + int saveit) { - int n = f, i; - int zz, nwords; + int i, zz; t_garray *x; t_pd *x2; t_template *template; char *str; + t_gpointer gp; + if (!template_findbyname(templatesym)) + return (0); + x = (t_garray *)pd_new(garray_class); + x->x_scalar = scalar_new(gl, templatesym); + x->x_name = s; + x->x_realname = canvas_realizedollar(gl, s); + pd_bind(&x->x_gobj.g_pd, x->x_realname); + x->x_usedindsp = 0; + x->x_saveit = saveit; + x->x_listviewing = 0; + glist_add(gl, &x->x_gobj); + x->x_glist = gl; + return (x); +} + + /* get a garray's "array" structure. */ +t_array *garray_getarray(t_garray *x) +{ + int nwords, zonset, ztype; + t_symbol *zarraytype; + t_scalar *sc = x->x_scalar; + t_symbol *templatesym = sc->sc_template; + t_template *template = template_findbyname(templatesym); + if (!template) + { + error("array: couldn't find template %s", templatesym->s_name); + return (0); + } + if (!template_find_field(template, gensym("z"), + &zonset, &ztype, &zarraytype)) + { + error("array: template %s has no 'z' field", templatesym->s_name); + return (0); + } + if (ztype != DT_ARRAY) + { + error("array: template %s, 'z' field is not an array", + templatesym->s_name); + return (0); + } + return (sc->sc_vec[zonset].w_array); +} + + /* get the "array" structure and furthermore check it's float */ +static t_array *garray_getarray_floatonly(t_garray *x, + int *yonsetp, int *elemsizep) +{ + t_array *a = garray_getarray(x); + int yonset, type; + t_symbol *arraytype; + t_template *template = template_findbyname(a->a_templatesym); + if (!template_find_field(template, gensym("y"), &yonset, + &type, &arraytype) || type != DT_FLOAT) + return (0); + *yonsetp = yonset; + *elemsizep = a->a_elemsize; + return (a); +} + + /* if there is one garray in a graph, reset the graph's coordinates + to fit a new size and style for the garray */ +static void garray_fittograph(t_garray *x, int n, int style) +{ + t_array *array = garray_getarray(x); + t_glist *gl = x->x_glist; + if (gl->gl_list == &x->x_gobj && !x->x_gobj.g_next) + { + vmess(&gl->gl_pd, gensym("bounds"), "ffff", + 0., gl->gl_y1, (double) + (style == PLOTSTYLE_POINTS || n == 1 ? n : n-1), + gl->gl_y2); + /* close any dialogs that might have the wrong info now... */ + gfxstub_deleteforkey(gl); + } + array_resize_and_redraw(array, x->x_glist, n); +} + +/* handle "array" message to glists; call graph_scalar above with +an appropriate template; then set size and flags. This is called +from the menu and in the file format for patches. LATER replace this +by a more coherent (and general) invocation. */ + +t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *templateargsym, + t_floatarg fsize, t_floatarg fflags) +{ + int n = fsize, i, zz, nwords, zonset, ztype, saveit; + t_symbol *zarraytype; + t_garray *x; + t_pd *x2; + t_template *template, *ztemplate; + t_symbol *templatesym; + char *str; int flags = fflags; - if (s == &s_) + t_gpointer gp; + int filestyle = ((flags & 6) >> 1); + int style = (filestyle == 0 ? PLOTSTYLE_POLY : + (filestyle == 1 ? PLOTSTYLE_POINTS : filestyle)); + if (templateargsym != &s_float) { - char buf[40]; - sprintf(buf, "array%d", ++gcount); - s = gensym(buf); - templatesym = &s_float; - n = 100; + error("array %s: only 'float' type understood", templateargsym->s_name); + return (0); } - else if (!strncmp((str = s->s_name), "array", 5) - && (zz = atoi(str + 5)) > gcount) gcount = zz; + templatesym = gensym("pd-_float_array"); template = template_findbyname(templatesym); if (!template) { error("array: couldn't find template %s", templatesym->s_name); return (0); } - nwords = template->t_n; - for (i = 0; i < nwords; i++) + if (!template_find_field(template, gensym("z"), + &zonset, &ztype, &zarraytype)) { - /* we can't have array or list elements yet because what scalar - can act as their "parent"??? */ - if (template->t_vec[i].ds_type == DT_ARRAY - || template->t_vec[i].ds_type == DT_LIST) - { - error("array: template %s can't have sublists or arrays", - templatesym->s_name); - return (0); - } + error("array: template %s has no 'z' field", templatesym->s_name); + return (0); } - x = (t_garray *)pd_new(garray_class); + if (ztype != DT_ARRAY) + { + error("array: template %s, 'z' field is not an array", + templatesym->s_name); + return (0); + } + if (!(ztemplate = template_findbyname(zarraytype))) + { + error("array: no template of type %s", zarraytype->s_name); + return (0); + } + saveit = ((flags & 1) != 0); + x = graph_scalar(gl, s, templatesym, saveit); - if (n <= 0) n = 100; - x->x_n = n; - x->x_elemsize = nwords * sizeof(t_word); - x->x_vec = getbytes(x->x_n * x->x_elemsize); - memset(x->x_vec, 0, x->x_n * x->x_elemsize); - /* LATER should check that malloc */ - x->x_name = s; - x->x_realname = canvas_realizedollar(gl, s); - pd_bind(&x->x_gobj.g_pd, x->x_realname); - x->x_templatesym = templatesym; - x->x_firstx = 0; - x->x_xinc = 1; /* LATER make methods to set this... */ - x->x_drawasrects = ((flags & 2) != 0); - x->x_usedindsp = 0; - x->x_saveit = ((flags & 1) != 0); - glist_add(gl, &x->x_gobj); - x->x_glist = gl; + if (n <= 0) + n = 100; + array_resize(x->x_scalar->sc_vec[zonset].w_array, n); + + template_setfloat(template, gensym("style"), x->x_scalar->sc_vec, + style, 1); + template_setfloat(template, gensym("linewidth"), x->x_scalar->sc_vec, + ((style == PLOTSTYLE_POINTS) ? 2 : 1), 1); if (x2 = pd_findbyclass(gensym("#A"), garray_class)) pd_unbind(x2, gensym("#A")); pd_bind(&x->x_gobj.g_pd, gensym("#A")); - + garray_redraw(x); return (x); } @@ -195,8 +336,7 @@ void canvas_menuarray(t_glist *canvas) { t_glist *x = (t_glist *)canvas; char cmdbuf[200]; - sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1\n", - ++gcount); + sprintf(cmdbuf, "pdtk_array_dialog %%s array%d 100 3 1\n", gcount+1); gfxstub_new(&x->gl_pd, x, cmdbuf); } @@ -204,15 +344,21 @@ void canvas_menuarray(t_glist *canvas) void garray_properties(t_garray *x) { char cmdbuf[200]; + t_array *a = garray_getarray(x); + t_scalar *sc = x->x_scalar; + + if (!a) + return; gfxstub_deleteforkey(x); /* create dialog window. LATER fix this to escape '$' properly; right now we just detect a leading '$' and escape it. There should be a systematic way of doing this. */ - if (x->x_name->s_name[0] == '$') - sprintf(cmdbuf, "pdtk_array_dialog %%s \\%s %d %d 0\n", - x->x_name->s_name, x->x_n, x->x_saveit); - else sprintf(cmdbuf, "pdtk_array_dialog %%s %s %d %d 0\n", - x->x_name->s_name, x->x_n, x->x_saveit + (x->x_drawasrects<<1)); + sprintf(cmdbuf, ((x->x_name->s_name[0] == '$') ? + "pdtk_array_dialog %%s \\%s %d %d 0\n" : + "pdtk_array_dialog %%s %s %d %d 0\n"), + x->x_name->s_name, a->a_n, x->x_saveit + + 2 * (int)(template_getfloat(template_findbyname(sc->sc_template), + gensym("style"), x->x_scalar->sc_vec, 1))); gfxstub_new(&x->x_gobj.g_pd, x, cmdbuf); } @@ -238,7 +384,10 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize, { int flags = fflags; int saveit = ((flags & 1) != 0); - int drawasrects = ((flags & 2) != 0); + int style = ((flags & 6) >> 1); + float stylewas = template_getfloat( + template_findbyname(x->x_scalar->sc_template), + gensym("style"), x->x_scalar->sc_vec, 1); if (deleteit != 0) { glist_delete(x->x_glist, &x->x_gobj); @@ -246,9 +395,30 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize, else { int size; + int styleonset, styletype; + t_symbol *stylearraytype; t_symbol *argname = sharptodollar(name); + t_array *a = garray_getarray(x); + t_template *scalartemplate; + if (!a) + { + pd_error(x, "can't find array\n"); + return; + } + if (!(scalartemplate = template_findbyname(x->x_scalar->sc_template))) + { + error("array: no template of type %s", + x->x_scalar->sc_template->s_name); + return; + } if (argname != x->x_name) { + /* jsarlo { */ + if (x->x_listviewing) + { + garray_arrayviewlist_close(x); + } + /* } jsarlo */ x->x_name = argname; pd_unbind(&x->x_gobj.g_pd, x->x_realname); x->x_realname = canvas_realizedollar(x->x_glist, argname); @@ -257,27 +427,128 @@ void garray_arraydialog(t_garray *x, t_symbol *name, t_floatarg fsize, size = fsize; if (size < 1) size = 1; - if (size != x->x_n) + if (size != a->a_n) garray_resize(x, size); - x->x_drawasrects = drawasrects; + else if (style != stylewas) + garray_fittograph(x, size, style); + template_setfloat(scalartemplate, gensym("style"), + x->x_scalar->sc_vec, (float)style, 0); + garray_setsaveit(x, (saveit != 0)); garray_redraw(x); } } +/* jsarlo { */ +void garray_arrayviewlist_new(t_garray *x) +{ + int i, xonset, yonset, type, elemsize; + float yval; + char cmdbuf[200]; + t_symbol *arraytype; + t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize); + + if (!a) + { + /* FIXME */ + error("error in garray_arrayviewlist_new()"); + } + x->x_listviewing = 1; + sprintf(cmdbuf, + "pdtk_array_listview_new %%s %s %d\n", + x->x_realname->s_name, + 0); + gfxstub_new(&x->x_gobj.g_pd, x, cmdbuf); + for (i = 0; i < ARRAYPAGESIZE && i < a->a_n; i++) + { + yval = *(float *)(a->a_vec + + elemsize * i * sizeof (t_word) + yonset); + sys_vgui(".%sArrayWindow.lb insert %d {%d) %g}\n", + x->x_realname->s_name, + i, + i, + yval); + } +} + +void garray_arrayviewlist_fillpage(t_garray *x, + t_float page) +{ + int i, xonset, yonset, type, elemsize; + float yval; + char cmdbuf[200]; + t_symbol *arraytype; + t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize); + + if (!a) + { + /* FIXME */ + error("error in garray_arrayviewlist_new()"); + } + + if (page < 0) { + page = 0; + sys_vgui("pdtk_array_listview_setpage %s %d\n", + x->x_realname->s_name, + (int)page); + } + else if ((page * ARRAYPAGESIZE) >= a->a_n) { + page = (int)(((int)a->a_n - 1)/ (int)ARRAYPAGESIZE); + sys_vgui("pdtk_array_listview_setpage %s %d\n", + x->x_realname->s_name, + (int)page); + } + sys_vgui(".%sArrayWindow.lb delete 0 %d\n", + x->x_realname->s_name, + ARRAYPAGESIZE - 1); + for (i = page * ARRAYPAGESIZE; + (i < (page + 1) * ARRAYPAGESIZE && i < a->a_n); + i++) + { + yval = *(float *)(a->a_vec + \ + elemsize * i * sizeof (t_word) + yonset); + sys_vgui(".%sArrayWindow.lb insert %d {%d) %g}\n", + x->x_realname->s_name, + i % ARRAYPAGESIZE, + i, + yval); + } +} + +void garray_arrayviewlist_close(t_garray *x) +{ + x->x_listviewing = 0; + sys_vgui("pdtk_array_listview_closeWindow %s\n", + x->x_realname->s_name); +} +/* } jsarlo */ + static void garray_free(t_garray *x) { t_pd *x2; + /* jsarlo { */ + if (x->x_listviewing) + { + garray_arrayviewlist_close(x); + } + /* } jsarlo */ gfxstub_deleteforkey(x); pd_unbind(&x->x_gobj.g_pd, x->x_realname); /* LATER find a way to get #A unbound earlier (at end of load?) */ while (x2 = pd_findbyclass(gensym("#A"), garray_class)) pd_unbind(x2, gensym("#A")); - freebytes(x->x_vec, x->x_n * x->x_elemsize); + pd_free(&x->x_scalar->sc_gobj.g_pd); } /* ------------- code used by both array and plot widget functions ---- */ +void array_redraw(t_array *a, t_glist *glist) +{ + while (a->a_gp.gp_stub->gs_which == GP_ARRAY) + a = a->a_gp.gp_stub->gs_un.gs_array; + gobj_redraw(&a->a_gp.gp_un.gp_scalar->sc_gobj, glist); +} + /* routine to get screen coordinates of a point in an array */ void array_getcoordinate(t_glist *glist, char *elem, int xonset, int yonset, int wonset, int indx, @@ -311,7 +582,8 @@ static float array_motion_ycumulative; static t_symbol *array_motion_xfield; static t_symbol *array_motion_yfield; static t_glist *array_motion_glist; -static t_gobj *array_motion_gobj; +static t_scalar *array_motion_scalar; +static t_array *array_motion_array; static t_word *array_motion_wp; static t_template *array_motion_template; static int array_motion_npoints; @@ -398,10 +670,52 @@ static void array_motion(void *z, t_floatarg dx, t_floatarg dy) } array_motion_lastx = thisx; } - sys_queuegui(array_motion_gobj, array_motion_glist, gobj_redraw); + if (array_motion_scalar) + sys_queuegui(&array_motion_scalar->sc_gobj, + array_motion_glist, gobj_redraw); + if (array_motion_array) + array_redraw(array_motion_array, array_motion_glist); } -int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, +int scalar_doclick(t_word *data, t_template *template, t_scalar *sc, + t_array *ap, struct _glist *owner, + float xloc, float yloc, int xpix, int ypix, + int shift, int alt, int dbl, int doit); + + /* try clicking on an element of the array as a scalar (if clicking + on the trace of the array failed) */ +static int array_doclick_element(t_array *array, t_glist *glist, + t_scalar *sc, t_array *ap, + t_symbol *elemtemplatesym, + float linewidth, float xloc, float xinc, float yloc, + int xpix, int ypix, int shift, int alt, int dbl, int doit) +{ + t_canvas *elemtemplatecanvas; + t_template *elemtemplate; + int elemsize, yonset, wonset, xonset, i, incr, hit; + + if (elemtemplatesym == &s_float) + return (0); + if (array_getfields(elemtemplatesym, &elemtemplatecanvas, + &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) + return (0); + /* if it has more than 2000 points, just check 300 of them. */ + if (array->a_n < 2000) + incr = 1; + else incr = array->a_n / 300; + for (i = 0; i < array->a_n; i += incr) + { + if (hit = scalar_doclick( + (t_word *)((char *)(array->a_vec) + i * elemsize), + elemtemplate, 0, array, + glist, xloc, yloc, xpix, ypix, shift, alt, dbl, doit)) + return (hit); + } + return (0); +} + + /* LATER move this and others back into plot parentwidget code. */ +int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, t_symbol *elemtemplatesym, float linewidth, float xloc, float xinc, float yloc, int xpix, int ypix, int shift, int alt, int dbl, int doit) @@ -448,7 +762,9 @@ int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, } } if (best > 8) - return (0); + return (array_doclick_element(array, glist, sc, ap, + elemtemplatesym, linewidth, + xloc, xinc, yloc, xpix, ypix, shift, alt, dbl, doit)); best += 0.001; /* add truncation error margin */ for (i = 0; i < array->a_n; i += incr) { @@ -484,7 +800,8 @@ int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, char *elem = (char *)array->a_vec; array_motion_elemsize = elemsize; array_motion_glist = glist; - array_motion_gobj = gobj; + array_motion_scalar = sc; + array_motion_array = ap; array_motion_template = elemtemplate; array_motion_xperpix = glist_dpixtodx(glist, 1); array_motion_yperpix = glist_dpixtody(glist, 1); @@ -495,14 +812,13 @@ int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, memmove((char *)(array->a_vec) + elemsize * i, (char *)(array->a_vec) + elemsize * (i+1), (array->a_n - 1 - i) * elemsize); - array_resize(array, elemtemplate, array->a_n - 1); - glist_redrawitem(array_motion_glist, array_motion_gobj); + array_resize_and_redraw(array, glist, array->a_n - 1); return (0); } else if (alt) { /* add a point (after the clicked-on one) */ - array_resize(array, elemtemplate, array->a_n + 1); + array_resize_and_redraw(array, glist, array->a_n + 1); elem = (char *)array->a_vec; memmove(elem + elemsize * (i+1), elem + elemsize * i, @@ -562,29 +878,26 @@ int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, return (0); } -/* -------------------- widget behavior for garray ------------ */ - -static void garray_getrect(t_gobj *z, t_glist *glist, +static void array_getrect(t_array *array, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2) { - t_garray *x = (t_garray *)z; float x1 = 0x7fffffff, y1 = 0x7fffffff, x2 = -0x7fffffff, y2 = -0x7fffffff; t_canvas *elemtemplatecanvas; t_template *elemtemplate; int elemsize, yonset, wonset, xonset, i; - if (!array_getfields(x->x_templatesym, &elemtemplatecanvas, + if (!array_getfields(array->a_templatesym, &elemtemplatecanvas, &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) { int incr; /* if it has more than 2000 points, just check 300 of them. */ - if (x->x_array.a_n < 2000) + if (array->a_n < 2000) incr = 1; - else incr = x->x_array.a_n / 300; - for (i = 0; i < x->x_array.a_n; i += incr) + else incr = array->a_n / 300; + for (i = 0; i < array->a_n; i += incr) { float pxpix, pypix, pwpix, dx, dy; - array_getcoordinate(glist, (char *)(x->x_array.a_vec) + + array_getcoordinate(glist, (char *)(array->a_vec) + i * elemsize, xonset, yonset, wonset, i, 0, 0, 1, &pxpix, &pypix, &pwpix); @@ -606,6 +919,15 @@ static void garray_getrect(t_gobj *z, t_glist *glist, *yp2 = y2; } +/* -------------------- widget behavior for garray ------------ */ + +static void garray_getrect(t_gobj *z, t_glist *glist, + int *xp1, int *yp1, int *xp2, int *yp2) +{ + t_garray *x = (t_garray *)z; + gobj_getrect(&x->x_scalar->sc_gobj, glist, xp1, yp1, xp2, yp2); +} + static void garray_displace(t_gobj *z, t_glist *glist, int dx, int dy) { /* refuse */ @@ -629,121 +951,14 @@ static void garray_delete(t_gobj *z, t_glist *glist) static void garray_vis(t_gobj *z, t_glist *glist, int vis) { t_garray *x = (t_garray *)z; - if (vis) - { - int i, xonset, yonset, type; - t_symbol *arraytype; - t_template *template = template_findbyname(x->x_templatesym); - if (!template) - return; - if (!template_find_field(template, gensym("y"), &yonset, &type, - &arraytype) || type != DT_FLOAT) - { - error("%s: needs floating-point 'y' field", - x->x_templatesym->s_name); - sys_vgui(".x%lx.c create text 50 50 -text foo\ - -tags .x%lx.a%lx\n", - glist_getcanvas(glist), glist_getcanvas(glist), x); - } - else if (!template_find_field(template, gensym("x"), &xonset, &type, - &arraytype) || type != DT_FLOAT) - { - if (x->x_drawasrects) - { - float xcum = x->x_firstx; - float minyval = 1e20, maxyval = -1e20; - float nextxpix = glist_xtopixels(glist, xcum); - int lastpixel = -0x7fffffff; - int ndrawn = 0; - for (i = 0; i < x->x_n; i++) - { - float yval, xpix, ypix; - int ixpix; - - xpix = nextxpix; - xcum += x->x_xinc; - nextxpix = glist_xtopixels(glist, xcum); - - yval = *(float *)(x->x_vec + - template->t_n * i * sizeof (t_word) + yonset); - if (yval > maxyval) - maxyval = yval; - if (yval < minyval) - minyval = yval; - ixpix = xpix + 0.5; - if (lastpixel == -0x7fffffff) - lastpixel = ixpix; - if (i == x->x_n-1 || (int)(0.5+nextxpix) != ixpix) - { - sys_vgui( -".x%lx.c create rectangle %d %d %d %d -fill black -width 0 -tags .x%lx.a%lx\n", - glist_getcanvas(glist), - lastpixel, (int)glist_ytopixels(glist, minyval), - ixpix, (int)glist_ytopixels(glist, maxyval)+2, - glist_getcanvas(glist), x); - ndrawn++; - minyval = 1e20; - maxyval = -1e20; - lastpixel = ixpix; - } - if (ndrawn > 2000 || ixpix >= 3000) break; - } - } - else /* draw as a polygon */ - { - float xcum = x->x_firstx; - int lastpixel = -1, ndrawn = 0; - float yval = 0, xpix; - int ixpix = 0; - sys_vgui(".x%lx.c create line \\\n", glist_getcanvas(glist)); - for (i = 0; i < x->x_n; i++) - { - yval = *(float *)(x->x_vec + - template->t_n * i * sizeof (t_word) + yonset); - xpix = glist_xtopixels(glist, xcum); - ixpix = xpix + 0.5; - if (ixpix != lastpixel) - { - sys_vgui("%d %f \\\n", ixpix, - glist_ytopixels(glist, yval)); - ndrawn++; - } - lastpixel = ixpix; - if (ndrawn >= 1000) break; - xcum += x->x_xinc; - } - /* TK will complain if there aren't at least 2 points... */ - if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); - else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix, - glist_ytopixels(glist, yval)); - sys_vgui("-tags .x%lx.a%lx\n", glist_getcanvas(glist), x); - } - sys_vgui(".x%lx.c create text %f %f -text {%s} -anchor e\ - -font -*-courier-bold--normal--%d-* -tags .x%lx.a%lx\n", - glist_getcanvas(glist), - glist_xtopixels(glist, x->x_firstx) - 5., - glist_ytopixels(glist, *(float *)(x->x_vec + yonset)), - x->x_name->s_name, glist_getfont(glist), - glist_getcanvas(glist), x); - } - else - { - post("x, y arrays not yet supported"); - } - } - else - { - sys_vgui(".x%lx.c delete .x%lx.a%lx\n", - glist_getcanvas(glist), glist_getcanvas(glist), x); - sys_unqueuegui(x); - } + gobj_vis(&x->x_scalar->sc_gobj, glist, vis); } -static int garray_click(t_gobj *z, struct _glist *glist, +static int garray_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { t_garray *x = (t_garray *)z; - return (array_doclick(&x->x_array, glist, z, x->x_templatesym, 1, 0, 1, 0, + return (gobj_click(&x->x_scalar->sc_gobj, glist, xpix, ypix, shift, alt, dbl, doit)); } @@ -751,18 +966,32 @@ static int garray_click(t_gobj *z, struct _glist *glist, static void garray_save(t_gobj *z, t_binbuf *b) { + int style, filestyle; t_garray *x = (t_garray *)z; + t_array *array = garray_getarray(x); + t_template *scalartemplate; + if (x->x_scalar->sc_template != gensym("pd-_float_array")) + { + /* LATER "save" the scalar as such */ + pd_error(x, "can't save arrays of type %s yet", + x->x_scalar->sc_template->s_name); + return; + } + if (!(scalartemplate = template_findbyname(x->x_scalar->sc_template))) + { + error("array: no template of type %s", + x->x_scalar->sc_template->s_name); + return; + } + style = template_getfloat(scalartemplate, gensym("style"), + x->x_scalar->sc_vec, 0); + filestyle = (style == PLOTSTYLE_POINTS ? 1 : + (style == PLOTSTYLE_POLY ? 0 : style)); binbuf_addv(b, "sssisi;", gensym("#X"), gensym("array"), - x->x_name, x->x_n, x->x_templatesym, - x->x_saveit + 2 * x->x_drawasrects); + x->x_name, array->a_n, &s_float, x->x_saveit + 2 * filestyle); if (x->x_saveit) { - int n = x->x_n, n2 = 0; - if (x->x_templatesym != &s_float) - { - pd_error(x, "sorry, you can only save 'float' arrays now"); - return; - } + int n = array->a_n, n2 = 0; if (n > 200000) post("warning: I'm saving an array with %d points!\n", n); while (n2 < n) @@ -772,7 +1001,7 @@ static void garray_save(t_gobj *z, t_binbuf *b) chunk = ARRAYWRITECHUNKSIZE; binbuf_addv(b, "si", gensym("#A"), n2); for (i = 0; i < chunk; i++) - binbuf_addv(b, "f", ((float *)(x->x_vec))[n2+i]); + binbuf_addv(b, "f", ((float *)(array->a_vec))[n2+i]); binbuf_addv(b, ";"); n2 += chunk; } @@ -811,6 +1040,16 @@ void garray_redraw(t_garray *x) { if (glist_isvisible(x->x_glist)) sys_queuegui(&x->x_gobj, x->x_glist, garray_doredraw); + /* jsarlo { */ + /* this happens in garray_vis() when array is visible for + performance reasons */ + else + { + if (x->x_listviewing) + sys_vgui("pdtk_array_listview_fillpage %s\n", + x->x_realname->s_name); + } + /* } jsarlo */ } /* This functiopn gets the template of an array; if we can't figure @@ -818,7 +1057,9 @@ void garray_redraw(t_garray *x) when it's time to free or resize it. */ t_template *garray_template(t_garray *x) { - t_template *template = template_findbyname(x->x_templatesym); + t_array *array = garray_getarray(x); + t_template *template = + (array ? template_findbyname(array->a_templatesym) : 0); if (!template) bug("garray_template"); return (template); @@ -826,12 +1067,14 @@ t_template *garray_template(t_garray *x) int garray_npoints(t_garray *x) /* get the length */ { - return (x->x_n); + t_array *array = garray_getarray(x); + return (array->a_n); } char *garray_vec(t_garray *x) /* get the contents */ { - return ((char *)(x->x_vec)); + t_array *array = garray_getarray(x); + return ((char *)(array->a_vec)); } /* routine that checks if we're just an array of floats and if @@ -839,40 +1082,21 @@ char *garray_vec(t_garray *x) /* get the contents */ int garray_getfloatarray(t_garray *x, int *size, t_float **vec) { - t_template *template = garray_template(x); - int yonset, type; - t_symbol *arraytype; - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) - error("%s: needs floating-point 'y' field", - x->x_templatesym->s_name); - else if (template->t_n != 1) - error("%s: has more than one field", x->x_templatesym->s_name); - else + int yonset, type, elemsize; + t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!a) { - *size = garray_npoints(x); - *vec = (float *)garray_vec(x); - return (1); + error("%s: needs floating-point 'y' field", x->x_realname); + return (0); } - return (0); -} - - /* get any floating-point field of any element of an array */ -float garray_get(t_garray *x, t_symbol *s, t_int indx) -{ - t_template *template = garray_template(x); - int yonset, type; - t_symbol *arraytype; - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) + else if (elemsize != sizeof(t_word)) { - error("%s: needs floating-point '%s' field", x->x_templatesym->s_name, - s->s_name); + error("%s: has more than one field", x->x_realname); return (0); } - if (indx < 0) indx = 0; - else if (indx >= x->x_n) indx = x->x_n - 1; - return (*(float *)((x->x_vec + sizeof(t_word) * indx) + yonset)); + *size = garray_npoints(x); + *vec = (float *)garray_vec(x); + return (1); } /* set the "saveit" flag */ @@ -887,15 +1111,13 @@ void garray_setsaveit(t_garray *x, int saveit) /*------------------- Pd messages ------------------------ */ static void garray_const(t_garray *x, t_floatarg g) { - t_template *template = garray_template(x); - int yonset, type, i; - t_symbol *arraytype; - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) - error("%s: needs floating-point 'y' field", - x->x_templatesym->s_name); - else for (i = 0; i < x->x_n; i++) - *(float *)(((char *)x->x_vec + sizeof(t_word) * i) + yonset) = g; + int yonset, i, elemsize; + t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!array) + error("%s: needs floating-point 'y' field", x->x_realname); + else for (i = 0; i < array->a_n; i++) + *((float *)((char *)array->a_vec + + elemsize * i) + yonset) = g; garray_redraw(x); } @@ -903,24 +1125,22 @@ static void garray_const(t_garray *x, t_floatarg g) static void garray_dofo(t_garray *x, int npoints, float dcval, int nsin, t_float *vsin, int sineflag) { - t_template *template = garray_template(x); - int yonset, type, i, j; - t_symbol *arraytype; double phase, phaseincr, fj; + int yonset, i, j, elemsize; + t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!array) + { + error("%s: needs floating-point 'y' field", x->x_realname); + return; + } if (npoints == 0) npoints = 512; /* dunno what a good default would be... */ if (npoints != (1 << ilog2(npoints))) - post("%s: rounnding to %d points", x->x_templatesym->s_name, + post("%s: rounnding to %d points", array->a_templatesym->s_name, (npoints = (1<x_templatesym->s_name); - return; - } - for (i = 0, phase = -phaseincr; i < x->x_n; i++, phase += phaseincr ) + for (i = 0, phase = -phaseincr; i < array->a_n; i++, phase += phaseincr) { double sum = dcval; if (sineflag) @@ -929,21 +1149,20 @@ static void garray_dofo(t_garray *x, int npoints, float dcval, else for (j = 0, fj = 0; j < nsin; j++, fj += phase) sum += vsin[j] * cos(fj); - *(float *)((x->x_vec + sizeof(t_word) * i) + yonset) = sum; + *((float *)((array->a_vec + elemsize * i)) + yonset) + = sum; } garray_redraw(x); } static void garray_sinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) -{ - t_template *template = garray_template(x); - +{ t_float *svec = (t_float *)t_getbytes(sizeof(t_float) * argc); int npoints, i; if (argc < 2) { error("sinesum: %s: need number of points and partial strengths", - x->x_templatesym->s_name); + x->x_realname->s_name); return; } @@ -961,14 +1180,12 @@ static void garray_sinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) { - t_template *template = garray_template(x); - t_float *svec = (t_float *)t_getbytes(sizeof(t_float) * argc); int npoints, i; if (argc < 2) { error("sinesum: %s: need number of points and partial strengths", - x->x_templatesym->s_name); + x->x_realname->s_name); return; } @@ -986,23 +1203,23 @@ static void garray_cosinesum(t_garray *x, t_symbol *s, int argc, t_atom *argv) static void garray_normalize(t_garray *x, t_float f) { - t_template *template = garray_template(x); - int yonset, type, npoints, i; + int type, npoints, i; double maxv, renormer; - t_symbol *arraytype; - - if (f <= 0) - f = 1; - - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) + int yonset, elemsize; + t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!array) { - error("%s: needs floating-point 'y' field", x->x_templatesym->s_name); + error("%s: needs floating-point 'y' field", x->x_realname); return; } - for (i = 0, maxv = 0; i < x->x_n; i++) + + if (f <= 0) + f = 1; + + for (i = 0, maxv = 0; i < array->a_n; i++) { - double v = *(float *)((x->x_vec + sizeof(t_word) * i) + yonset); + double v = *((float *)(array->a_vec + elemsize * i) + + yonset); if (v > maxv) maxv = v; if (-v > maxv) @@ -1011,11 +1228,9 @@ static void garray_normalize(t_garray *x, t_float f) if (maxv > 0) { renormer = f / maxv; - for (i = 0; i < x->x_n; i++) - { - *(float *)((x->x_vec + sizeof(t_word) * i) + yonset) + for (i = 0; i < array->a_n; i++) + *((float *)(array->a_vec + elemsize * i) + yonset) *= renormer; - } } garray_redraw(x); } @@ -1024,14 +1239,15 @@ static void garray_normalize(t_garray *x, t_float f) the "y" slot of the array. This generalizes Max's "table", sort of. */ static void garray_list(t_garray *x, t_symbol *s, int argc, t_atom *argv) { - t_template *template = garray_template(x); - int yonset, type, i; - t_symbol *arraytype; - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) - error("%s: needs floating-point 'y' field", - x->x_templatesym->s_name); - else if (argc < 2) return; + int i; + int yonset, elemsize; + t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!array) + { + error("%s: needs floating-point 'y' field", x->x_realname); + return; + } + if (argc < 2) return; else { int firstindex = atom_getfloat(argv); @@ -1045,14 +1261,14 @@ static void garray_list(t_garray *x, t_symbol *s, int argc, t_atom *argv) firstindex = 0; if (argc <= 0) return; } - if (argc + firstindex > x->x_n) + if (argc + firstindex > array->a_n) { - argc = x->x_n - firstindex; + argc = array->a_n - firstindex; if (argc <= 0) return; } for (i = 0; i < argc; i++) - *(float *)((x->x_vec + sizeof(t_word) * (i + firstindex)) + yonset) = - atom_getfloat(argv + i); + *((float *)(array->a_vec + elemsize * i) + yonset) + = atom_getfloat(argv + i); } garray_redraw(x); } @@ -1089,6 +1305,12 @@ static void garray_ylabel(t_garray *x, t_symbol *s, int argc, t_atom *argv) /* change the name of a garray. */ static void garray_rename(t_garray *x, t_symbol *s) { + /* jsarlo { */ + if (x->x_listviewing) + { + garray_arrayviewlist_close(x); + } + /* } jsarlo */ pd_unbind(&x->x_gobj.g_pd, x->x_realname); pd_bind(&x->x_gobj.g_pd, x->x_realname = x->x_name = s); garray_redraw(x); @@ -1096,18 +1318,17 @@ static void garray_rename(t_garray *x, t_symbol *s) static void garray_read(t_garray *x, t_symbol *filename) { - int nelem = x->x_n, filedesc; + int nelem, filedesc, i; FILE *fd; char buf[MAXPDSTRING], *bufptr; - t_template *template = garray_template(x); - int yonset, type, i; - t_symbol *arraytype; - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) + int yonset, elemsize; + t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!array) { - error("%s: needs floating-point 'y' field", x->x_templatesym->s_name); + error("%s: needs floating-point 'y' field", x->x_realname); return; } + nelem = array->a_n; if ((filedesc = open_via_path( canvas_getdir(glist_getcanvas(x->x_glist))->s_name, filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0 @@ -1118,8 +1339,8 @@ static void garray_read(t_garray *x, t_symbol *filename) } for (i = 0; i < nelem; i++) { - if (!fscanf(fd, "%f", (float *)((x->x_vec + sizeof(t_word) * i) + - yonset))) + if (!fscanf(fd, "%f", ((float *)(array->a_vec + + elemsize * i) + yonset))) { post("%s: read %d elements into table of size %d", filename->s_name, i, nelem); @@ -1127,82 +1348,8 @@ static void garray_read(t_garray *x, t_symbol *filename) } } while (i < nelem) - *(float *)((x->x_vec + sizeof(t_word) * i) + yonset) = 0, i++; - fclose(fd); - garray_redraw(x); -} - - /* this should be renamed and moved... */ -int garray_ambigendian(void) -{ - unsigned short s = 1; - unsigned char c = *(char *)(&s); - return (c==0); -} - -#define BINREADMODE "rb" -#define BINWRITEMODE "wb" - -static void garray_read16(t_garray *x, t_symbol *filename, - t_symbol *endian, t_floatarg fskip) -{ - int skip = fskip, filedesc; - int i, nelem; - float *vec; - FILE *fd; - char buf[MAXPDSTRING], *bufptr; - short s; - int cpubig = garray_ambigendian(), swap = 0; - char c = endian->s_name[0]; - if (c == 'b') - { - if (!cpubig) swap = 1; - } - else if (c == 'l') - { - if (cpubig) swap = 1; - } - else if (c) - { - error("array_read16: endianness is 'l' (low byte first ala INTEL)"); - post("... or 'b' (high byte first ala MIPS,DEC,PPC)"); - } - if (!garray_getfloatarray(x, &nelem, &vec)) - { - error("%s: not a float array", x->x_templatesym->s_name); - return; - } - if ((filedesc = open_via_path( - canvas_getdir(glist_getcanvas(x->x_glist))->s_name, - filename->s_name, "", buf, &bufptr, MAXPDSTRING, 1)) < 0 - || !(fd = fdopen(filedesc, BINREADMODE))) - { - error("%s: can't open", filename->s_name); - return; - } - if (skip) - { - long pos = fseek(fd, (long)skip, SEEK_SET); - if (pos < 0) - { - error("%s: can't seek to byte %d", buf, skip); - fclose(fd); - return; - } - } - - for (i = 0; i < nelem; i++) - { - if (fread(&s, sizeof(s), 1, fd) < 1) - { - post("%s: read %d elements into table of size %d", - filename->s_name, i, nelem); - break; - } - if (swap) s = ((s & 0xff) << 8) | ((s & 0xff00) >> 8); - vec[i] = s * (1./32768.); - } - while (i < nelem) vec[i++] = 0; + *((float *)(array->a_vec + + elemsize * i) + yonset) = 0, i++; fclose(fd); garray_redraw(x); } @@ -1211,13 +1358,11 @@ static void garray_write(t_garray *x, t_symbol *filename) { FILE *fd; char buf[MAXPDSTRING]; - t_template *template = garray_template(x); - int yonset, type, i; - t_symbol *arraytype; - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) + int yonset, elemsize, i; + t_array *array = garray_getarray_floatonly(x, &yonset, &elemsize); + if (!array) { - error("%s: needs floating-point 'y' field", x->x_templatesym->s_name); + error("%s: needs floating-point 'y' field", x->x_realname); return; } canvas_makefilename(glist_getcanvas(x->x_glist), filename->s_name, @@ -1228,10 +1373,10 @@ static void garray_write(t_garray *x, t_symbol *filename) error("%s: can't create", buf); return; } - for (i = 0; i < x->x_n; i++) + for (i = 0; i < array->a_n; i++) { if (fprintf(fd, "%g\n", - *(float *)((x->x_vec + sizeof(t_word) * i) + yonset)) < 1) + *(float *)(((array->a_vec + sizeof(t_word) * i)) + yonset)) < 1) { post("%s: write error", filename->s_name); break; @@ -1240,144 +1385,31 @@ static void garray_write(t_garray *x, t_symbol *filename) fclose(fd); } -static unsigned char waveheader[] = { -0x52, 0x49, 0x46, 0x46, -0x00, 0x00, 0x00, 0x00, -0x57, 0x41, 0x56, 0x45, -0x66, 0x6d, 0x74, 0x20, - -0x10, 0x00, 0x00, 0x00, -0x01, 0x00, 0x01, 0x00, -0x44, 0xac, 0x00, 0x00, -0x88, 0x58, 0x01, 0x00, -0x02, 0x00, 0x10, 0x00, -0x64, 0x61, 0x74, 0x61, -0x00, 0x00, 0x00, 0x00, -}; - - /* wave format only so far */ -static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format) + /* this should be renamed and moved... */ +int garray_ambigendian(void) { - t_template *template = garray_template(x); - int yonset, type, i; - t_symbol *arraytype; - FILE *fd; - int aiff = (format == gensym("aiff")); - char filenamebuf[MAXPDSTRING], buf2[MAXPDSTRING]; - int swap = garray_ambigendian(); /* wave is only little endian */ - int intbuf; - strncpy(filenamebuf, filename->s_name, MAXPDSTRING-10); - filenamebuf[MAXPDSTRING-10] = 0; - if (sizeof(int) != 4) post("write16: only works on 32-bit machines"); - if (aiff) - { - if (strcmp(filenamebuf + strlen(filenamebuf)-5, ".aiff")) - strcat(filenamebuf, ".aiff"); - } - else - { - if (strcmp(filenamebuf + strlen(filenamebuf)-4, ".wav")) - strcat(filenamebuf, ".wav"); - } - if (!template_find_field(template, gensym("y"), &yonset, - &type, &arraytype) || type != DT_FLOAT) - { - error("%s: needs floating-point 'y' field", x->x_templatesym->s_name); - return; - } - canvas_makefilename(glist_getcanvas(x->x_glist), filenamebuf, - buf2, MAXPDSTRING); - sys_bashfilename(buf2, buf2); - if (!(fd = fopen(buf2, BINWRITEMODE))) - { - error("%s: can't create", buf2); - return; - } - intbuf = 2 * x->x_n + 36; - if (swap) - { - unsigned char *foo = (unsigned char *)&intbuf, xxx; - xxx = foo[0]; foo[0] = foo[3]; foo[3] = xxx; - xxx = foo[1]; foo[1] = foo[2]; foo[2] = xxx; - } - memcpy((void *)(waveheader + 4), (void *)(&intbuf), 4); - intbuf = 2 * x->x_n; - if (swap) - { - unsigned char *foo = (unsigned char *)&intbuf, xxx; - xxx = foo[0]; foo[0] = foo[3]; foo[3] = xxx; - xxx = foo[1]; foo[1] = foo[2]; foo[2] = xxx; - } - memcpy((void *)(waveheader + 40), (void *)(&intbuf), 4); - if (fwrite(waveheader, sizeof(waveheader), 1, fd) < 1) - { - post("%s: write error", buf2); - goto closeit; - } - for (i = 0; i < x->x_n; i++) - { - float f = 32767. * *(float *)((x->x_vec + sizeof(t_word) * i) + yonset); - short sh; - if (f < -32768) f = -32768; - else if (f > 32767) f = 32767; - sh = f; - if (swap) - { - unsigned char *foo = (unsigned char *)&sh, xxx; - xxx = foo[0]; foo[0] = foo[1]; foo[1] = xxx; - } - if (fwrite(&sh, sizeof(sh), 1, fd) < 1) - { - post("%s: write error", buf2); - goto closeit; - } - } -closeit: - fclose(fd); + unsigned short s = 1; + unsigned char c = *(char *)(&s); + return (c==0); } void garray_resize(t_garray *x, t_floatarg f) { - int was = x->x_n, elemsize; - t_glist *gl; - int dspwas; - int n = f; - char *nvec; - - if (n < 1) n = 1; - elemsize = template_findbyname(x->x_templatesym)->t_n * sizeof(t_word); - nvec = t_resizebytes(x->x_vec, was * elemsize, n * elemsize); - if (!nvec) - { - pd_error(x, "array resize failed: out of memory"); - return; - } - x->x_vec = nvec; - /* LATER should check t_resizebytes result */ - if (n > was) - memset(x->x_vec + was*elemsize, - 0, (n - was) * elemsize); - x->x_n = n; - - /* if this is the only array in the graph, - reset the graph's coordinates */ - gl = x->x_glist; - if (gl->gl_list == &x->x_gobj && !x->x_gobj.g_next) - { - vmess(&gl->gl_pd, gensym("bounds"), "ffff", - 0., gl->gl_y1, (double)(n > 1 ? n-1 : 1), gl->gl_y2); - /* close any dialogs that might have the wrong info now... */ - gfxstub_deleteforkey(gl); - } - else garray_redraw(x); - if (x->x_usedindsp) canvas_update_dsp(); + t_array *array = garray_getarray(x); + t_glist *gl = x->x_glist; + int n = (f < 1 ? 1 : f); + garray_fittograph(x, n, template_getfloat( + template_findbyname(x->x_scalar->sc_template), + gensym("style"), x->x_scalar->sc_vec, 1)); + array_resize_and_redraw(array, x->x_glist, n); } static void garray_print(t_garray *x) -{ +{ + t_array *array = garray_getarray(x); post("garray %s: template %s, length %d", - x->x_name->s_name, x->x_templatesym->s_name, x->x_n); + x->x_realname->s_name, array->a_templatesym->s_name, array->a_n); } void g_array_setup(void) @@ -1402,12 +1434,8 @@ void g_array_setup(void) A_SYMBOL, 0); class_addmethod(garray_class, (t_method)garray_read, gensym("read"), A_SYMBOL, A_NULL); - class_addmethod(garray_class, (t_method)garray_read16, gensym("read16"), - A_SYMBOL, A_DEFFLOAT, A_DEFSYM, A_NULL); class_addmethod(garray_class, (t_method)garray_write, gensym("write"), A_SYMBOL, A_NULL); - class_addmethod(garray_class, (t_method)garray_write16, gensym("write16"), - A_SYMBOL, A_DEFSYM, A_NULL); class_addmethod(garray_class, (t_method)garray_resize, gensym("resize"), A_FLOAT, A_NULL); class_addmethod(garray_class, (t_method)garray_print, gensym("print"), @@ -1420,6 +1448,14 @@ void g_array_setup(void) gensym("normalize"), A_DEFFLOAT, 0); class_addmethod(garray_class, (t_method)garray_arraydialog, gensym("arraydialog"), A_SYMBOL, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); +/* jsarlo { */ + class_addmethod(garray_class, (t_method)garray_arrayviewlist_new, + gensym("arrayviewlistnew"), A_NULL); + class_addmethod(garray_class, (t_method)garray_arrayviewlist_fillpage, + gensym("arrayviewlistfillpage"), A_FLOAT, A_NULL); + class_addmethod(garray_class, (t_method)garray_arrayviewlist_close, + gensym("arrayviewclose"), A_NULL); +/* } jsarlo */ class_setsavefn(garray_class, garray_save); } diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index a1beb8a8..c34e1502 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -5,19 +5,6 @@ /* this file defines the "glist" class, also known as "canvas" (the two used to be different but are now unified except for some fossilized names.) */ -/* changes by Thomas Musil IEM KUG Graz Austria 2001 */ - -/* bug-fix: canvas_menuclose(): by Krzysztof Czaja */ -/* bug-fix: table_new(): I reversed the y-bounds */ - -/* IOhannes : - * changed the canvas_restore, so that it might accept $args as well - * (like "pd $0_test") - * so you can make multiple & distinguishable templates - * 1511:forum::für::umläute:2001 - * changes marked with IOhannes - */ - #include #include #include "m_pd.h" @@ -950,7 +937,7 @@ void canvas_objfor(t_glist *gl, t_text *x, int argc, t_atom *argv); void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) -{ /* IOhannes */ +{ t_pd *z; /* this should be unnecessary, but sometimes the canvas's name gets out of sync with the owning box's argument; this fixes that */ @@ -1355,7 +1342,7 @@ static void glist_redrawall(t_glist *gl) } /* public interface for above */ -void canvas_redrawallfortemplate(t_canvas *templatecanvas) +void canvas_redrawallfortemplate( t_template *template) { t_canvas *x; /* find all root canvases */ diff --git a/pd/src/g_canvas.h b/pd/src/g_canvas.h index 0433f4a2..0ff68775 100644 --- a/pd/src/g_canvas.h +++ b/pd/src/g_canvas.h @@ -196,8 +196,6 @@ typedef struct _dataslot t_symbol *ds_arraytemplate; /* filled in for arrays only */ } t_dataslot; - -/* T.Grill - changed t_pd member to t_pdobj to avoid name clashed */ typedef struct _template { t_pd t_pdobj; /* header */ @@ -215,7 +213,7 @@ struct _array t_symbol *a_templatesym; /* template for elements */ int a_valid; /* protection against stale pointers into array */ t_gpointer a_gp; /* pointer to scalar or array element we're in */ - t_gstub *a_stub; + t_gstub *a_stub; /* stub for pointing into this array */ }; /* structure for traversing all the connections in a glist */ @@ -302,7 +300,8 @@ typedef void (*t_parentvisfn)(t_gobj *x, struct _glist *glist, int flag); /* field a mouse click */ typedef int (*t_parentclickfn)(t_gobj *x, struct _glist *glist, - t_scalar *sc, t_template *tmpl, float basex, float basey, + t_word *data, t_template *tmpl, t_scalar *sc, t_array *ap, + float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit); struct _parentwidgetbehavior @@ -331,6 +330,10 @@ extern t_canvas *canvas_list; /* list of all root canvases */ extern t_class *vinlet_class, *voutlet_class; extern int glist_valid; /* incremented when pointers might be stale */ +#define PLOTSTYLE_POINTS 0 /* plotting styles for arrays */ +#define PLOTSTYLE_POLY 1 +#define PLOTSTYLE_BEZ 2 + /* ------------------- functions on any gobj ----------------------------- */ EXTERN void gobj_getrect(t_gobj *x, t_glist *owner, int *x1, int *y1, int *x2, int *y2); @@ -450,7 +453,7 @@ EXTERN t_inlet *canvas_addinlet(t_canvas *x, t_pd *who, t_symbol *sym); EXTERN void canvas_rminlet(t_canvas *x, t_inlet *ip); EXTERN t_outlet *canvas_addoutlet(t_canvas *x, t_pd *who, t_symbol *sym); EXTERN void canvas_rmoutlet(t_canvas *x, t_outlet *op); -EXTERN void canvas_redrawallfortemplate(t_canvas *tmpl); +EXTERN void canvas_redrawallfortemplate( t_template *tmpl); EXTERN void canvas_zapallfortemplate(t_canvas *tmpl); EXTERN void canvas_setusedastemplate(t_canvas *x); EXTERN t_canvas *canvas_getcurrent(void); @@ -491,8 +494,6 @@ EXTERN void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf, EXTERN void canvas_noundo(t_canvas *x); EXTERN int canvas_getindex(t_canvas *x, t_gobj *y); -/* T.Grill - made public for dynamic object creation */ -/* in g_editor.c */ EXTERN void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno,t_floatarg fwhoin, t_floatarg finno); EXTERN void canvas_disconnect(t_canvas *x, @@ -531,7 +532,7 @@ EXTERN t_template *garray_template(t_garray *x); EXTERN t_garray *graph_array(t_glist *gl, t_symbol *s, t_symbol *tmpl, t_floatarg f, t_floatarg saveit); EXTERN t_array *array_new(t_symbol *templatesym, t_gpointer *parent); -EXTERN void array_resize(t_array *x, t_template *tmpl, int n); +EXTERN void array_resize(t_array *x, int n); EXTERN void array_free(t_array *x); /* --------------------- gpointers and stubs ---------------- */ @@ -545,10 +546,11 @@ EXTERN void word_restore(t_word *wp, t_template *tmpl, int argc, t_atom *argv); EXTERN t_scalar *scalar_new(t_glist *owner, t_symbol *templatesym); +EXTERN void word_free(t_word *wp, t_template *template); EXTERN void scalar_getbasexy(t_scalar *x, float *basex, float *basey); /* ------helper routines for "garrays" and "plots" -------------- */ -EXTERN int array_doclick(t_array *array, t_glist *glist, t_gobj *gobj, +EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap, t_symbol *elemtemplatesym, float linewidth, float xloc, float xinc, float yloc, int xpix, int ypix, int shift, int alt, int dbl, int doit); diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index 77d8cba5..02fe7726 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -712,14 +712,6 @@ void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except) /* ------------------------ event handling ------------------------ */ -#define CURSOR_RUNMODE_NOTHING 0 -#define CURSOR_RUNMODE_CLICKME 1 -#define CURSOR_RUNMODE_THICKEN 2 -#define CURSOR_RUNMODE_ADDPOINT 3 -#define CURSOR_EDITMODE_NOTHING 4 -#define CURSOR_EDITMODE_CONNECT 5 -#define CURSOR_EDITMODE_DISCONNECT 6 - static char *cursorlist[] = { #ifdef MSW "right_ptr", /* CURSOR_RUNMODE_NOTHING */ @@ -1021,8 +1013,9 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, /* check if the object wants to be clicked */ if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2) && (clickreturned = gobj_click(y, x, xpos, ypos, - shiftmod, altmod, 0, doit))) - break; + shiftmod, ((mod & CTRLMOD) && (!x->gl_edit)) || altmod, + 0, doit))) + break; } if (!doit) { diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index 8bb76ac0..1c9afc30 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -39,7 +39,8 @@ void glist_add(t_glist *x, t_gobj *y) if (glist_isvisible(x)) gobj_vis(y, x, 1); if (class_isdrawcommand(y->g_pd)) - canvas_redrawallfortemplate(glist_getcanvas(x)); + canvas_redrawallfortemplate(template_findbyname(canvas_makebindsym( + glist_getcanvas(x)->gl_name))); } /* this is to protect against a hairy problem in which deleting @@ -104,7 +105,9 @@ void glist_delete(t_glist *x, t_gobj *y) } pd_free(&y->g_pd); if (chkdsp) canvas_update_dsp(); - if (drawcommand) canvas_redrawallfortemplate(canvas); + if (drawcommand) + canvas_redrawallfortemplate(template_findbyname(canvas_makebindsym( + glist_getcanvas(x)->gl_name))); canvas_setdeleting(canvas, wasdeleting); x->gl_valid = ++glist_valid; } diff --git a/pd/src/g_io.c b/pd/src/g_io.c index 4b4fb9b1..08eec227 100644 --- a/pd/src/g_io.c +++ b/pd/src/g_io.c @@ -13,15 +13,6 @@ separate classes for "signal" and "control" outlets, but this would complicate life elsewhere. */ -/* hacked to run subpatches with different samplerates - * - * mfg.gfd.uil - * IOhannes - * - * edited lines are marked with "IOhannes" - * - */ - #include "m_pd.h" #include "g_canvas.h" #include @@ -46,7 +37,7 @@ typedef struct _vinlet signal from the prolog to the DSP routine: */ t_signal *x_directsignal; - t_resample x_updown; /* IOhannes */ + t_resample x_updown; } t_vinlet; static void *vinlet_new(t_symbol *s) @@ -173,8 +164,8 @@ int inlet_getsignalindex(t_inlet *x); /* set up prolog DSP code */ void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, - int myvecsize, int phase, int period, int frequency, int downsample, int upsample/* IOhannes */, int reblock, - int switched) + int myvecsize, int phase, int period, int frequency, + int downsample, int upsample, int reblock, int switched) { t_signal *insig, *outsig; x->x_updown.downsample = downsample; @@ -185,7 +176,7 @@ void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, if (reblock) { int parentvecsize, bufsize, oldbufsize, prologphase; - int re_parentvecsize; /* resampled parentvectorsize: IOhannes */ + int re_parentvecsize; /* resampled parentvectorsize */ /* this should never happen: */ if (!x->x_buf) return; @@ -219,8 +210,7 @@ void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, x->x_buf = buf; } if (parentsigs) - { - /* IOhannes { */ + { x->x_hop = period * re_parentvecsize; x->x_fill = x->x_endbuf - @@ -231,9 +221,8 @@ void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, else { resamplefrom_dsp(&x->x_updown, insig->s_vec, parentvecsize, re_parentvecsize, x->x_updown.method); dsp_add(vinlet_doprolog, 3, x, x->x_updown.s_vec, re_parentvecsize); - } + } - /* } 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->s_refcount) @@ -312,7 +301,7 @@ typedef struct _voutlet /* and here's a flag indicating that we aren't blocked but have to do a copy (because we're switched). */ char x_justcopyout; - t_resample x_updown; /* IOhannes */ + t_resample x_updown; } t_voutlet; static void *voutlet_new(t_symbol *s) @@ -401,11 +390,12 @@ t_int *voutlet_perform(t_int *w) static t_int *voutlet_doepilog(t_int *w) { t_voutlet *x = (t_voutlet *)(w[1]); - t_float *out = (t_float *)(w[2]); /* IOhannes */ + t_float *out = (t_float *)(w[2]); int n = (int)(w[3]); t_float *in = x->x_empty; - if (x->x_updown.downsample != x->x_updown.upsample) out = x->x_updown.s_vec; /* IOhannes */ + if (x->x_updown.downsample != x->x_updown.upsample) + out = x->x_updown.s_vec; #if 0 if (tot < 5) post("outlet in %lx out %lx n %lx", in, out, n), tot++; @@ -416,13 +406,12 @@ static t_int *voutlet_doepilog(t_int *w) return (w+4); } -/* IOhannes { */ static t_int *voutlet_doepilog_resampling(t_int *w) { t_voutlet *x = (t_voutlet *)(w[1]); int n = (int)(w[2]); t_float *in = x->x_empty; - t_float *out = x->x_updown.s_vec; /* IOhannes */ + t_float *out = x->x_updown.s_vec; #if 0 if (tot < 5) post("outlet in %lx out %lx n %lx", in, out, n), tot++; @@ -432,7 +421,7 @@ static t_int *voutlet_doepilog_resampling(t_int *w) x->x_empty = in; return (w+3); } -/* } IOhannes */ + int outlet_getsignalindex(t_outlet *x); /* prolog for outlets -- store pointer to the outlet on the @@ -440,10 +429,11 @@ int outlet_getsignalindex(t_outlet *x); back to whatever we see on our input during the "dsp" method called later. */ void voutlet_dspprolog(t_voutlet *x, t_signal **parentsigs, - int myvecsize, int phase, int period, int frequency, int downsample, int upsample /* IOhannes */, int reblock, - int switched) + int myvecsize, int phase, int period, int frequency, + int downsample, int upsample, int reblock, int switched) { - x->x_updown.downsample=downsample; x->x_updown.upsample=upsample; /* IOhannes */ + x->x_updown.downsample=downsample; + x->x_updown.upsample=upsample; x->x_justcopyout = (switched && !reblock); if (reblock) { @@ -480,16 +470,16 @@ static void voutlet_dsp(t_voutlet *x, t_signal **sp) If we aren't reblocking, there's nothing to do here. */ void voutlet_dspepilog(t_voutlet *x, t_signal **parentsigs, int myvecsize, int phase, int period, int frequency, int downsample, - int upsample /* IOhannes */, int reblock, int switched) + int upsample, int reblock, int switched) { if (!x->x_buf) return; /* this shouldn't be necesssary... */ x->x_updown.downsample=downsample; - x->x_updown.upsample=upsample; /* IOhannes */ + x->x_updown.upsample=upsample; if (reblock) { t_signal *insig, *outsig; int parentvecsize, bufsize, oldbufsize; - int re_parentvecsize; /* IOhannes */ + int re_parentvecsize; int bigperiod, epilogphase, blockphase; if (parentsigs) { @@ -503,11 +493,11 @@ void voutlet_dspepilog(t_voutlet *x, t_signal **parentsigs, parentvecsize = 1; re_parentvecsize = 1; } - bigperiod = myvecsize/re_parentvecsize; /* IOhannes */ + bigperiod = myvecsize/re_parentvecsize; if (!bigperiod) bigperiod = 1; epilogphase = phase & (bigperiod - 1); blockphase = (phase + period - 1) & (bigperiod - 1) & (- period); - bufsize = re_parentvecsize; /* IOhannes */ + bufsize = re_parentvecsize; if (bufsize < myvecsize) bufsize = myvecsize; if (bufsize != (oldbufsize = x->x_bufsize)) { @@ -519,28 +509,27 @@ void voutlet_dspepilog(t_voutlet *x, t_signal **parentsigs, x->x_endbuf = buf + bufsize; x->x_buf = buf; } - /* IOhannes: { */ if (re_parentvecsize * period > bufsize) bug("voutlet_dspepilog"); x->x_write = x->x_buf + re_parentvecsize * blockphase; if (x->x_write == x->x_endbuf) x->x_write = x->x_buf; if (period == 1 && frequency > 1) - x->x_hop = re_parentvecsize / frequency; + x->x_hop = re_parentvecsize / frequency; else x->x_hop = period * re_parentvecsize; - /* } IOhannes */ /* post("phase %d, block %d, parent %d", phase & 63, parentvecsize * blockphase, parentvecsize * epilogphase); */ if (parentsigs) { - /* set epilog pointer and schedule it */ - /* IOhannes { */ - x->x_empty = x->x_buf + re_parentvecsize * epilogphase; - if (upsample * downsample == 1) - dsp_add(voutlet_doepilog, 3, x, outsig->s_vec, re_parentvecsize); - else { - dsp_add(voutlet_doepilog_resampling, 2, x, re_parentvecsize); - resampleto_dsp(&x->x_updown, outsig->s_vec, re_parentvecsize, parentvecsize, x->x_updown.method); - } - /* } IOhannes */ + /* set epilog pointer and schedule it */ + x->x_empty = x->x_buf + re_parentvecsize * epilogphase; + if (upsample * downsample == 1) + dsp_add(voutlet_doepilog, 3, x, outsig->s_vec, + re_parentvecsize); + else + { + dsp_add(voutlet_doepilog_resampling, 2, x, re_parentvecsize); + resampleto_dsp(&x->x_updown, outsig->s_vec, re_parentvecsize, + parentvecsize, x->x_updown.method); + } } } /* if we aren't blocked but we are switched, the epilog code just diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c index 77c05126..7a3a161c 100644 --- a/pd/src/g_readwrite.c +++ b/pd/src/g_readwrite.c @@ -81,7 +81,7 @@ static void glist_readatoms(t_glist *x, int natoms, t_atom *vec, /* empty line terminates array */ if (!nline) break; - array_resize(a, arraytemplate, nitems + 1); + array_resize(a, nitems + 1); element = (t_word *)(((char *)a->a_vec) + nitems * elemsize); glist_readatoms(x, natoms, vec, p_nextmsg, arraytemplatesym, diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c index 6c35c2d4..3a61a39d 100644 --- a/pd/src/g_scalar.c +++ b/pd/src/g_scalar.c @@ -6,19 +6,8 @@ "gobj". Scalars have templates which describe their structures, which can contain numbers, sublists, and arrays. -Also, the "tscalar" object, an ordinary text object that owns a single "scalar" -and draws it on the parent. This is intended as a way that abstractions can -control their appearances by adding stuff to draw. */ -/* IOhannes : - * changed the canvas_restore, so that it might accept $args as well (like "pd $0_test") - * so you can make multiple & distinguishable templates - * 1511:forum::für::umläute:2001 - * changes marked with IOhannes - * added Krzysztof Czajas fix to avoid crashing... - */ - #include #include #include /* for read/write to files */ @@ -304,28 +293,37 @@ static void scalar_vis(t_gobj *z, t_glist *owner, int vis) sys_unqueuegui(x); } -static int scalar_click(t_gobj *z, struct _glist *owner, - int xpix, int ypix, int shift, int alt, int dbl, int doit) +int scalar_doclick(t_word *data, t_template *template, t_scalar *sc, + t_array *ap, struct _glist *owner, + float xloc, float yloc, int xpix, int ypix, + int shift, int alt, int dbl, int doit) { - t_scalar *x = (t_scalar *)z; int hit = 0; - t_template *template = template_findbyname(x->sc_template); t_canvas *templatecanvas = template_findcanvas(template); t_gobj *y; - float basex, basey; - scalar_getbasexy(x, &basex, &basey); + float basex = template_getfloat(template, gensym("x"), data, 0); + float basey = template_getfloat(template, gensym("y"), data, 0); for (y = templatecanvas->gl_list; y; y = y->g_next) { t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd); if (!wb) continue; if (hit = (*wb->w_parentclickfn)(y, owner, - x, template, basex, basey, + data, template, sc, ap, basex + xloc, basey + yloc, xpix, ypix, shift, alt, dbl, doit)) return (hit); } return (0); } +static int scalar_click(t_gobj *z, struct _glist *owner, + int xpix, int ypix, int shift, int alt, int dbl, int doit) +{ + t_scalar *x = (t_scalar *)z; + t_template *template = template_findbyname(x->sc_template); + return (scalar_doclick(x->sc_vec, template, x, 0, + owner, 0, 0, xpix, ypix, shift, alt, dbl, doit)); +} + void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b, int amarrayelement); diff --git a/pd/src/g_template.c b/pd/src/g_template.c index 086cd787..74926ecb 100644 --- a/pd/src/g_template.c +++ b/pd/src/g_template.c @@ -10,15 +10,14 @@ #include "s_stuff.h" /* for sys_hostfontsize */ #include "g_canvas.h" +void array_redraw(t_array *a, t_glist *glist); + /* This file contains text objects you would put in a canvas to define a template. Templates describe objects of type "array" (g_array.c) and "scalar" (g_scalar.c). */ -/* T.Grill - changed the _template.t_pd member to t_pdobj to avoid name clashes -with the t_pd type */ - /* the structure of a "struct" object (also the obsolete "gtemplate" you get when using the name "template" in a box.) */ @@ -48,22 +47,6 @@ static t_class *template_class; /* there's a pre-defined "float" template. LATER should we bind this to a symbol such as "pd-float"??? */ -static t_dataslot template_float_vec = -{ - DT_FLOAT, - &s_y, - &s_ -}; - -static t_template template_float = -{ - 0, /* class -- fill in in setup routine */ - 0, /* list of "struct"/t_gtemplate objects */ - &s_float, /* name */ - 1, /* number of items */ - &template_float_vec -}; - /* return true if two dataslot definitions match */ static int dataslot_matches(t_dataslot *ds1, t_dataslot *ds2, int nametoo) @@ -255,7 +238,7 @@ int template_match(t_template *x1, t_template *x2) in their template. The old template is assumed to be the "installed" one so we can delete old items; but making new ones we have to avoid scalar_new which would make an old one whereas we will want a new one (but whose array -elements might still be old ones. +elements might still be old ones.) LATER deal with graphics updates too... */ /* conform the word vector of a scalar to the new template */ @@ -323,9 +306,13 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, } /* burn the old one */ pd_free(&scfrom->sc_gobj.g_pd); + scalartemplate = tto; + } + else + { + x = scfrom; + scalartemplate = template_findbyname(x->sc_template); } - else x = scfrom; - scalartemplate = template_findbyname(x->sc_template); /* convert all array elements and sublists */ for (i = 0; i < scalartemplate->t_n; i++) { @@ -348,13 +335,14 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, static void template_conformarray(t_template *tfrom, t_template *tto, int *conformaction, t_array *a) { - int i; + int i, j; + t_template *scalartemplate; if (a->a_templatesym == tfrom->t_sym) { /* the array elements must all be conformed */ int oldelemsize = sizeof(t_word) * tfrom->t_n, newelemsize = sizeof(t_word) * tto->t_n; - char *newarray = getbytes(sizeof(t_word) * tto->t_n * a->a_n); + char *newarray = getbytes(newelemsize * a->a_n); char *oldarray = a->a_vec; if (a->a_elemsize != oldelemsize) bug("template_conformarray"); @@ -364,10 +352,31 @@ static void template_conformarray(t_template *tfrom, t_template *tto, word_init(wp, tto, &a->a_gp); template_conformwords(tfrom, tto, conformaction, (t_word *)(oldarray + oldelemsize * i), wp); + word_free((t_word *)(oldarray + oldelemsize * i), tfrom); + } + scalartemplate = tto; + a->a_vec = newarray; + freebytes(oldarray, oldelemsize * a->a_n); + } + /* convert all arrays and sublist fields in each element of the array */ + for (i = 0; i < a->a_n; i++) + { + t_word *wp = (t_word *)(a->a_vec + sizeof(t_word) * a->a_n * i); + for (j = 0; j < scalartemplate->t_n; j++) + { + t_dataslot *ds = scalartemplate->t_vec + j; + if (ds->ds_type == DT_LIST) + { + t_glist *gl2 = wp[j].w_list; + template_conformglist(tfrom, tto, gl2, conformaction); + } + else if (ds->ds_type == DT_ARRAY) + { + template_conformarray(tfrom, tto, conformaction, + wp[j].w_array); + } } } - bug("template_conformarray: this part not written"); - /* go through item by item conforming subarrays and sublists... */ } /* this routine searches for every scalar in the glist that belongs @@ -375,6 +384,8 @@ static void template_conformarray(t_template *tfrom, t_template *tto, glists recursively. We don't handle redrawing here; this is to be filled in LATER... */ +t_array *garray_getarray(t_garray *x); + static void template_conformglist(t_template *tfrom, t_template *tto, t_glist *glist, int *conformaction) { @@ -387,6 +398,9 @@ static void template_conformglist(t_template *tfrom, t_template *tto, glist, (t_scalar *)g)->sc_gobj; else if (pd_class(&g->g_pd) == canvas_class) template_conformglist(tfrom, tto, (t_glist *)g, conformaction); + else if (pd_class(&g->g_pd) == garray_class) + template_conformarray(tfrom, tto, conformaction, + garray_getarray((t_garray *)g)); } } @@ -443,14 +457,12 @@ void template_conform(t_template *tfrom, t_template *tto) } freebytes(conformaction, sizeof(int) * nto); freebytes(conformedfrom, sizeof(int) * nfrom); + canvas_redrawallfortemplate(tto); } t_template *template_findbyname(t_symbol *s) { - int i; - if (s == &s_float) - return (&template_float); - else return ((t_template *)pd_findbyclass(s, template_class)); + return ((t_template *)pd_findbyclass(s, template_class)); } t_canvas *template_findcanvas(t_template *template) @@ -529,10 +541,10 @@ static void template_setup(void) /* ---------------- gtemplates. One per canvas. ----------- */ -/* this is a "text" object that searches for, and if necessary creates, -a "template" (above). Other objects in the canvas then can give drawing +/* "Struct": an object that searches for, and if necessary creates, +a template (above). Other objects in the canvas then can give drawing instructions for the template. The template doesn't go away when the -gtemplate is deleted, so that you can replace it with +"struct" is deleted, so that you can replace it with another one to add new fields, for example. */ static void *gtemplate_donew(t_symbol *sym, int argc, t_atom *argv) @@ -553,7 +565,7 @@ static void *gtemplate_donew(t_symbol *sym, int argc, t_atom *argv) if (t) { x->x_template = t; - /* if it's already got a "struct" or "gtemplate" object we + /* if it's already got a "struct" object we just tack this one to the end of the list and leave it there. */ if (t->t_list) @@ -927,7 +939,8 @@ static float curve_motion_ycumulative; static float curve_motion_ybase; static float curve_motion_yper; static t_glist *curve_motion_glist; -static t_gobj *curve_motion_gobj; +static t_scalar *curve_motion_scalar; +static t_array *curve_motion_array; static t_word *curve_motion_wp; static t_template *curve_motion_template; @@ -956,11 +969,15 @@ static void curve_motion(void *z, t_floatarg dx, t_floatarg dy) curve_motion_ybase + curve_motion_ycumulative * curve_motion_yper, 1); } - glist_redrawitem(curve_motion_glist, curve_motion_gobj); + if (curve_motion_scalar) + glist_redrawitem(curve_motion_glist, &curve_motion_scalar->sc_gobj); + if (curve_motion_array) + array_redraw(curve_motion_array, curve_motion_glist); } static int curve_click(t_gobj *z, t_glist *glist, - t_scalar *sc, t_template *template, float basex, float basey, + t_word *data, t_template *template, t_scalar *sc, t_array *ap, + float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { t_curve *x = (t_curve *)z; @@ -968,7 +985,6 @@ static int curve_click(t_gobj *z, t_glist *glist, int bestn = -1; int besterror = 0x7fffffff; t_fielddesc *f = x->x_vec; - t_word *data = sc->sc_vec; for (i = 0, f = x->x_vec; i < n; i++, f += 2) { int xloc = glist_xtopixels(glist, @@ -1002,7 +1018,8 @@ static int curve_click(t_gobj *z, t_glist *glist, - glist_pixelstoy(glist, 0); curve_motion_xcumulative = curve_motion_ycumulative = 0; curve_motion_glist = glist; - curve_motion_gobj = &sc->sc_gobj; + curve_motion_scalar = sc; + curve_motion_array = ap; curve_motion_wp = data; curve_motion_field = 2*bestn; curve_motion_template = template; @@ -1047,25 +1064,25 @@ t_class *plot_class; typedef struct _plot { t_object x_obj; - int x_flags; t_fielddesc x_outlinecolor; t_fielddesc x_width; t_fielddesc x_xloc; t_fielddesc x_yloc; t_fielddesc x_xinc; + t_fielddesc x_style; t_fielddesc x_data; } t_plot; static void *plot_new(t_symbol *classsym, t_int argc, t_atom *argv) { t_plot *x = (t_plot *)pd_new(plot_class); - int flags = 0; + int defstyle = PLOTSTYLE_POLY; int nxy, i; t_fielddesc *fd; t_symbol *firstarg = atom_getsymbolarg(0, argc, argv); if (!strcmp(firstarg->s_name, "curve")) { - flags |= BEZ; + defstyle = PLOTSTYLE_BEZ; argc--, argv++; } if (argc) fielddesc_setarrayarg(&x->x_data, argc--, argv++); @@ -1080,7 +1097,8 @@ static void *plot_new(t_symbol *classsym, t_int argc, t_atom *argv) else FIELDDESC_SETFLOAT(&x->x_yloc, 1); if (argc) fielddesc_setfloatarg(&x->x_xinc, argc--, argv++); else FIELDDESC_SETFLOAT(&x->x_xinc, 1); - x->x_flags = flags; + if (argc) fielddesc_setfloatarg(&x->x_style, argc--, argv++); + else FIELDDESC_SETFLOAT(&x->x_style, defstyle); return (x); } @@ -1092,7 +1110,7 @@ static void *plot_new(t_symbol *classsym, t_int argc, t_atom *argv) static int plot_readownertemplate(t_plot *x, t_word *data, t_template *ownertemplate, t_symbol **elemtemplatesymp, t_array **arrayp, - float *linewidthp, float *xlocp, float *xincp, float *ylocp) + float *linewidthp, float *xlocp, float *xincp, float *ylocp, float *stylep) { int arrayonset, type; t_symbol *elemtemplatesym; @@ -1120,6 +1138,7 @@ static int plot_readownertemplate(t_plot *x, *xlocp = fielddesc_getfloat(&x->x_xloc, ownertemplate, data, 1); *xincp = fielddesc_getfloat(&x->x_xinc, ownertemplate, data, 1); *ylocp = fielddesc_getfloat(&x->x_yloc, ownertemplate, data, 1); + *stylep = fielddesc_getfloat(&x->x_style, ownertemplate, data, 1); *elemtemplatesymp = elemtemplatesym; *arrayp = array; return (0); @@ -1182,19 +1201,22 @@ static void plot_getrect(t_gobj *z, t_glist *glist, t_canvas *elemtemplatecanvas; t_template *elemtemplate; t_symbol *elemtemplatesym; - float linewidth, xloc, xinc, yloc; + float linewidth, xloc, xinc, yloc, style, xsum, yval; t_array *array; float x1 = 0x7fffffff, y1 = 0x7fffffff, x2 = -0x7fffffff, y2 = -0x7fffffff; int i; float xpix, ypix, wpix; if (!plot_readownertemplate(x, data, template, - &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc) && + &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style) && !array_getfields(elemtemplatesym, &elemtemplatecanvas, &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) { - for (i = 0; i < array->a_n; i++) + for (i = 0, xsum = 0; i < array->a_n; i++) { + float usexloc, useyloc; + t_gobj *y; + /* get the coords of the point proper */ array_getcoordinate(glist, (char *)(array->a_vec) + i * elemsize, xonset, yonset, wonset, i, basex + xloc, basey + yloc, xinc, &xpix, &ypix, &wpix); @@ -1206,6 +1228,35 @@ static void plot_getrect(t_gobj *z, t_glist *glist, y1 = ypix - wpix; if (ypix + wpix > y2) y2 = ypix + wpix; + + /* check also the drawing instructions for the scalar */ + if (xonset >= 0) + usexloc = basex + xloc + + *(float *)(((char *)(array->a_vec) + elemsize * i) + xonset); + else usexloc = basex + xsum, xsum += xinc; + if (yonset >= 0) + yval = *(float *)(((char *)(array->a_vec) + elemsize * i) + + yonset); + else yval = 0; + useyloc = basey + yloc + yval; + for (y = elemtemplatecanvas->gl_list; y; y = y->g_next) + { + int xx1, xx2, yy1, yy2; + t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd); + if (!wb) continue; + (*wb->w_parentgetrectfn)(y, glist, + (t_word *)((char *)(array->a_vec) + elemsize * i), + elemtemplate, usexloc, useyloc, + &xx1, &yy1, &xx2, &yy2); + if (xx1 < x1) + x1 = xx1; + if (yy1 < y1) + y1 = yy1; + if (xx2 > x2) + x2 = xx2; + if (yy2 > y2) + y2 = yy2; + } } } @@ -1241,134 +1292,187 @@ static void plot_vis(t_gobj *z, t_glist *glist, int vis) { t_plot *x = (t_plot *)z; - int elemsize, yonset, wonset, xonset; + int elemsize, yonset, wonset, xonset, i; t_canvas *elemtemplatecanvas; t_template *elemtemplate; t_symbol *elemtemplatesym; - float linewidth, xloc, xinc, yloc; + float linewidth, xloc, xinc, yloc, style, usexloc, xsum, yval; t_array *array; int nelem; char *elem; if (plot_readownertemplate(x, data, template, - &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc) || + &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style) || array_getfields(elemtemplatesym, &elemtemplatecanvas, &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) return; nelem = array->a_n; elem = (char *)array->a_vec; + if (vis) - { - char outline[20]; - int lastpixel = -1, ndrawn = 0; - float xsum, yval = 0, wval = 0, xpix; - int ixpix = 0, i; - - /* draw the trace */ - numbertocolor(fielddesc_getfloat(&x->x_outlinecolor, template, data, 1), - outline); - if (wonset >= 0) + { + if (style == PLOTSTYLE_POINTS) { - /* found "w" field which controls linewidth. The trace is - a filled polygon with 2n points. */ - sys_vgui(".x%lx.c create polygon \\\n", - glist_getcanvas(glist)); - - for (i = 0, xsum = xloc; i < nelem; i++) + float minyval = 1e20, maxyval = -1e20; + int ndrawn = 0; + for (xsum = basex + xloc, i = 0; i < nelem; i++) { - float usexloc; + float yval, xpix, ypix, nextxloc; + int ixpix, inextx; + if (xonset >= 0) - usexloc = xloc + *(float *)((elem + elemsize * i) + xonset); - else usexloc = xsum, xsum += xinc; + { + usexloc = basex + xloc + + *(float *)((elem + elemsize * i) + xonset); + ixpix = glist_xtopixels(glist, usexloc); + inextx = ixpix + 2; + } + else + { + usexloc = xsum; + xsum += xinc; + ixpix = glist_xtopixels(glist, usexloc); + inextx = glist_xtopixels(glist, xsum); + } + if (yonset >= 0) - yval = *(float *)((elem + elemsize * i) + yonset); + yval = basey + yloc + + *(float *)((elem + elemsize * i) + yonset); else yval = 0; - wval = *(float *)((elem + elemsize * i) + wonset); - xpix = glist_xtopixels(glist, basex + usexloc); - ixpix = xpix + 0.5; - if (xonset >= 0 || ixpix != lastpixel) + if (yval > maxyval) + maxyval = yval; + if (yval < minyval) + minyval = yval; + if (i == nelem-1 || inextx != ixpix) { - sys_vgui("%d %f \\\n", ixpix, - glist_ytopixels(glist, - basey + yloc + yval - wval)); + sys_vgui( +".x%lx.c create rectangle %d %d %d %d -fill black -width 0 -tags plot%lx\n", + glist_getcanvas(glist), + ixpix, (int)glist_ytopixels(glist, minyval), + inextx, (int)(glist_ytopixels(glist, maxyval) + + linewidth), data); ndrawn++; + minyval = 1e20; + maxyval = -1e20; } - lastpixel = ixpix; - if (ndrawn >= 1000) goto ouch; + if (ndrawn > 2000 || ixpix >= 3000) break; } - lastpixel = -1; - for (i = nelem-1; i >= 0; i--) + } + else + { + char outline[20]; + int lastpixel = -1, ndrawn = 0; + float yval = 0, wval = 0, xpix; + int ixpix = 0; + /* draw the trace */ + numbertocolor(fielddesc_getfloat(&x->x_outlinecolor, template, + data, 1), outline); + if (wonset >= 0) { - float usexloc; - if (xonset >= 0) - usexloc = xloc + *(float *)((elem + elemsize * i) + xonset); - else xsum -= xinc, usexloc = xsum; - if (yonset >= 0) - yval = *(float *)((elem + elemsize * i) + yonset); - else yval = 0; - wval = *(float *)((elem + elemsize * i) + wonset); - xpix = glist_xtopixels(glist, basex + usexloc); - ixpix = xpix + 0.5; - if (xonset >= 0 || ixpix != lastpixel) + /* found "w" field which controls linewidth. The trace is + a filled polygon with 2n points. */ + sys_vgui(".x%lx.c create polygon \\\n", + glist_getcanvas(glist)); + + for (i = 0, xsum = xloc; i < nelem; i++) + { + if (xonset >= 0) + usexloc = xloc + *(float *)((elem + elemsize * i) + + xonset); + else usexloc = xsum, xsum += xinc; + if (yonset >= 0) + yval = *(float *)((elem + elemsize * i) + yonset); + else yval = 0; + wval = *(float *)((elem + elemsize * i) + wonset); + xpix = glist_xtopixels(glist, basex + usexloc); + ixpix = xpix + 0.5; + if (xonset >= 0 || ixpix != lastpixel) + { + sys_vgui("%d %f \\\n", ixpix, + glist_ytopixels(glist, + basey + yloc + yval - wval)); + ndrawn++; + } + lastpixel = ixpix; + if (ndrawn >= 1000) goto ouch; + } + lastpixel = -1; + for (i = nelem-1; i >= 0; i--) + { + float usexloc; + if (xonset >= 0) + usexloc = xloc + *(float *)((elem + elemsize * i) + + xonset); + else xsum -= xinc, usexloc = xsum; + if (yonset >= 0) + yval = *(float *)((elem + elemsize * i) + yonset); + else yval = 0; + wval = *(float *)((elem + elemsize * i) + wonset); + xpix = glist_xtopixels(glist, basex + usexloc); + ixpix = xpix + 0.5; + if (xonset >= 0 || ixpix != lastpixel) + { + sys_vgui("%d %f \\\n", ixpix, glist_ytopixels(glist, + basey + yloc + yval + wval)); + ndrawn++; + } + lastpixel = ixpix; + if (ndrawn >= 1000) goto ouch; + } + /* TK will complain if there aren't at least 3 points. + There should be at least two already. */ + if (ndrawn < 4) { - sys_vgui("%d %f \\\n", ixpix, glist_ytopixels(glist, + sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, basey + yloc + yval + wval)); - ndrawn++; + sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, + basey + yloc + yval - wval)); } - lastpixel = ixpix; - if (ndrawn >= 1000) goto ouch; + ouch: + sys_vgui(" -width 1 -fill %s -outline %s\\\n", + outline, outline); + if (style == PLOTSTYLE_BEZ) sys_vgui("-smooth 1\\\n"); + + sys_vgui("-tags plot%lx\n", data); } - /* TK will complain if there aren't at least 3 points. There - should be at least two already. */ - if (ndrawn < 4) + else if (linewidth > 0) { - sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, - basey + yloc + yval + wval)); - sys_vgui("%d %f \\\n", ixpix + 10, glist_ytopixels(glist, - basey + yloc + yval - wval)); - } - ouch: - sys_vgui(" -width 1 -fill %s -outline %s\\\n", outline, outline); - if (x->x_flags & BEZ) sys_vgui("-smooth 1\\\n"); + /* no "w" field. If the linewidth is positive, draw a + segmented line with the requested width; otherwise don't + draw the trace at all. */ + sys_vgui(".x%lx.c create line \\\n", glist_getcanvas(glist)); - sys_vgui("-tags plot%lx\n", data); - } - else if (linewidth > 0) - { - /* no "w" field. If the linewidth is positive, draw a - segmented line with the requested width; otherwise don't - draw the trace at all. */ - sys_vgui(".x%lx.c create line \\\n", glist_getcanvas(glist)); - - for (xsum = xloc, i = 0; i < nelem; i++) - { - float usexloc; - if (xonset >= 0) - usexloc = xloc + *(float *)((elem + elemsize * i) + xonset); - else usexloc = xsum, xsum += xinc; - if (yonset >= 0) - yval = *(float *)((elem + elemsize * i) + yonset); - else yval = 0; - xpix = glist_xtopixels(glist, basex + usexloc); - ixpix = xpix + 0.5; - if (xonset >= 0 || ixpix != lastpixel) + for (xsum = xloc, i = 0; i < nelem; i++) { - sys_vgui("%d %f \\\n", ixpix, - glist_ytopixels(glist, basey + yloc + yval)); - ndrawn++; + float usexloc; + if (xonset >= 0) + usexloc = xloc + *(float *)((elem + elemsize * i) + + xonset); + else usexloc = xsum, xsum += xinc; + if (yonset >= 0) + yval = *(float *)((elem + elemsize * i) + yonset); + else yval = 0; + xpix = glist_xtopixels(glist, basex + usexloc); + ixpix = xpix + 0.5; + if (xonset >= 0 || ixpix != lastpixel) + { + sys_vgui("%d %f \\\n", ixpix, + glist_ytopixels(glist, basey + yloc + yval)); + ndrawn++; + } + lastpixel = ixpix; + if (ndrawn >= 1000) break; } - lastpixel = ixpix; - if (ndrawn >= 1000) break; - } - /* TK will complain if there aren't at least 2 points... */ - if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); - else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix + 10, - glist_ytopixels(glist, basey + yloc + yval)); + /* TK will complain if there aren't at least 2 points... */ + if (ndrawn == 0) sys_vgui("0 0 0 0 \\\n"); + else if (ndrawn == 1) sys_vgui("%d %f \\\n", ixpix + 10, + glist_ytopixels(glist, basey + yloc + yval)); - sys_vgui("-width %f\\\n", linewidth); - sys_vgui("-fill %s\\\n", outline); - if (x->x_flags & BEZ) sys_vgui("-smooth 1\\\n"); + sys_vgui("-width %f\\\n", linewidth); + sys_vgui("-fill %s\\\n", outline); + if (style == PLOTSTYLE_BEZ) sys_vgui("-smooth 1\\\n"); - sys_vgui("-tags plot%lx\n", data); + sys_vgui("-tags plot%lx\n", data); + } } /* We're done with the outline; now draw all the points. This code is inefficient since the template has to be @@ -1420,19 +1524,19 @@ static void plot_vis(t_gobj *z, t_glist *glist, static int plot_click(t_gobj *z, t_glist *glist, - t_scalar *sc, t_template *template, float basex, float basey, + t_word *data, t_template *template, t_scalar *sc, t_array *ap, + float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { t_plot *x = (t_plot *)z; t_symbol *elemtemplatesym; - float linewidth, xloc, xinc, yloc; + float linewidth, xloc, xinc, yloc, style; t_array *array; - t_word *data = sc->sc_vec; if (!plot_readownertemplate(x, data, template, - &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc)) + &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style)) { - return (array_doclick(array, glist, &sc->sc_gobj, + return (array_doclick(array, glist, sc, ap, elemtemplatesym, linewidth, basex + xloc, xinc, basey + yloc, xpix, ypix, shift, alt, dbl, doit)); @@ -1592,7 +1696,8 @@ static void drawnumber_vis(t_gobj *z, t_glist *glist, static float drawnumber_motion_ycumulative; static t_glist *drawnumber_motion_glist; -static t_gobj *drawnumber_motion_gobj; +static t_scalar *drawnumber_motion_scalar; +static t_array *drawnumber_motion_array; static t_word *drawnumber_motion_wp; static t_template *drawnumber_motion_template; @@ -1609,18 +1714,22 @@ static void drawnumber_motion(void *z, t_floatarg dx, t_floatarg dy) drawnumber_motion_wp, drawnumber_motion_ycumulative, 1); - glist_redrawitem(drawnumber_motion_glist, drawnumber_motion_gobj); + if (drawnumber_motion_scalar) + glist_redrawitem(drawnumber_motion_glist, + &drawnumber_motion_scalar->sc_gobj); + if (drawnumber_motion_array) + array_redraw(drawnumber_motion_array, drawnumber_motion_glist); } static int drawnumber_click(t_gobj *z, t_glist *glist, - t_scalar *sc, t_template *template, float basex, float basey, + t_word *data, t_template *template, t_scalar *sc, t_array *ap, + float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { t_drawnumber *x = (t_drawnumber *)z; int x1, y1, x2, y2; - t_word *data = sc->sc_vec; drawnumber_getrect(z, glist, - sc->sc_vec, template, basex, basey, + data, template, basex, basey, &x1, &y1, &x2, &y2); if (xpix >= x1 && xpix <= x2 && ypix >= y1 && ypix <= y2 && x->x_value.fd_var) @@ -1628,9 +1737,10 @@ static int drawnumber_click(t_gobj *z, t_glist *glist, if (doit) { drawnumber_motion_glist = glist; - drawnumber_motion_gobj = &sc->sc_gobj; drawnumber_motion_wp = data; drawnumber_motion_template = template; + drawnumber_motion_scalar = sc; + drawnumber_motion_array = ap; drawnumber_motion_ycumulative = fielddesc_getfloat(&x->x_value, template, data, 0); glist_grab(glist, z, drawnumber_motion, 0, xpix, ypix); @@ -1671,7 +1781,6 @@ void g_template_setup(void) { template_setup(); gtemplate_setup(); - template_float.t_pdobj = template_class; curve_setup(); plot_setup(); drawnumber_setup(); diff --git a/pd/src/m_binbuf.c b/pd/src/m_binbuf.c index be9d882e..37362360 100644 --- a/pd/src/m_binbuf.c +++ b/pd/src/m_binbuf.c @@ -3,13 +3,6 @@ * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -/* IOhannes : - * changed the canvas_restore in "g_canvas.c", so that it might accept $args as well (like "pd $0_test") - * so you can make multiple & distinguishable templates - * 1511:forum::für::umläute:2001 - * change marked with IOhannes - */ - #include #include "m_pd.h" #include "s_stuff.h" @@ -1199,7 +1192,7 @@ void binbuf_evalfile(t_symbol *name, t_symbol *dir) } binbuf_eval(b, 0, 0, 0); } - glob_setfilename(0, &s_, &s_); /* bug fix by Krzysztof Czaja */ + glob_setfilename(0, &s_, &s_); binbuf_free(b); canvas_resume_dsp(dspstate); } diff --git a/pd/src/m_class.c b/pd/src/m_class.c index c605ae89..d2489b44 100644 --- a/pd/src/m_class.c +++ b/pd/src/m_class.c @@ -541,7 +541,7 @@ void new_anything(void *dummy, t_symbol *s, int argc, t_atom *argv) close (fd); if (!pd_setloadingabstraction(s)) { - canvas_setargs(argc, argv); /* bug fix by Krzysztof Czaja */ + canvas_setargs(argc, argv); binbuf_evalfile(gensym(nameptr), gensym(dirbuf)); if (s__X.s_thing != current) canvas_popabstraction((t_canvas *)(s__X.s_thing)); diff --git a/pd/src/m_obj.c b/pd/src/m_obj.c index 611c7d7c..b5839003 100644 --- a/pd/src/m_obj.c +++ b/pd/src/m_obj.c @@ -9,10 +9,6 @@ behavior for "gobjs" appears at the end of this file. */ #include "m_pd.h" #include "m_imp.h" -/* T.Grill - define for a modified, more portable method to detect stack overflows */ -#define NEWSTACKMETH - - union inletunion { t_symbol *iu_symto; @@ -260,14 +256,8 @@ void obj_init(void) /* --------------------------- outlets ------------------------------ */ -#ifdef NEWSTACKMETH -/* T.Grill - count iterations rather than watch the stack pointer */ static int stackcount = 0; /* iteration counter */ #define STACKITER 1000 /* maximum iterations allowed */ -#else -static char *stacklimit, *topstack; -#define STACKSIZE 1000000 -#endif static int outlet_eventno; @@ -277,11 +267,6 @@ static int outlet_eventno; void outlet_setstacklim(void) { -#ifndef NEWSTACKMETH - char c; - topstack = &c; - stacklimit = (&c) - STACKSIZE; -#endif outlet_eventno++; } @@ -324,128 +309,76 @@ t_outlet *outlet_new(t_object *owner, t_symbol *s) static void outlet_stackerror(t_outlet *x) { pd_error(x->o_owner, "stack overflow"); -#ifndef NEWSTACKMETH - stacklimit = topstack; -#endif } void outlet_bang(t_outlet *x) { t_outconnect *oc; -#ifdef NEWSTACKMETH if(++stackcount >= STACKITER) -#else - char c; - if (&c < stacklimit) -#endif outlet_stackerror(x); else for (oc = x->o_connections; oc; oc = oc->oc_next) pd_bang(oc->oc_to); -#ifdef NEWSTACKMETH --stackcount; -#endif } void outlet_pointer(t_outlet *x, t_gpointer *gp) { t_outconnect *oc; t_gpointer gpointer; -#ifdef NEWSTACKMETH if(++stackcount >= STACKITER) -#else - char c; - if (&c < stacklimit) -#endif outlet_stackerror(x); else { -#if 0 - gpointer_copy(gp, &gpointer); - for (oc = x->o_connections; oc; oc = oc->oc_next) - pd_pointer(oc->oc_to, &gpointer); - gpointer_unset(&gpointer); -#else gpointer = *gp; for (oc = x->o_connections; oc; oc = oc->oc_next) pd_pointer(oc->oc_to, &gpointer); -#endif } -#ifdef NEWSTACKMETH --stackcount; -#endif } void outlet_float(t_outlet *x, t_float f) { t_outconnect *oc; -#ifdef NEWSTACKMETH if(++stackcount >= STACKITER) -#else - char c; - if (&c < stacklimit) -#endif outlet_stackerror(x); else for (oc = x->o_connections; oc; oc = oc->oc_next) pd_float(oc->oc_to, f); -#ifdef NEWSTACKMETH --stackcount; -#endif } void outlet_symbol(t_outlet *x, t_symbol *s) { t_outconnect *oc; -#ifdef NEWSTACKMETH if(++stackcount >= STACKITER) -#else - char c; - if (&c < stacklimit) -#endif outlet_stackerror(x); else for (oc = x->o_connections; oc; oc = oc->oc_next) pd_symbol(oc->oc_to, s); -#ifdef NEWSTACKMETH --stackcount; -#endif } void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv) { t_outconnect *oc; -#ifdef NEWSTACKMETH if(++stackcount >= STACKITER) -#else - char c; - if (&c < stacklimit) -#endif outlet_stackerror(x); else for (oc = x->o_connections; oc; oc = oc->oc_next) pd_list(oc->oc_to, s, argc, argv); -#ifdef NEWSTACKMETH --stackcount; -#endif } void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv) { t_outconnect *oc; -#ifdef NEWSTACKMETH if(++stackcount >= STACKITER) -#else - char c; - if (&c < stacklimit) -#endif outlet_stackerror(x); else for (oc = x->o_connections; oc; oc = oc->oc_next) typedmess(oc->oc_to, s, argc, argv); -#ifdef NEWSTACKMETH --stackcount; -#endif } /* get the outlet's declared symbol */ diff --git a/pd/src/m_pd.c b/pd/src/m_pd.c index 429799ef..c8bbf23e 100644 --- a/pd/src/m_pd.c +++ b/pd/src/m_pd.c @@ -293,6 +293,7 @@ void mess_init(void); void obj_init(void); void conf_init(void); void glob_init(void); +void garray_init(void); void pd_init(void) { @@ -300,5 +301,6 @@ void pd_init(void) obj_init(); conf_init(); glob_init(); + garray_init(); } diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h index fc9d6abd..e2c1972c 100644 --- a/pd/src/m_pd.h +++ b/pd/src/m_pd.h @@ -9,7 +9,7 @@ extern "C" { #endif #define PD_MAJOR_VERSION 0 -#define PD_MINOR_VERSION 38 +#define PD_MINOR_VERSION 39 /* old name for "MSW" flag -- we have to take it for the sake of many old "nmakefiles" for externs, which will define NT and not MSW */ @@ -454,9 +454,7 @@ EXTERN double sys_getrealtime(void); EXTERN int (*sys_idlehook)(void); /* hook to add idle time computation */ -/* ------------ threading ------------------- */ -/* T.Grill - see m_sched.c */ - +/* ------------ threading ------------------- */ EXTERN void sys_lock(void); EXTERN void sys_unlock(void); EXTERN int sys_trylock(void); @@ -516,7 +514,7 @@ EXTERN int canvas_suspend_dsp(void); EXTERN void canvas_resume_dsp(int oldstate); EXTERN void canvas_update_dsp(void); -/* IOhannes { (up/downsampling) */ +/* up/downsampling */ typedef struct _resample { int method; /* up/downsampling method ID */ @@ -540,7 +538,6 @@ EXTERN void resample_free(t_resample *x); EXTERN void resample_dsp(t_resample *x, t_sample *in, int insize, t_sample *out, int outsize, int method); EXTERN void resamplefrom_dsp(t_resample *x, t_sample *in, int insize, int outsize, int method); EXTERN void resampleto_dsp(t_resample *x, t_sample *out, int insize, int outsize, int method); -/* } IOhannes */ /* ----------------------- utility functions for signals -------------- */ EXTERN float mtof(float); diff --git a/pd/src/m_sched.c b/pd/src/m_sched.c index 10c03473..7a82b3eb 100644 --- a/pd/src/m_sched.c +++ b/pd/src/m_sched.c @@ -12,8 +12,6 @@ rates we expect to see: 32000, 44100, 48000, 88200, 96000. */ #define TIMEUNITPERSEC (32.*441000.) - -/* T.Grill - enable PD global thread locking - sys_lock, sys_unlock, sys_trylock functions */ #define THREAD_LOCKING #include "pthread.h" @@ -394,7 +392,6 @@ int m_scheduler( void) ((double)sys_schedblocksize) / sys_dacsr; #ifdef THREAD_LOCKING - /* T.Grill - lock mutex */ sys_lock(); #endif @@ -470,8 +467,7 @@ int m_scheduler( void) sys_reportidle(); #ifdef THREAD_LOCKING - /* T.Grill - enter idle phase -> unlock thread lock */ - sys_unlock(); + sys_unlock(); /* unlock while we idle */ #endif /* call externally installed idle function if any. */ if (!sys_idlehook || !sys_idlehook()) @@ -481,7 +477,6 @@ int m_scheduler( void) sys_microsleep(sys_sleepgrain); } #ifdef THREAD_LOCKING - /* T.Grill - leave idle phase -> lock thread lock */ sys_lock(); #endif @@ -492,7 +487,6 @@ int m_scheduler( void) } #ifdef THREAD_LOCKING - /* T.Grill - done */ sys_unlock(); #endif @@ -501,7 +495,6 @@ int m_scheduler( void) /* ------------ thread locking ------------------- */ -/* added by Thomas Grill */ #ifdef THREAD_LOCKING static pthread_mutex_t sys_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -529,13 +522,6 @@ int sys_trylock(void) {} #endif - -/* ------------ soft quit ------------------- */ -/* added by Thomas Grill - - just set the quit flag for the scheduler loop - this is useful for applications using the PD shared library to signal the scheduler to terminate -*/ - void sys_exit(void) { sys_quit = 1; diff --git a/pd/src/makefile b/pd/src/makefile index 06723100..e591f2c2 100644 --- a/pd/src/makefile +++ b/pd/src/makefile @@ -19,7 +19,7 @@ GLIB = -ltk8.4 -ltcl8.4 -lX11 -L/usr/X11R6/lib -lrt LDFLAGS = -Wl,-export-dynamic -lasound LIB = -ldl -lpthread -lasound -OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer +OPT_CFLAGS = -g WARN_CFLAGS = -Wall -W -Wstrict-prototypes \ -Wno-unused -Wno-parentheses -Wno-switch ARCH_CFLAGS = -DPD diff --git a/pd/src/makefile.dependencies b/pd/src/makefile.dependencies index e69de29b..6a895c1a 100644 --- a/pd/src/makefile.dependencies +++ b/pd/src/makefile.dependencies @@ -0,0 +1,938 @@ +g_canvas.o: g_canvas.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + m_imp.h s_stuff.h g_canvas.h /usr/include/string.h g_all_guis.h +g_graph.o: g_graph.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h m_pd.h t_tk.h \ + g_canvas.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h +g_text.o: g_text.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h m_pd.h m_imp.h \ + s_stuff.h t_tk.h g_canvas.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +g_rtext.o: g_rtext.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h s_stuff.h g_canvas.h t_tk.h +g_array.o: g_array.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + g_canvas.h /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +g_template.o: g_template.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + s_stuff.h g_canvas.h +g_io.o: g_io.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h g_canvas.h \ + /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h +g_scalar.o: g_scalar.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + g_canvas.h +g_traversal.o: g_traversal.c /usr/include/stdlib.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + g_canvas.h +g_guiconnect.o: g_guiconnect.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h g_canvas.h +g_readwrite.o: g_readwrite.c /usr/include/stdlib.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + g_canvas.h /usr/include/string.h +g_editor.o: g_editor.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h m_pd.h \ + m_imp.h s_stuff.h g_canvas.h /usr/include/string.h +g_all_guis.o: g_all_guis.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_bang.o: g_bang.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_hdial.o: g_hdial.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_hslider.o: g_hslider.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_mycanvas.o: g_mycanvas.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_numbox.o: g_numbox.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_toggle.o: g_toggle.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_vdial.o: g_vdial.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +g_vslider.o: g_vslider.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +g_vumeter.o: g_vumeter.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/ctype.h m_pd.h g_canvas.h t_tk.h g_all_guis.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +m_pd.o: m_pd.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h m_pd.h m_imp.h +m_class.o: m_class.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h m_imp.h \ + s_stuff.h /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/string.h +m_obj.o: m_obj.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h m_imp.h +m_atom.o: m_atom.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h +m_memory.o: m_memory.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + m_pd.h m_imp.h +m_binbuf.o: m_binbuf.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h m_pd.h s_stuff.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/fcntl.h \ + /usr/include/bits/fcntl.h /usr/include/string.h +m_conf.o: m_conf.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +m_glob.o: m_glob.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h m_imp.h +m_sched.o: m_sched.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h m_imp.h \ + s_stuff.h /usr/include/pthread.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h /usr/include/sched.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/time.h \ + /usr/include/bits/sched.h /usr/include/bits/time.h \ + /usr/include/signal.h /usr/include/bits/sigset.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h \ + /usr/include/bits/sigthread.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h +s_main.o: s_main.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h m_imp.h \ + s_stuff.h /usr/include/sys/types.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/sys/stat.h /usr/include/bits/stat.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/limits.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/string.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/stdlib.h \ + /usr/include/alloca.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h +s_inter.o: s_inter.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + m_imp.h g_canvas.h /usr/include/unistd.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/sys/socket.h /usr/include/sys/uio.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/bits/uio.h /usr/include/bits/socket.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/limits.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm/sockios.h \ + /usr/include/netinet/in.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h /usr/include/bits/in.h \ + /usr/include/bits/byteswap.h /usr/include/netinet/tcp.h \ + /usr/include/netdb.h /usr/include/rpc/netdb.h /usr/include/bits/netdb.h \ + /usr/include/stdlib.h /usr/include/alloca.h /usr/include/sys/time.h \ + /usr/include/sys/mman.h /usr/include/bits/mman.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/signal.h /usr/include/bits/signum.h \ + /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ + /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ + /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/string.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/gconv.h /usr/include/bits/stdio_lim.h \ + /usr/include/bits/sys_errlist.h /usr/include/sched.h +s_file.o: s_file.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/stdlib.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/fcntl.h \ + /usr/include/bits/fcntl.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h +s_print.o: s_print.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h s_stuff.h +s_loader.o: s_loader.c /usr/include/dlfcn.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/bits/dlfcn.h /usr/include/stdlib.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/string.h m_pd.h s_stuff.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h +s_path.o: s_path.c /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/sys/stat.h /usr/include/bits/stat.h \ + /usr/include/string.h m_pd.h m_imp.h s_stuff.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/ctype.h +s_entry.o: s_entry.c +s_audio.o: s_audio.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/sys/resource.h \ + /usr/include/bits/resource.h /usr/include/stdlib.h \ + /usr/include/sys/types.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/alloca.h /usr/include/string.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h +s_midi.o: s_midi.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + m_imp.h /usr/include/unistd.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/string.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/signal.h /usr/include/bits/signum.h \ + /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ + /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ + /usr/include/bits/sigstack.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/bits/sigthread.h +d_ugen.o: d_ugen.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h m_imp.h \ + /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/alloca.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h +d_ctl.o: d_ctl.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +d_arithmetic.o: d_arithmetic.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +d_osc.o: d_osc.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h +d_filter.o: d_filter.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +d_dac.o: d_dac.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h +d_misc.o: d_misc.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h +d_math.o: d_math.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +d_fft.o: d_fft.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +d_mayer_fft.o: d_mayer_fft.c +d_fftroutine.o: d_fftroutine.c /usr/include/stdio.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/math.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h m_pd.h +d_array.o: d_array.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/endian.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/endian.h \ + /usr/include/sys/types.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h +d_global.o: d_global.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h +d_delay.o: d_delay.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +d_resample.o: d_resample.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +x_arithmetic.o: x_arithmetic.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +x_connective.o: x_connective.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/stdio.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h +x_interface.o: x_interface.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +x_midi.o: x_midi.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h +x_misc.o: x_misc.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ + /usr/include/stdio.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h /usr/include/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/sys/time.h \ + /usr/include/sys/times.h /usr/include/sys/param.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/limits.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/asm/param.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h +x_time.o: x_time.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h +x_acoustics.o: x_acoustics.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/math.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ + /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h +x_net.o: x_net.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + /usr/include/sys/types.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/string.h /usr/include/sys/socket.h /usr/include/sys/uio.h \ + /usr/include/bits/uio.h /usr/include/bits/socket.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/limits.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/syslimits.h \ + /usr/include/limits.h /usr/include/bits/posix1_lim.h \ + /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \ + /usr/include/asm/socket.h /usr/include/asm/sockios.h \ + /usr/include/netinet/in.h /usr/include/stdint.h \ + /usr/include/bits/wchar.h /usr/include/bits/in.h \ + /usr/include/bits/byteswap.h /usr/include/netinet/tcp.h \ + /usr/include/netdb.h /usr/include/rpc/netdb.h /usr/include/bits/netdb.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h +x_qlist.o: x_qlist.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/string.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/bits/confname.h /usr/include/getopt.h +x_gui.o: x_gui.c m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h /usr/include/unistd.h \ + /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ + /usr/include/getopt.h +d_soundfile.o: d_soundfile.c /usr/include/unistd.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/bits/typesizes.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ + /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h \ + /usr/include/bits/endian.h /usr/include/sys/select.h \ + /usr/include/bits/select.h /usr/include/bits/sigset.h \ + /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ + /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/signal.h \ + /usr/include/bits/initspin.h /usr/include/bits/sigthread.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/string.h /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h m_pd.h +s_midi_oss.o: s_midi_oss.c /usr/include/stdio.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/include/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ + /usr/include/errno.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h m_pd.h s_stuff.h +s_audio_oss.o: s_audio_oss.c /usr/include/linux/soundcard.h \ + /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h m_pd.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h s_stuff.h \ + /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/errno.h \ + /usr/include/linux/errno.h /usr/include/asm/errno.h \ + /usr/include/stdio.h /usr/include/bits/types.h \ + /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/include/bits/wchar.h /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/unistd.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/confname.h /usr/include/getopt.h \ + /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/sys/time.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sched.h \ + /usr/include/sys/mman.h /usr/include/bits/mman.h +s_audio_alsa.o: s_audio_alsa.c /usr/include/alsa/asoundlib.h \ + /usr/include/unistd.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/bits/typesizes.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/assert.h \ + /usr/include/sys/poll.h /usr/include/bits/poll.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/alsa/asoundef.h \ + /usr/include/alsa/version.h /usr/include/alsa/global.h \ + /usr/include/alsa/input.h /usr/include/alsa/output.h \ + /usr/include/alsa/error.h /usr/include/alsa/conf.h \ + /usr/include/alsa/pcm.h /usr/include/alsa/rawmidi.h \ + /usr/include/alsa/timer.h /usr/include/alsa/hwdep.h \ + /usr/include/alsa/control.h /usr/include/alsa/mixer.h \ + /usr/include/alsa/seq_event.h /usr/include/alsa/seq.h \ + /usr/include/alsa/seqmid.h /usr/include/alsa/seq_midi_event.h \ + /usr/include/alsa/conv.h /usr/include/alsa/instr.h m_pd.h s_stuff.h \ + /usr/include/sys/time.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm/ioctl.h /usr/include/bits/ioctl-types.h \ + /usr/include/sys/ttydefaults.h /usr/include/sched.h \ + /usr/include/sys/mman.h /usr/include/bits/mman.h s_audio_alsa.h +s_audio_alsamm.o: s_audio_alsamm.c /usr/include/alsa/asoundlib.h \ + /usr/include/unistd.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/gnu/stubs.h /usr/include/bits/posix_opt.h \ + /usr/include/bits/types.h /usr/include/bits/wordsize.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stddef.h \ + /usr/include/bits/typesizes.h /usr/include/bits/confname.h \ + /usr/include/getopt.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ + /usr/include/gconv.h \ + /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \ + /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ + /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/bits/endian.h \ + /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ + /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/assert.h \ + /usr/include/sys/poll.h /usr/include/bits/poll.h /usr/include/errno.h \ + /usr/include/bits/errno.h /usr/include/linux/errno.h \ + /usr/include/asm/errno.h /usr/include/alsa/asoundef.h \ + /usr/include/alsa/version.h /usr/include/alsa/global.h \ + /usr/include/alsa/input.h /usr/include/alsa/output.h \ + /usr/include/alsa/error.h /usr/include/alsa/conf.h \ + /usr/include/alsa/pcm.h /usr/include/alsa/rawmidi.h \ + /usr/include/alsa/timer.h /usr/include/alsa/hwdep.h \ + /usr/include/alsa/control.h /usr/include/alsa/mixer.h \ + /usr/include/alsa/seq_event.h /usr/include/alsa/seq.h \ + /usr/include/alsa/seqmid.h /usr/include/alsa/seq_midi_event.h \ + /usr/include/alsa/conv.h /usr/include/alsa/instr.h m_pd.h s_stuff.h \ + /usr/include/sys/time.h /usr/include/sys/stat.h \ + /usr/include/bits/stat.h /usr/include/sys/ioctl.h \ + /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ + /usr/include/asm/ioctl.h /usr/include/bits/ioctl-types.h \ + /usr/include/sys/ttydefaults.h /usr/include/sched.h s_audio_alsa.h diff --git a/pd/src/notes.txt b/pd/src/notes.txt index a6eb41c6..7e7e8569 100644 --- a/pd/src/notes.txt +++ b/pd/src/notes.txt @@ -34,10 +34,27 @@ sched_idle hook fixed startup flags, path, etc. so that spaces, "," chars, etc., are allowed configure script fixed to handle enable- and disable- correctly +0.39: +arrays are now first-class data +array elements can be clicked on, etc + + +bug bandaids: +d_delay.c confusion +'$' and help broken in OSX? + +garray change: +make a gobj_redraw that schedules the redraw +put two radio button banks side by side +re-range tables when arrays change size (again) +array_resize etc., should redraw the array directly? Or should "setsize" + and "garray_resize" do it instead? check it's queued correctly. + + doc: document env~ second argument (and why is it no less than 1/10 of first???) -update 0.intro.pd vibrato example +block resampling arguments problems: '[' in numbox label breaks it (Yury Sept. 3) @@ -63,6 +80,7 @@ figure out why Pd sometimes crashes when you close example after adding fields check if _vsnprintf with zero argument in windows works any better... next release: +fix copyright notices update portmusic to latest IEM guis to use queued updates pixel font sizes @@ -98,14 +116,14 @@ allow field(1,5,0,100) etc. in drawing commands vget, vset traversal objects cursor to show (x, y) location better hit detection (getrect is too greedy; try tk's "current" tag for canvas) -click on points of plot -typing & dragging drawnumbers -fix templates to be loaded on demand and belong to a globally known patch +typing at drawnumbers test and debug list elements of templates -sublists should display on parent if desired? +sublists should display on parent if desired? (new drawing instruction) sublists seem not to handle canvas allocation right (get.pd->pointer.pd bug) scalar hook to catch the mouse protect against "plots" going away while you drag on them +when last drawing instruction leaves, glist_redrawitem() fails to erase it; + perhaps scalar_vis(...0) should just delete for the tag, itself? more features: diff --git a/pd/src/s_audio.c b/pd/src/s_audio.c index 8ae63198..ad4e862d 100644 --- a/pd/src/s_audio.c +++ b/pd/src/s_audio.c @@ -167,7 +167,6 @@ void sys_open_audio(int naudioindev, int *audioindev, int nchindev, int inchans, outchans; int realinchans[MAXAUDIOINDEV], realoutchans[MAXAUDIOOUTDEV]; - /* jsarlo { (*/ if (sys_externalschedlib) { return; @@ -176,7 +175,6 @@ void sys_open_audio(int naudioindev, int *audioindev, int nchindev, if (sys_inchannels || sys_outchannels) sys_close_audio(); - /* } jsarlo */ if (rate < 1) rate = DEFAULTSRATE; if (advance <= 0) @@ -354,12 +352,10 @@ else void sys_close_audio(void) { - /* jsarlo { (*/ if (sys_externalschedlib) { return; } - /* } jsarlo */ if (!audio_isopen()) return; #ifdef USEAPI_PORTAUDIO diff --git a/pd/src/s_audio_mmio.c b/pd/src/s_audio_mmio.c index 30aa4d1c..a949767a 100644 --- a/pd/src/s_audio_mmio.c +++ b/pd/src/s_audio_mmio.c @@ -696,7 +696,7 @@ idle: void mmio_open_audio(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, - int nchoutdev, int *choutdev, int rate) /* IOhannes */ + int nchoutdev, int *choutdev, int rate) { int nbuf; diff --git a/pd/src/s_audio_oss.c b/pd/src/s_audio_oss.c index 21927f68..965d5b6c 100644 --- a/pd/src/s_audio_oss.c +++ b/pd/src/s_audio_oss.c @@ -138,18 +138,13 @@ int oss_reset(int fd) { #endif void oss_configure(t_oss_dev *dev, int srate, int dac, int skipblocksize) -{ /* IOhannes */ +{ int orig, param, nblk, fd = dev->d_fd, wantformat; int nchannels = dev->d_nchannels; int advwas = sys_schedadvance; audio_buf_info ainfo; - /* IOhannes : - * pd is very likely to crash if different formats are used on - multiple soundcards - */ - /* set resolution - first try 4 byte samples */ if (oss_32bit && (ioctl(fd,SNDCTL_DSP_GETFMTS,¶m) >= 0) && (param & AFMT_S32_BLOCKED)) @@ -249,7 +244,7 @@ void oss_configure(t_oss_dev *dev, int srate, int dac, int skipblocksize) } static int oss_setchannels(int fd, int wantchannels, char *devname) -{ /* IOhannes */ +{ int param = wantchannels; while (param > 1) @@ -269,7 +264,7 @@ static int oss_setchannels(int fd, int wantchannels, char *devname) int oss_open_audio(int nindev, int *indev, int nchin, int *chin, int noutdev, int *outdev, int nchout, int *chout, int rate) -{ /* IOhannes */ +{ int capabilities = 0; int inchannels = 0, outchannels = 0; char devname[20]; diff --git a/pd/src/s_audio_pablio.c b/pd/src/s_audio_pablio.c index 03ef42b3..37b2ecd3 100644 --- a/pd/src/s_audio_pablio.c +++ b/pd/src/s_audio_pablio.c @@ -1,5 +1,5 @@ /* - * $Id: s_audio_pablio.c,v 1.4 2004-11-11 04:58:21 millerpuckette Exp $ + * $Id: s_audio_pablio.c,v 1.5 2004-11-28 21:20:43 millerpuckette Exp $ * pablio.c * Portable Audio Blocking Input/Output utility. * diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c index dc7d3a34..15d7e11c 100644 --- a/pd/src/s_inter.c +++ b/pd/src/s_inter.c @@ -49,7 +49,6 @@ typedef int socklen_t; #define DEBUG_MESSUP 1 /* messages up from pd to pd-gui */ #define DEBUG_MESSDOWN 2 /* messages down from pd-gui to pd */ -/* T.Grill - make it a _little_ more adaptable... */ #ifndef PDBINDIR #define PDBINDIR "bin/" #endif @@ -1190,8 +1189,6 @@ int sys_startgui(const char *guidir) } - -/* T.Grill - import clean quit function */ extern void sys_exit(void); /* This is called when something bad has happened, like a segfault. diff --git a/pd/src/s_main.c b/pd/src/s_main.c index 53a5d39f..8e818a79 100644 --- a/pd/src/s_main.c +++ b/pd/src/s_main.c @@ -2,12 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -/* IOhannes : - * hacked the code to add advanced multidevice-support - * 1311:forum::für::umläute:2001 - */ - -char pd_version[] = "Pd version 0.38 TEST10\n"; +char pd_version[] = "Pd version 0.39 TEST 0\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; @@ -68,15 +63,11 @@ int sys_midioutdevlist[MAXMIDIOUTDEV] = {1}; static int sys_main_srate; static int sys_main_advance; -/* jsarlo { */ int sys_externalschedlib; char sys_externalschedlibname[MAXPDSTRING]; int sys_extraflags; char sys_extraflagsstring[MAXPDSTRING]; -/* } jsarlo */ - -/* IOhannes { */ /* here the "-1" counts signify that the corresponding vector hasn't been specified in command line arguments; sys_open_audio will detect this @@ -90,9 +81,7 @@ static int sys_nchin = -1; static int sys_nchout = -1; static int sys_chinlist[MAXAUDIOINDEV]; static int sys_choutlist[MAXAUDIOOUTDEV]; -/* } IOhannes */ -/* jsarlo { */ t_sample* get_sys_soundout() { return sys_soundout; } t_sample* get_sys_soundin() { return sys_soundin; } int* get_sys_main_advance() { return &sys_main_advance; } @@ -102,9 +91,6 @@ double* get_sys_time() { return &sys_time; } float* get_sys_dacsr() { return &sys_dacsr; } int* get_sys_sleepgrain() { return &sys_sleepgrain; } int* get_sys_schedadvance() { return &sys_schedadvance; } -/* } jsarlo */ - - typedef struct _fontinfo { @@ -257,10 +243,8 @@ static void sys_afterargparse(void); /* this is called from main() in s_entry.c */ int sys_main(int argc, char **argv) { - /* jsarlo { */ sys_externalschedlib = 0; sys_extraflags = 0; - /* } jsarlo */ #ifdef PD_DEBUG fprintf(stderr, "Pd: COMPILED FOR DEBUGGING\n"); #endif @@ -279,7 +263,6 @@ int sys_main(int argc, char **argv) return (0); if (sys_startgui(sys_guidir->s_name)) /* start the gui */ return(1); - /* jsarlo { */ if (sys_externalschedlib) { #ifdef MSW @@ -311,7 +294,6 @@ int sys_main(int argc, char **argv) /* run scheduler until it quits */ return (m_scheduler()); } - /* } jsarlo */ } static char *(usagemessage[]) = { @@ -535,7 +517,7 @@ int sys_argparse(int argc, char **argv) argv += 2; } else if (!strcmp(*argv, "-inchannels")) - { /* IOhannes */ + { sys_parsedevlist(&sys_nchin, sys_chinlist, MAXAUDIOINDEV, argv[1]); @@ -545,7 +527,7 @@ int sys_argparse(int argc, char **argv) argc -= 2; argv += 2; } else if (!strcmp(*argv, "-outchannels")) - { /* IOhannes */ + { sys_parsedevlist(&sys_nchout, sys_choutlist, MAXAUDIOOUTDEV, argv[1]); @@ -582,19 +564,19 @@ int sys_argparse(int argc, char **argv) argc -= 2; argv += 2; } else if (!strcmp(*argv, "-nodac")) - { /* IOhannes */ + { sys_nsoundout=0; sys_nchout = 0; argc--; argv++; } else if (!strcmp(*argv, "-noadc")) - { /* IOhannes */ + { sys_nsoundin=0; sys_nchin = 0; argc--; argv++; } else if (!strcmp(*argv, "-nosound") || !strcmp(*argv, "-noaudio")) - { /* IOhannes */ + { sys_nsoundin=sys_nsoundout = 0; sys_nchin = sys_nchout = 0; argc--; argv++; @@ -765,7 +747,6 @@ int sys_argparse(int argc, char **argv) else if (!strcmp(*argv, "-stderr")) { sys_printtostderr = 1; - fprintf(stderr, "set it\n"); argc--; argv++; } else if (!strcmp(*argv, "-guicmd") && argc > 1) @@ -783,7 +764,6 @@ int sys_argparse(int argc, char **argv) sys_listdevs(); argc--; argv++; } - /* jsarlo { */ else if (!strcmp(*argv, "-schedlib")) { sys_externalschedlib = 1; @@ -798,7 +778,6 @@ int sys_argparse(int argc, char **argv) argv += 2; argc -= 2; } - /* } jsarlo */ #ifdef UNISTD else if (!strcmp(*argv, "-rt") || !strcmp(*argv, "-realtime")) { @@ -813,30 +792,30 @@ int sys_argparse(int argc, char **argv) #endif else if (!strcmp(*argv, "-soundindev") || !strcmp(*argv, "-audioindev")) - { /* IOhannes */ - sys_parsedevlist(&sys_nsoundin, sys_soundindevlist, - MAXAUDIOINDEV, argv[1]); - if (!sys_nsoundin) - goto usage; - argc -= 2; argv += 2; + { + sys_parsedevlist(&sys_nsoundin, sys_soundindevlist, + MAXAUDIOINDEV, argv[1]); + if (!sys_nsoundin) + goto usage; + argc -= 2; argv += 2; } else if (!strcmp(*argv, "-soundoutdev") || !strcmp(*argv, "-audiooutdev")) - { /* IOhannes */ - sys_parsedevlist(&sys_nsoundout, sys_soundoutdevlist, - MAXAUDIOOUTDEV, argv[1]); - if (!sys_nsoundout) - goto usage; + { + sys_parsedevlist(&sys_nsoundout, sys_soundoutdevlist, + MAXAUDIOOUTDEV, argv[1]); + if (!sys_nsoundout) + goto usage; argc -= 2; argv += 2; } else if (!strcmp(*argv, "-sounddev") || !strcmp(*argv, "-audiodev")) { - sys_parsedevlist(&sys_nsoundin, sys_soundindevlist, - MAXAUDIOINDEV, argv[1]); - sys_parsedevlist(&sys_nsoundout, sys_soundoutdevlist, - MAXAUDIOOUTDEV, argv[1]); - if (!sys_nsoundout) - goto usage; + sys_parsedevlist(&sys_nsoundin, sys_soundindevlist, + MAXAUDIOINDEV, argv[1]); + sys_parsedevlist(&sys_nsoundout, sys_soundoutdevlist, + MAXAUDIOOUTDEV, argv[1]); + if (!sys_nsoundout) + goto usage; argc -= 2; argv += 2; } else diff --git a/pd/src/s_stuff.h b/pd/src/s_stuff.h index 87d6596b..b03ce4e6 100644 --- a/pd/src/s_stuff.h +++ b/pd/src/s_stuff.h @@ -195,7 +195,7 @@ void pa_getdevs(char *indevlist, int *nindevs, int oss_open_audio(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, int nchoutdev, - int *choutdev, int rate); /* IOhannes */ + int *choutdev, int rate); void oss_close_audio(void); int oss_send_dacs(void); void oss_reportidle(void); diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk index 5320acdc..dcb1e31b 100644 --- a/pd/src/u_main.tk +++ b/pd/src/u_main.tk @@ -24,6 +24,13 @@ if { $tcl_platform(platform) == "windows" } { # Tearoff is set to true by default: set pd_tearoff 1 +# jsarlo +set pd_array_listview_pagesize 1000 +set pd_array_listview_id(0) 0 +set pd_array_listview_entry(0) 0 +set pd_array_listview_page(0) 0 +# end jsarlo + if {$pd_nt == 1} { global pd_guidir global pd_tearoff @@ -830,6 +837,210 @@ proc pdtk_canvas_new {name width height geometry editable} { ############iemlib################## +#### jsarlo ##### +proc pdtk_array_listview_setpage {arrayName page} { + global pd_array_listview_page + set pd_array_listview_page($arrayName) $page +} + +proc pdtk_array_listview_changepage {arrayName np} { + global pd_array_listview_page + pdtk_array_listview_setpage \ + $arrayName [expr $pd_array_listview_page($arrayName) + $np] + pdtk_array_listview_fillpage $arrayName +} + +proc pdtk_array_listview_fillpage {arrayName} { + global pd_array_listview_page + global pd_array_listview_id + set windowName [format ".%sArrayWindow" $arrayName] + if {[winfo exists $windowName]} { + set cmd "$pd_array_listview_id($arrayName) \ + arrayviewlistfillpage \ + $pd_array_listview_page($arrayName)" + pd [concat $cmd \;] + } +} + +proc pdtk_array_listview_new {id arrayName page} { + global pd_nt + global pd_array_listview_page + global pd_array_listview_id + set pd_array_listview_page($arrayName) $page + set pd_array_listview_id($arrayName) $id + set windowName [format ".%sArrayWindow" $arrayName] + if [winfo exists $windowName] then [destroy $windowName] + toplevel $windowName + wm protocol $windowName WM_DELETE_WINDOW \ + "pdtk_array_listview_close $id $arrayName" + wm title $windowName [concat $arrayName "(list view)"] + # FIXME + set font 12 + set $windowName.lb [listbox $windowName.lb -height 20 -width 25\ + -selectmode extended \ + -relief solid -background white -borderwidth 1 \ + -font [format -*-courier-bold--normal--%d-* \ + $font] \ + -yscrollcommand "$windowName.lb.sb set"] + set $windowName.lb.sb [scrollbar $windowName.lb.sb \ + -command "$windowName.lb yview" -orient vertical] + place configure $windowName.lb.sb -relheight 1 -relx 0.9 -relwidth 0.1 + pack $windowName.lb + bind $windowName.lb \ + "pdtk_array_listview_edit $arrayName $page $font" + # handle copy/paste + if {$pd_nt == 0} { + selection handle $windowName.lb \ + "pdtk_array_listview_lbselection $arrayName" + } else { + if {$pd_nt == 1} { + bind $windowName.lb \ + "pdtk_array_listview_popup $arrayName" + } + } + set $windowName.prevBtn [button $windowName.prevBtn -text "<-" \ + -command "pdtk_array_listview_changepage $arrayName -1"] + set $windowName.nextBtn [button $windowName.nextBtn -text "->" \ + -command "pdtk_array_listview_changepage $arrayName 1"] + pack $windowName.prevBtn -side left -ipadx 20 -pady 10 + pack $windowName.nextBtn -side right -ipadx 20 -pady 10 + focus $windowName +} + +proc pdtk_array_listview_lbselection {arrayName off size} { + set windowName [format ".%sArrayWindow" $arrayName] + set itemNums [$windowName.lb curselection] + set cbString "" + for {set i 0} {$i < [expr [llength $itemNums] - 1]} {incr i} { + set listItem [$windowName.lb get [lindex $itemNums $i]] + append cbString [string range $listItem \ + [expr [string first ") " $listItem] + 2] \ + end] + append cbString "\n" + } + set listItem [$windowName.lb get [lindex $itemNums $i]] + append cbString [string range $listItem \ + [expr [string first ") " $listItem] + 2] \ + end] + set last $cbString +} + +# Win32 uses a popup menu for copy/paste +proc pdtk_array_listview_popup {arrayName} { + set windowName [format ".%sArrayWindow" $arrayName] + if [winfo exists $windowName.popup] then [destroy $windowName.popup] + menu $windowName.popup -tearoff false + $windowName.popup add command -label {Copy} \ + -command "pdtk_array_listview_copy $arrayName; \ + destroy $windowName.popup" + $windowName.popup add command -label {Paste} \ + -command "pdtk_array_listview_paste $arrayName; \ + destroy $windowName.popup" + tk_popup $windowName.popup [winfo pointerx $windowName] \ + [winfo pointery $windowName] 0 +} + +proc pdtk_array_listview_copy {arrayName} { + set windowName [format ".%sArrayWindow" $arrayName] + set itemNums [$windowName.lb curselection] + set cbString "" + for {set i 0} {$i < [expr [llength $itemNums] - 1]} {incr i} { + set listItem [$windowName.lb get [lindex $itemNums $i]] + append cbString [string range $listItem \ + [expr [string first ") " $listItem] + 2] \ + end] + append cbString "\n" + } + set listItem [$windowName.lb get [lindex $itemNums $i]] + append cbString [string range $listItem \ + [expr [string first ") " $listItem] + 2] \ + end] + clipboard clear + clipboard append $cbString +} + +proc pdtk_array_listview_paste {arrayName} { + global pd_array_listview_page + global pd_array_listview_pagesize + set cbString [selection get -selection CLIPBOARD] + set lbName [format ".%sArrayWindow.lb" $arrayName] + set itemNum [lindex [$lbName curselection] 0] + set splitChars ", \n" + set itemString [split $cbString $splitChars] + set flag 1 + for {set i 0; set counter 0} {$i < [llength $itemString]} {incr i} { + if {[lindex $itemString $i] != {}} { + pd [concat $arrayName [expr $itemNum + \ + [expr $counter + \ + [expr $pd_array_listview_pagesize \ + * $pd_array_listview_page($arrayName)]]] \ + [lindex $itemString $i] \;] + incr counter + set flag 0 + } + } +} + +proc pdtk_array_listview_edit {arrayName page font} { + global pd_array_listview_entry + global pd_nt + if {$pd_nt == 0} { + set font [expr $font - 2] + } + set lbName [format ".%sArrayWindow.lb" $arrayName] + if {[winfo exists $lbName.entry]} { + pdtk_array_listview_update_entry \ + $arrayName $pd_array_listview_entry($arrayName) + unset pd_array_listview_entry($arrayName) + } + set itemNum [$lbName index active] + set pd_array_listview_entry($arrayName) $itemNum + set bbox [$lbName bbox $itemNum] + set y [expr [lindex $bbox 1] - 4] + set $lbName.entry [entry $lbName.entry \ + -font [format -*-courier-bold--normal--%d-* $font]] + $lbName.entry insert 0 [] + place configure $lbName.entry -relx 0 -y $y -relwidth 1 + lower $lbName.entry + focus $lbName.entry + bind $lbName.entry \ + "pdtk_array_listview_update_entry $arrayName $itemNum;" +} + +proc pdtk_array_listview_update_entry {arrayName itemNum} { + global pd_array_listview_page + global pd_array_listview_pagesize + set lbName [format ".%sArrayWindow.lb" $arrayName] + set splitChars ", \n" + set itemString [split [$lbName.entry get] $splitChars] + set flag 1 + for {set i 0; set counter 0} {$i < [llength $itemString]} {incr i} { + if {[lindex $itemString $i] != {}} { + pd [concat $arrayName [expr $itemNum + \ + [expr $counter + \ + [expr $pd_array_listview_pagesize \ + * $pd_array_listview_page($arrayName)]]] \ + [lindex $itemString $i] \;] + incr counter + set flag 0 + } + } + pdtk_array_listview_fillpage $arrayName + destroy $lbName.entry +} + +proc pdtk_array_listview_closeWindow {arrayName} { + set windowName [format ".%sArrayWindow" $arrayName] + destroy $windowName +} + +proc pdtk_array_listview_close {id arrayName} { + pdtk_array_listview_closeWindow $arrayName + set cmd [concat $id "arrayviewclose" \;] + pd $cmd +} +##### end jsarlo ##### + # the put menu menu $name.m.put -tearoff $pd_tearoff $name.m add cascade -label Put -menu $name.m.put @@ -1014,6 +1225,7 @@ proc pdtk_canvas_new {name width height geometry editable} { bind $name.c {pdtk_canvas_key %W %K %A 1} bind $name.c {pdtk_canvas_keyup %W %K %A} bind $name.c {pdtk_canvas_motion %W %x %y 0} + bind $name.c {pdtk_canvas_motion %W %x %y 2} if {$pd_nt == 2} { bind $name.c {pdtk_canvas_motion %W %x %y 4} } else { @@ -2460,6 +2672,12 @@ proc array_apply {id} { \;] } +# jsarlo +proc array_viewlist {id name page} { + pd [concat $id arrayviewlistnew\;] +} +# end jsarlo + proc array_cancel {id} { set cmd [concat $id cancel \;] pd $cmd @@ -2514,12 +2732,16 @@ proc pdtk_array_dialog {id name n flags newone} { pack $id.drawasrects -side top radiobutton $id.drawasrects.drawasrects0 -value 0 \ -variable $var_array_drawasrects \ - -text "draw as polygon" + -text "draw as points" radiobutton $id.drawasrects.drawasrects1 -value 1 \ -variable $var_array_drawasrects \ - -text "draw as points" + -text "polygon" + radiobutton $id.drawasrects.drawasrects2 -value 2 \ + -variable $var_array_drawasrects \ + -text "bezier curve" pack $id.drawasrects.drawasrects0 -side top -anchor w pack $id.drawasrects.drawasrects1 -side top -anchor w + pack $id.drawasrects.drawasrects2 -side top -anchor w if {$newone != 0} { frame $id.radio @@ -2537,6 +2759,13 @@ proc pdtk_array_dialog {id name n flags newone} { -variable $var_array_otherflag -anchor w pack $id.deleteme -side top } + # jsarlo + if {$newone == 0} { + button $id.listview -text {View list}\ + -command "array_viewlist $id $name 0" + pack $id.listview -side left + } + # end jsarlo frame $id.buttonframe pack $id.buttonframe -side bottom -fill x -pady 2m button $id.buttonframe.cancel -text {Cancel}\ -- cgit v1.2.1