diff options
author | Guenter Geiger <ggeiger@users.sourceforge.net> | 2002-11-13 08:38:02 +0000 |
---|---|---|
committer | Guenter Geiger <ggeiger@users.sourceforge.net> | 2002-11-13 08:38:02 +0000 |
commit | 02a5595973b61d2cf789b9074167ed73b928d157 (patch) | |
tree | 0f6611197fc0219b7eb6213d26593390fa4eda62 /xgui/xgui-lib | |
parent | 3d60efd1619e57e5de9ba070a2b7331e55cf0932 (diff) |
This commit was generated by cvs2svn to compensate for changes in r206,
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/; revision=207
Diffstat (limited to 'xgui/xgui-lib')
-rw-r--r-- | xgui/xgui-lib/a2s.c | 66 | ||||
-rw-r--r-- | xgui/xgui-lib/concat.c | 68 | ||||
-rw-r--r-- | xgui/xgui-lib/help_number.pd | 60 | ||||
-rw-r--r-- | xgui/xgui-lib/m_pd.h | 579 | ||||
-rw-r--r-- | xgui/xgui-lib/makefile | 86 | ||||
-rw-r--r-- | xgui/xgui-lib/message.c | 116 | ||||
-rw-r--r-- | xgui/xgui-lib/number.c | 249 | ||||
-rw-r--r-- | xgui/xgui-lib/oname2l.c | 73 | ||||
-rw-r--r-- | xgui/xgui-lib/recv2.c | 80 | ||||
-rw-r--r-- | xgui/xgui-lib/replace_selector.c | 60 | ||||
-rw-r--r-- | xgui/xgui-lib/seg.c | 90 | ||||
-rw-r--r-- | xgui/xgui-lib/send2.c | 67 | ||||
-rw-r--r-- | xgui/xgui-lib/test_xgui_lib.pd | 134 | ||||
-rw-r--r-- | xgui/xgui-lib/try.sh | 1 | ||||
-rw-r--r-- | xgui/xgui-lib/xgui_lib.c | 17 |
15 files changed, 1746 insertions, 0 deletions
diff --git a/xgui/xgui-lib/a2s.c b/xgui/xgui-lib/a2s.c new file mode 100644 index 00000000..55a9bc47 --- /dev/null +++ b/xgui/xgui-lib/a2s.c @@ -0,0 +1,66 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* code for a2s pd class */
+
+#include "m_pd.h"
+#include <string.h>
+
+typedef struct s_pd_obj_a2s
+{
+ t_object x_obj;
+} t_pd_obj_a2s;
+
+
+void a2s_help(t_pd_obj_a2s *x)
+{
+ post(" ");
+ post("a2s v001");
+ post("+ selector list :");
+ post("++ help : this help !!!");
+ post("++ symbol : will return the canvas & the obj");
+ post(" ");
+}
+
+void a2s_list(t_pd_obj_a2s *x, t_symbol *s, int argc, t_atom *argv)
+{
+ char buffer[MAXPDSTRING] ;
+ char *a_string ;
+ int a_string_l ;
+ t_binbuf *bbuf ;
+ int i,l=0,k=0 ;
+
+ bbuf = binbuf_new() ;
+ for (i=0;i<argc;i++)
+ {
+ binbuf_clear(bbuf);
+ binbuf_add(bbuf, 1, argv++);
+ binbuf_gettext(bbuf, &a_string, &a_string_l);
+ memcpy(&buffer[k],a_string,a_string_l) ;
+ freebytes(a_string,a_string_l);
+ k+=a_string_l ;
+ }
+ buffer[k]=0;
+ outlet_symbol(x->x_obj.ob_outlet,gensym(&buffer[0]));
+ binbuf_free(bbuf);
+}
+
+void a2s_free(void) { }
+
+t_class *a2s_class;
+
+void *a2s_new(void)
+{
+ t_pd_obj_a2s *x = (t_pd_obj_a2s *)pd_new(a2s_class);
+ outlet_new(&x->x_obj, &s_float);
+ return (void *)x;
+}
+
+void a2s_setup(void)
+{
+ a2s_class = class_new(gensym("a2s"), (t_newmethod)a2s_new,(t_method)a2s_free, sizeof( t_pd_obj_a2s), 0,A_DEFSYMBOL, 0);
+ class_addlist(a2s_class, (t_method)a2s_list);
+ class_addmethod(a2s_class, (t_method)a2s_help, gensym("help"), 0);
+ class_sethelpsymbol(a2s_class, gensym("xgui/help_a2s"));
+}
diff --git a/xgui/xgui-lib/concat.c b/xgui/xgui-lib/concat.c new file mode 100644 index 00000000..59a70986 --- /dev/null +++ b/xgui/xgui-lib/concat.c @@ -0,0 +1,68 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* code for concat pd class */
+
+#include "m_pd.h"
+#include <string.h>
+
+typedef struct s_pd_obj_concat
+{
+ t_object x_obj;
+ t_symbol *selector ;
+} t_pd_obj_concat;
+
+
+void concat_help(t_pd_obj_concat *x)
+{
+ post(" ");
+ post("concat v001");
+ post("+ selector list :");
+ post("++ help : this help !!!");
+ post("++ anything : will return anything + the $arg1 in first ");
+}
+
+void concat_any_method(t_pd_obj_concat *x,t_symbol *s, int argc, t_atom *argv)
+{
+ int n = argc+1;
+ if ((s==gensym("float"))||(s==gensym("symbol"))||(s==gensym("list")))
+ {
+ outlet_anything(x->x_obj.ob_outlet,x->selector, argc,argv);
+ } else {
+ t_atom *my_message = (t_atom *)getbytes(n * sizeof(t_atom));
+ SETSYMBOL(my_message, s);
+ my_message++;
+ memcpy(my_message, argv, argc * sizeof(t_atom));
+ outlet_anything(x->x_obj.ob_outlet,x->selector, n,--my_message);
+ freebytes(my_message, n * sizeof(t_atom));
+ }
+}
+
+void concat_set2add(t_pd_obj_concat *x, t_symbol *s)
+{
+ x->selector = s ;
+}
+
+void concat_free(void) { }
+
+t_class *concat_class;
+
+void *concat_new(t_symbol *s)
+{
+ t_pd_obj_concat *x = (t_pd_obj_concat *)pd_new(concat_class);
+ x->selector = s;
+ outlet_new(&x->x_obj, &s_float);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("s2add"));
+ return (void *)x;
+}
+
+void concat_setup(void)
+{
+ concat_class = class_new(gensym("concat"), (t_newmethod)concat_new,(t_method)concat_free, sizeof( t_pd_obj_concat), 0,A_DEFSYMBOL, 0);
+ class_addanything(concat_class, concat_any_method);
+ class_addmethod(concat_class, (t_method)concat_set2add, gensym("s2add"), A_SYMBOL, 0);
+ class_addmethod(concat_class, (t_method)concat_help, gensym("help"), 0);
+ class_sethelpsymbol(concat_class, gensym("xgui/help_concat"));
+}
+
diff --git a/xgui/xgui-lib/help_number.pd b/xgui/xgui-lib/help_number.pd new file mode 100644 index 00000000..01951510 --- /dev/null +++ b/xgui/xgui-lib/help_number.pd @@ -0,0 +1,60 @@ +#N canvas 125 117 754 468 10;
+#X floatatom 35 99 5 0 0;
+#X msg 35 76 bang;
+#X msg 124 94 mult 2 \, bang;
+#X msg 124 140 sub 1 \, bang;
+#X msg 124 163 div 2 \, bang;
+#X msg 124 117 inv \, bang;
+#X msg 124 71 add 1 \, bang;
+#X msg 240 63 add 1 \, if >= 10 0 \, bang;
+#X msg 241 123 \$1 \, if < 0 0 \, if >= 10 10 \, bang;
+#X floatatom 241 100 5 0 0;
+#X msg 35 30 help;
+#X floatatom 124 25 5 0 0;
+#X msg 124 48 !x \$1 \, ?x;
+#X floatatom 422 151 5 0 0;
+#X floatatom 70 327 5 0 0;
+#X msg 70 350 !x \$1 \, ?x;
+#X msg 143 331 bang;
+#X obj 35 216 number my_first_number;
+#X msg 210 302 set my_first_number;
+#X obj 70 373 number my_second_number;
+#X msg 210 325 get my_first_number \, bang;
+#X floatatom 422 220 5 0 0;
+#X obj 35 240 print;
+#X obj 422 197 x my_first_number;
+#X msg 35 53 post;
+#X msg 643 211 bound 0;
+#X obj 70 396 print;
+#X msg 422 174 \$1 \, bang;
+#X msg 575 166 subspace 0 1 100 10;
+#X msg 646 237 bound 1 10;
+#X msg 181 26 bound 1 10;
+#X connect 0 0 17 0;
+#X connect 1 0 17 0;
+#X connect 2 0 17 0;
+#X connect 3 0 17 0;
+#X connect 4 0 17 0;
+#X connect 5 0 17 0;
+#X connect 6 0 17 0;
+#X connect 7 0 17 0;
+#X connect 8 0 17 0;
+#X connect 9 0 8 0;
+#X connect 10 0 17 0;
+#X connect 11 0 12 0;
+#X connect 12 0 17 0;
+#X connect 13 0 27 0;
+#X connect 14 0 15 0;
+#X connect 15 0 19 0;
+#X connect 16 0 19 0;
+#X connect 17 0 22 0;
+#X connect 18 0 19 0;
+#X connect 19 0 26 0;
+#X connect 20 0 19 0;
+#X connect 23 0 21 0;
+#X connect 24 0 17 0;
+#X connect 25 0 23 0;
+#X connect 27 0 23 0;
+#X connect 28 0 23 0;
+#X connect 29 0 23 0;
+#X connect 30 0 17 0;
diff --git a/xgui/xgui-lib/m_pd.h b/xgui/xgui-lib/m_pd.h new file mode 100644 index 00000000..bbbb491a --- /dev/null +++ b/xgui/xgui-lib/m_pd.h @@ -0,0 +1,579 @@ +/* Copyright (c) 1997-1999 Miller Puckette.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus)
+extern "C" {
+#endif
+
+#ifdef NT
+// #pragma warning( disable : 4091 )
+#pragma warning( disable : 4305 ) /* uncast const double to float */
+#pragma warning( disable : 4244 ) /* uncast float/int conversion etc. */
+#pragma warning( disable : 4101 ) /* unused automatic variables */
+#endif /* NT */
+
+ /* the external storage class is "extern" in UNIX; in NT it's ugly. */
+#ifdef NT
+#ifdef PD_INTERNAL
+#define EXTERN __declspec(dllexport) extern
+#else
+#define EXTERN __declspec(dllimport) extern
+#endif /* PD_INTERNAL */
+#else
+#define EXTERN extern
+#endif /* NT */
+
+ /* and depending on the compiler, hidden data structures are
+ declared differently: */
+#ifdef __GNUC__
+#define EXTERN_STRUCT struct
+#else
+#define EXTERN_STRUCT extern struct
+#endif
+
+
+#if !defined(_SIZE_T) && !defined(_SIZE_T_)
+#include <stddef.h> /* just for size_t -- how lame! */
+#endif
+
+#define MAXPDSTRING 1000 /* use this for anything you want */
+#define MAXPDARG 5 /* max number of args we can typecheck today */
+
+ /* signed and unsigned integer types the size of a pointer: */
+#ifdef __alpha__
+typedef long t_int;
+#else
+typedef int t_int;
+#endif
+
+typedef float t_float; /* a floating-point number at most the same size */
+typedef float t_floatarg; /* floating-point type for function calls */
+
+typedef struct _symbol
+{
+ char *s_name;
+ struct _class **s_thing;
+ struct _symbol *s_next;
+} t_symbol;
+
+EXTERN_STRUCT _array;
+#define t_array struct _array /* g_canvas.h */
+
+/* pointers to glist and array elements go through a "stub" which sticks
+around after the glist or array is freed. The stub itself is deleted when
+both the glist/array is gone and the refcount is zero, ensuring that no
+gpointers are pointing here. */
+
+#define GP_NONE 0 /* the stub points nowhere (has been cut off) */
+#define GP_GLIST 1 /* the stub points to a glist element */
+#define GP_ARRAY 2 /* ... or array */
+
+typedef struct _gstub
+{
+ union
+ {
+ struct _glist *gs_glist; /* glist we're in */
+ struct _array *gs_array; /* array we're in */
+ } gs_un;
+ int gs_which; /* GP_GLIST/GP_ARRAY */
+ int gs_refcount; /* number of gpointers pointing here */
+} t_gstub;
+
+typedef struct _gpointer /* pointer to a gobj in a glist */
+{
+ union
+ {
+ struct _scalar *gp_scalar; /* scalar we're in (if glist) */
+ union word *gp_w; /* raw data (if array) */
+ } gp_un;
+ int gp_valid; /* number which must match gpointee */
+ t_gstub *gp_stub; /* stub which points to glist/array */
+} t_gpointer;
+
+typedef union word
+{
+ t_float w_float;
+ t_symbol *w_symbol;
+ t_gpointer *w_gpointer;
+ t_array *w_array;
+ struct _glist *w_list;
+ int w_index;
+} t_word;
+
+typedef enum
+{
+ A_NULL,
+ A_FLOAT,
+ A_SYMBOL,
+ A_POINTER,
+ A_SEMI,
+ A_COMMA,
+ A_DEFFLOAT,
+ A_DEFSYM,
+ A_DOLLAR,
+ A_DOLLSYM,
+ A_GIMME,
+ A_CANT
+} t_atomtype;
+
+#define A_DEFSYMBOL A_DEFSYM /* better name for this */
+
+typedef struct _atom
+{
+ t_atomtype a_type;
+ union word a_w;
+} t_atom;
+
+EXTERN_STRUCT _class;
+#define t_class struct _class
+
+EXTERN_STRUCT _outlet;
+#define t_outlet struct _outlet
+
+EXTERN_STRUCT _inlet;
+#define t_inlet struct _inlet
+
+EXTERN_STRUCT _binbuf;
+#define t_binbuf struct _binbuf
+
+EXTERN_STRUCT _clock;
+#define t_clock struct _clock
+
+EXTERN_STRUCT _outconnect;
+#define t_outconnect struct _outconnect
+
+EXTERN_STRUCT _glist;
+#define t_glist struct _glist
+#define t_canvas struct _glist /* LATER lose this */
+
+typedef t_class *t_pd; /* pure datum: nothing but a class pointer */
+
+typedef struct _gobj /* a graphical object */
+{
+ t_pd g_pd; /* pure datum header (class) */
+ struct _gobj *g_next; /* next in list */
+} t_gobj;
+
+typedef struct _scalar /* a graphical object holding data */
+{
+ t_gobj sc_gobj; /* header for graphical object */
+ t_symbol *sc_template; /* template name (LATER replace with pointer) */
+ t_word sc_vec[1]; /* indeterminate-length array of words */
+} t_scalar;
+
+typedef struct _text /* patchable object - graphical, with text */
+{
+ t_gobj te_g; /* header for graphical object */
+ t_binbuf *te_binbuf; /* holder for the text */
+ t_outlet *te_outlet; /* linked list of outlets */
+ t_inlet *te_inlet; /* linked list of inlets */
+ short te_xpix; /* x&y location (within the toplevel) */
+ short te_ypix;
+ short te_width; /* requested width in chars, 0 if auto */
+ unsigned int te_type:2; /* from defs below */
+} t_text;
+
+#define T_TEXT 0 /* just a textual comment */
+#define T_OBJECT 1 /* a MAX style patchable object */
+#define T_MESSAGE 2 /* a MAX stype message */
+#define T_ATOM 3 /* a cell to display a number or symbol */
+
+#define te_pd te_g.g_pd
+
+ /* t_object is synonym for t_text (LATER unify them) */
+
+typedef struct _text t_object;
+
+#define ob_outlet te_outlet
+#define ob_inlet te_inlet
+#define ob_binbuf te_binbuf
+#define ob_pd te_g.g_pd
+#define ob_g te_g
+
+typedef void (*t_method)(void);
+typedef void *(*t_newmethod)( void);
+typedef void (*t_gotfn)(void *x, ...);
+
+/* ---------------- pre-defined objects and symbols --------------*/
+EXTERN t_pd pd_objectmaker; /* factory for creating "object" boxes */
+EXTERN t_pd pd_canvasmaker; /* factory for creating canvases */
+EXTERN t_symbol s_pointer;
+EXTERN t_symbol s_float;
+EXTERN t_symbol s_symbol;
+EXTERN t_symbol s_bang;
+EXTERN t_symbol s_list;
+EXTERN t_symbol s_anything;
+EXTERN t_symbol s_signal;
+EXTERN t_symbol s__N;
+EXTERN t_symbol s__X;
+EXTERN t_symbol s_x;
+EXTERN t_symbol s_y;
+EXTERN t_symbol s_;
+
+/* --------- prototypes from the central message system ----------- */
+EXTERN void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv);
+EXTERN void pd_forwardmess(t_pd *x, int argc, t_atom *argv);
+EXTERN t_symbol *gensym(char *s);
+EXTERN t_gotfn getfn(t_pd *x, t_symbol *s);
+EXTERN t_gotfn zgetfn(t_pd *x, t_symbol *s);
+EXTERN void nullfn(void);
+EXTERN void pd_vmess(t_pd *x, t_symbol *s, char *fmt, ...);
+#define mess0(x, s) ((*getfn((x), (s)))((x)))
+#define mess1(x, s, a) ((*getfn((x), (s)))((x), (a)))
+#define mess2(x, s, a,b) ((*getfn((x), (s)))((x), (a),(b)))
+#define mess3(x, s, a,b,c) ((*getfn((x), (s)))((x), (a),(b),(c)))
+#define mess4(x, s, a,b,c,d) ((*getfn((x), (s)))((x), (a),(b),(c),(d)))
+#define mess5(x, s, a,b,c,d,e) ((*getfn((x), (s)))((x), (a),(b),(c),(d),(e)))
+void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv);
+
+/* --------------- memory management -------------------- */
+EXTERN void *getbytes(size_t nbytes);
+EXTERN void *getzbytes(size_t nbytes);
+EXTERN void *copybytes(void *src, size_t nbytes);
+EXTERN void freebytes(void *x, size_t nbytes);
+EXTERN void *resizebytes(void *x, size_t oldsize, size_t newsize);
+
+/* -------------------- atoms ----------------------------- */
+
+#define SETSEMI(atom) ((atom)->a_type = A_SEMI, (atom)->a_w.w_index = 0)
+#define SETCOMMA(atom) ((atom)->a_type = A_COMMA, (atom)->a_w.w_index = 0)
+#define SETPOINTER(atom, gp) ((atom)->a_type = A_POINTER, \
+ (atom)->a_w.w_gpointer = (gp))
+#define SETFLOAT(atom, f) ((atom)->a_type = A_FLOAT, (atom)->a_w.w_float = (f))
+#define SETSYMBOL(atom, s) ((atom)->a_type = A_SYMBOL, \
+ (atom)->a_w.w_symbol = (s))
+#define SETDOLLAR(atom, n) ((atom)->a_type = A_DOLLAR, \
+ (atom)->a_w.w_index = (n))
+#define SETDOLLSYM(atom, s) ((atom)->a_type = A_DOLLSYM, \
+ (atom)->a_w.w_symbol= (s))
+
+EXTERN t_float atom_getfloat(t_atom *a);
+EXTERN t_int atom_getint(t_atom *a);
+EXTERN t_symbol *atom_getsymbol(t_atom *a);
+EXTERN t_symbol *atom_gensym(t_atom *a);
+EXTERN t_float atom_getfloatarg(int which, int argc, t_atom *argv);
+EXTERN t_int atom_getintarg(int which, int argc, t_atom *argv);
+EXTERN t_symbol *atom_getsymbolarg(int which, int argc, t_atom *argv);
+
+EXTERN void atom_string(t_atom *a, char *buf, unsigned int bufsize);
+
+/* ------------------ binbufs --------------- */
+
+EXTERN t_binbuf *binbuf_new(void);
+EXTERN void binbuf_free(t_binbuf *x);
+
+EXTERN void binbuf_text(t_binbuf *x, char *text, size_t size);
+EXTERN void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp);
+EXTERN void binbuf_clear(t_binbuf *x);
+EXTERN void binbuf_add(t_binbuf *x, int argc, t_atom *argv);
+EXTERN void binbuf_addv(t_binbuf *x, char *fmt, ...);
+EXTERN void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y);
+EXTERN void binbuf_addsemi(t_binbuf *x);
+EXTERN void binbuf_restore(t_binbuf *x, int argc, t_atom *argv);
+EXTERN void binbuf_print(t_binbuf *x);
+EXTERN int binbuf_getnatom(t_binbuf *x);
+EXTERN t_atom *binbuf_getvec(t_binbuf *x);
+EXTERN void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv);
+EXTERN int binbuf_read(t_binbuf *b, char *filename, char *dirname,
+ int crflag);
+EXTERN int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname,
+ int crflag);
+EXTERN int binbuf_write(t_binbuf *x, char *filename, char *dir,
+ int crflag);
+EXTERN void binbuf_evalfile(t_symbol *name, t_symbol *dir);
+
+/* ------------------ clocks --------------- */
+
+EXTERN t_clock *clock_new(void *owner, t_method fn);
+EXTERN void clock_set(t_clock *x, double systime);
+EXTERN void clock_delay(t_clock *x, double delaytime);
+EXTERN void clock_unset(t_clock *x);
+EXTERN double clock_getlogicaltime(void);
+EXTERN double clock_getsystime(void); /* OBSOLETE; use clock_getlogicaltime() */
+EXTERN double clock_gettimesince(double prevsystime);
+EXTERN double clock_getsystimeafter(double delaytime);
+EXTERN void clock_free(t_clock *x);
+
+/* ----------------- pure data ---------------- */
+EXTERN t_pd *pd_new(t_class *cls);
+EXTERN void pd_free(t_pd *x);
+EXTERN void pd_bind(t_pd *x, t_symbol *s);
+EXTERN void pd_unbind(t_pd *x, t_symbol *s);
+EXTERN t_pd *pd_findbyclass(t_symbol *s, t_class *c);
+EXTERN void pd_pushsym(t_pd *x);
+EXTERN void pd_popsym(t_pd *x);
+EXTERN t_symbol *pd_getfilename(void);
+EXTERN t_symbol *pd_getdirname(void);
+EXTERN void pd_bang(t_pd *x);
+EXTERN void pd_pointer(t_pd *x, t_gpointer *gp);
+EXTERN void pd_float(t_pd *x, t_float f);
+EXTERN void pd_symbol(t_pd *x, t_symbol *s);
+EXTERN void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv);
+EXTERN void pd_anything(t_pd *x, t_symbol *s, int argc, t_atom *argv);
+#define pd_class(x) (*(x))
+
+/* ----------------- pointers ---------------- */
+EXTERN void gpointer_init(t_gpointer *gp);
+EXTERN void gpointer_copy(const t_gpointer *gpfrom, t_gpointer *gpto);
+EXTERN void gpointer_unset(t_gpointer *gp);
+EXTERN int gpointer_check(const t_gpointer *gp, int headok);
+
+/* ----------------- patchable "objects" -------------- */
+EXTERN_STRUCT _inlet;
+#define t_inlet struct _inlet
+EXTERN_STRUCT _outlet;
+#define t_outlet struct _outlet
+
+EXTERN t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1,
+ t_symbol *s2);
+EXTERN t_inlet *pointerinlet_new(t_object *owner, t_gpointer *gp);
+EXTERN t_inlet *floatinlet_new(t_object *owner, t_float *fp);
+EXTERN t_inlet *symbolinlet_new(t_object *owner, t_symbol **sp);
+EXTERN void inlet_free(t_inlet *x);
+
+EXTERN t_outlet *outlet_new(t_object *owner, t_symbol *s);
+EXTERN void outlet_bang(t_outlet *x);
+EXTERN void outlet_pointer(t_outlet *x, t_gpointer *gp);
+EXTERN void outlet_float(t_outlet *x, t_float f);
+EXTERN void outlet_symbol(t_outlet *x, t_symbol *s);
+EXTERN void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv);
+EXTERN void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv);
+EXTERN void outlet_free(t_outlet *x);
+
+/* -------------------- canvases -------------- */
+
+EXTERN void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir);
+
+EXTERN void canvas_setargs(int argc, t_atom *argv);
+EXTERN t_atom *canvas_getarg(int which);
+EXTERN t_symbol *canvas_getcurrentdir(void);
+EXTERN t_glist *canvas_getcurrent(void);
+EXTERN void canvas_makefilename(t_glist *c, char *file,
+ char *result,int resultsize);
+EXTERN t_symbol *canvas_getdir(t_glist *x);
+EXTERN int sys_fontwidth(int fontsize);
+EXTERN int sys_fontheight(int fontsize);
+EXTERN void canvas_dataproperties(t_glist *x, t_scalar *sc, t_binbuf *b);
+
+/* ---------------- widget behaviors ---------------------- */
+
+EXTERN_STRUCT _widgetbehavior;
+#define t_widgetbehavior struct _widgetbehavior
+
+EXTERN_STRUCT _parentwidgetbehavior;
+#define t_parentwidgetbehavior struct _parentwidgetbehavior
+EXTERN t_parentwidgetbehavior *pd_getparentwidget(t_pd *x);
+
+/* -------------------- classes -------------- */
+
+#define CLASS_DEFAULT 0 /* flags for new classes below */
+#define CLASS_PD 1
+#define CLASS_GOBJ 2
+#define CLASS_PATCHABLE 3
+#define CLASS_NOINLET 8
+
+#define CLASS_TYPEMASK 3
+
+
+EXTERN t_class *class_new(t_symbol *name, t_newmethod newmethod,
+ t_method freemethod, size_t size, int flags, t_atomtype arg1, ...);
+EXTERN void class_addcreator(t_newmethod newmethod, t_symbol *s,
+ t_atomtype type1, ...);
+EXTERN void class_addmethod(t_class *c, t_method fn, t_symbol *sel,
+ t_atomtype arg1, ...);
+EXTERN void class_addbang(t_class *c, t_method fn);
+EXTERN void class_addpointer(t_class *c, t_method fn);
+EXTERN void class_doaddfloat(t_class *c, t_method fn);
+EXTERN void class_addsymbol(t_class *c, t_method fn);
+EXTERN void class_addlist(t_class *c, t_method fn);
+EXTERN void class_addanything(t_class *c, t_method fn);
+EXTERN void class_sethelpsymbol(t_class *c, t_symbol *s);
+EXTERN void class_setwidget(t_class *c, t_widgetbehavior *w);
+EXTERN void class_setparentwidget(t_class *c, t_parentwidgetbehavior *w);
+EXTERN t_parentwidgetbehavior *class_parentwidget(t_class *c);
+EXTERN char *class_getname(t_class *c);
+EXTERN char *class_gethelpname(t_class *c);
+EXTERN void class_setdrawcommand(t_class *c);
+EXTERN int class_isdrawcommand(t_class *c);
+EXTERN void class_domainsignalin(t_class *c, int onset);
+#define CLASS_MAINSIGNALIN(c, type, field) \
+ class_domainsignalin(c, (char *)(&((type *)0)->field) - (char *)0)
+
+#ifndef PD_CLASS_DEF
+#define class_addbang(x, y) class_addbang((x), (t_method)(y))
+#define class_addpointer(x, y) class_addpointer((x), (t_method)(y))
+#define class_addfloat(x, y) class_doaddfloat((x), (t_method)(y))
+#define class_addsymbol(x, y) class_addsymbol((x), (t_method)(y))
+#define class_addlist(x, y) class_addlist((x), (t_method)(y))
+#define class_addanything(x, y) class_addanything((x), (t_method)(y))
+#endif
+
+/* ------------ printing --------------------------------- */
+EXTERN void post(char *fmt, ...);
+EXTERN void startpost(char *fmt, ...);
+EXTERN void poststring(char *s);
+EXTERN void postfloat(float f);
+EXTERN void postatom(int argc, t_atom *argv);
+EXTERN void endpost(void);
+EXTERN void error(char *fmt, ...);
+EXTERN void bug(char *fmt, ...);
+EXTERN void pd_error(void *object, char *fmt, ...);
+EXTERN void sys_logerror(char *object, char *s);
+EXTERN void sys_unixerror(char *object);
+EXTERN void sys_ouch(void);
+
+#ifdef __linux__
+EXTERN char* sys_get_path( void);
+#endif
+EXTERN void sys_addpath(const char* p);
+
+
+/* ------------ system interface routines ------------------- */
+EXTERN int sys_isreadablefile(const char *name);
+EXTERN void sys_bashfilename(const char *from, char *to);
+EXTERN void sys_unbashfilename(const char *from, char *to);
+EXTERN int open_via_path(const char *name, const char *ext, const char *dir,
+ char *dirresult, char **nameresult, unsigned int size, int bin);
+
+/* --------------- signals ----------------------------------- */
+
+typedef float t_sample;
+#define MAXLOGSIG 32
+#define MAXSIGSIZE (1 << MAXLOGSIG)
+
+typedef struct _signal
+{
+ int s_n; /* number of points in the array */
+ t_sample *s_vec; /* the array */
+ float s_sr; /* sample rate */
+ int s_refcount; /* number of times used */
+ int s_isborrowed; /* whether we're going to borrow our array */
+ struct _signal *s_borrowedfrom; /* signal to borrow it from */
+ struct _signal *s_nextfree; /* next in freelist */
+ struct _signal *s_nextused; /* next in used list */
+} t_signal;
+
+
+typedef t_int *(*t_perfroutine)(t_int *args);
+
+EXTERN t_int *plus_perform(t_int *args);
+EXTERN t_int *zero_perform(t_int *args);
+EXTERN t_int *copy_perform(t_int *args);
+
+EXTERN void dsp_add_plus(t_sample *in1, t_sample *in2, t_sample *out, int n);
+EXTERN void dsp_add_copy(t_sample *in, t_sample *out, int n);
+EXTERN void dsp_add_scalarcopy(t_sample *in, t_sample *out, int n);
+EXTERN void dsp_add_zero(t_sample *out, int n);
+
+EXTERN int sys_getblksize(void);
+EXTERN float sys_getsr(void);
+EXTERN int sys_get_inchannels(void);
+EXTERN int sys_get_outchannels(void);
+
+EXTERN void dsp_add(t_perfroutine f, int n, ...);
+EXTERN void dsp_addv(t_perfroutine f, int n, t_int *vec);
+EXTERN void pd_fft(float *buf, int npoints, int inverse);
+EXTERN int ilog2(int n);
+
+EXTERN void mayer_fht(float *fz, int n);
+EXTERN void mayer_fft(int n, float *real, float *imag);
+EXTERN void mayer_ifft(int n, float *real, float *imag);
+EXTERN void mayer_realfft(int n, float *real);
+EXTERN void mayer_realifft(int n, float *real);
+
+EXTERN float *cos_table;
+#define LOGCOSTABSIZE 9
+#define COSTABSIZE (1<<LOGCOSTABSIZE)
+
+EXTERN int canvas_suspend_dsp(void);
+EXTERN void canvas_resume_dsp(int oldstate);
+EXTERN void canvas_update_dsp(void);
+
+/* IOhannes { (up/downsampling) */
+typedef struct _resample
+{
+ int method; /* up/downsampling method ID */
+
+ t_int downsample; /* downsampling factor */
+ t_int upsample; /* upsampling factor */
+
+ t_float *s_vec; /* here we hold the resampled data */
+ int s_n;
+
+ t_float *coeffs; /* coefficients for filtering... */
+ int coefsize;
+
+ t_float *buffer; /* buffer for filtering */
+ int bufsize;
+} t_resample;
+
+EXTERN void resample_init(t_resample *x);
+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);
+EXTERN float ftom(float);
+EXTERN float rmstodb(float);
+EXTERN float powtodb(float);
+EXTERN float dbtorms(float);
+EXTERN float dbtopow(float);
+
+EXTERN float q8_sqrt(float);
+EXTERN float q8_rsqrt(float);
+#ifndef N32
+EXTERN float qsqrt(float); /* old names kept for extern compatibility */
+EXTERN float qrsqrt(float);
+#endif
+/* --------------------- data --------------------------------- */
+
+ /* graphical arrays */
+EXTERN_STRUCT _garray;
+#define t_garray struct _garray
+
+EXTERN t_class *garray_class;
+EXTERN int garray_getfloatarray(t_garray *x, int *size, t_float **vec);
+EXTERN float garray_get(t_garray *x, t_symbol *s, t_int indx);
+EXTERN void garray_redraw(t_garray *x);
+EXTERN int garray_npoints(t_garray *x);
+EXTERN char *garray_vec(t_garray *x);
+EXTERN void garray_resize(t_garray *x, t_floatarg f);
+EXTERN void garray_usedindsp(t_garray *x);
+EXTERN void garray_setsaveit(t_garray *x, int saveit);
+EXTERN t_class *scalar_class;
+
+EXTERN t_float *value_get(t_symbol *s);
+EXTERN void value_release(t_symbol *s);
+
+/* ------- GUI interface - functions to send strings to TK --------- */
+EXTERN void sys_vgui(char *fmt, ...);
+EXTERN void sys_gui(char *s);
+
+EXTERN void gfxstub_new(t_pd *owner, void *key, const char *cmd);
+EXTERN void gfxstub_deleteforkey(void *key);
+
+/*------------- Max 0.26 compatibility --------------------*/
+
+/* the following reflects the new way classes are laid out, with the class
+ pointing to the messlist and not vice versa. Externs shouldn't feel it. */
+typedef t_class *t_externclass;
+
+EXTERN void c_extern(t_externclass *cls, t_newmethod newroutine,
+ t_method freeroutine, t_symbol *name, size_t size, int tiny, \
+ t_atomtype arg1, ...);
+EXTERN void c_addmess(t_method fn, t_symbol *sel, t_atomtype arg1, ...);
+
+#define t_getbytes getbytes
+#define t_freebytes freebytes
+#define t_resizebytes resizebytes
+#define typedmess pd_typedmess
+#define vmess pd_vmess
+
+#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus)
+}
+#endif
diff --git a/xgui/xgui-lib/makefile b/xgui/xgui-lib/makefile new file mode 100644 index 00000000..56b5000c --- /dev/null +++ b/xgui/xgui-lib/makefile @@ -0,0 +1,86 @@ +current:
+ echo make pd_linux, pd_nt, pd_irix5, or pd_irix6
+
+clean: ; rm -f *.pd_linux *.o *.obj *.bak *.dll
+
+# ----------------------- NT -----------------------------
+
+pd_nt: number.dll concat.dll oname2l.dll \
+ a2s.dll recv2.dll send2.dll replace_selector.dll
+
+.SUFFIXES: .dll
+
+PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
+VC="C:\Program Files\Microsoft Visual Studio\Vc98"
+
+PDNTINCLUDE = /I. /I\tcl\include /I\pds\pd35-9\src /I$(VC)\include
+
+PDNTLDIR = $(VC)\lib
+PDNTLIB = $(PDNTLDIR)\libc.lib \
+ $(PDNTLDIR)\oldnames.lib \
+ $(PDNTLDIR)\kernel32.lib \
+ \pds\pd35-9\bin\pd.lib
+
+.c.dll:
+ cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
+ link /dll /export:$*_setup $*.obj $(PDNTLIB)
+ del $*.obj
+ del $*.exp
+ del $*.lib
+ move /Y $*.dll ../../extra/
+
+# ----------------------- IRIX 5.x -----------------------
+
+pd_irix5: number.pd_irix5 concat.pd_irix5 oname2l.pd_irix5 \
+ a2s.pd_irix5 recv2.pd_irix5 send2.pd_irix5 replace_selector.pd_irix5
+
+.SUFFIXES: .pd_irix5
+
+SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
+
+
+SGIINCLUDE = -I../../src/
+
+.c.pd_irix5:
+ cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
+ rm $*.o
+
+# ----------------------- IRIX 6.x -----------------------
+
+pd_irix6: number.pd_irix6 concat.pd_irix6 oname2l.pd_irix6 \
+ a2s.pd_irix6 recv2.pd_irix6 send2.pd_irix6 replace_selector.pd_irix6
+
+.SUFFIXES: .pd_irix6
+
+SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -Ofast=ip32
+
+.c.pd_irix6:
+ cc $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
+ ld -IPA -n32 -shared -rdata_shared -o $*.pd_irix6 $*.o
+ rm $*.o
+
+# ----------------------- LINUX i386 -----------------------
+
+pd_linux: number.pd_linux concat.pd_linux oname2l.pd_linux \
+ a2s.pd_linux recv2.pd_linux send2.pd_linux replace_selector.pd_linux
+
+.SUFFIXES: .pd_linux
+
+LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wshadow -Wstrict-prototypes -Werror \
+ -Wno-unused -Wno-parentheses -Wno-switch
+
+LINUXINCLUDE = -I../../src
+
+.c.pd_linux:
+ cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+ strip --strip-unneeded $*.pd_linux
+ rm $*.o
+ cp $*.pd_linux ../bin/
+ mv $*.pd_linux ../../extra/
+
+
diff --git a/xgui/xgui-lib/message.c b/xgui/xgui-lib/message.c new file mode 100644 index 00000000..57edc16b --- /dev/null +++ b/xgui/xgui-lib/message.c @@ -0,0 +1,116 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* message : NOT WORKING YET */
+
+
+/*#include "m_pd.h"*/
+
+t_class *message_class ;
+typedef struct s_message
+{ t_pd o_pd;
+ int o_refcount;
+ t_message ??? o_message;
+} t_message;
+
+t_class *pd_obj_message_class ;
+typedef struct s_pd_obj_message
+{
+ t_object x_obj;
+ t_symbol *x_sym;
+ t_float *x_message;
+} t_pd_obj_message;
+
+t_float *message_get(t_symbol *s)
+{ t_message *num = (t_message *)pd_findbyclass(s,message_class);
+ if (!num) {
+ num = (t_message *)pd_new(message_class);
+ num->o_message = 0;
+ num->o_refcount = 0;
+ pd_bind(&num->o_pd, s);
+ }
+ num->o_refcount++;
+ return (&num->o_message);
+}
+
+void message_release(t_symbol *s)
+{ t_message *num = (t_message *)pd_findbyclass(s,message_class);
+ if (num) {
+ if (!--num->o_refcount) {
+ pd_unbind(&num->o_pd, s);
+ pd_free(&num->o_pd);
+ }
+ }
+ else bug("value_release");
+}
+
+void message_help(t_seg *x)
+{
+ post(" ");
+ post("message v001");
+ post("+ symbol list :");
+ post("++ help : this help !!!");
+ post("++ float : set the float ");
+ post("++ bang : send the message");
+ post(" ");
+}
+
+void message_float(t_pd_obj_message *x, t_floatarg f)
+{ *x->x_message = f ;}
+
+void message_q_x(t_pd_obj_message *x)
+{
+ t_atom my_atom ;
+ t_atom *my_pointer = &my_atom;
+ SETFLOAT(my_pointer, *x->x_message);
+ outlet_anything(x->x_obj.ob_outlet, gensym("x="), 1,my_pointer);
+}
+
+void message_bang(t_pd_obj_message *x)
+{ outlet_float(x->x_obj.ob_outlet, *x->x_message);}
+
+void message_get_(t_pd_obj_message *x,t_symbol *s)
+{*x->x_message = *message_get(s);}
+
+void message_set_(t_pd_obj_message *x,t_symbol *s)
+{ x->x_message = message_get(s);}
+
+void message_to(t_pd_obj_message *x,t_floatarg f1,t_floatarg f2)
+{ post("not implemented yet"); }
+
+void message_free(t_pd_obj_message *x){ message_release(x->x_sym); }
+
+void *message_new(t_symbol *s,t_floatarg f)
+{
+ t_pd_obj_message *x = (t_pd_obj_message *)pd_new(pd_obj_message_class);
+ x->x_sym = s;
+ x->x_message = message_get(s);
+ outlet_new(&x->x_obj, &s_float);
+ return (void *)x;
+}
+
+void message_setup(void)
+{
+ pd_obj_message_class = class_new(gensym("message"), (t_newmethod)message_new,
+ (t_method)message_free, sizeof(t_pd_obj_message), 0,A_DEFSYMBOL, 0);
+ class_addcreator((t_newmethod)message_new, gensym("x"), A_DEFSYM, 0);
+ class_addfloat(pd_obj_message_class,message_float);
+ class_addbang(pd_obj_message_class,message_bang);
+ class_addmethod(pd_obj_message_class, (t_method)message_float, gensym("!x"), A_FLOAT, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_q_x, gensym("?x"), 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_add, gensym("add"),A_FLOAT, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_sub, gensym("sub"),A_FLOAT, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_mult, gensym("mult"),A_FLOAT, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_div, gensym("div"),A_FLOAT, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_inv, gensym("inv"),0);
+ class_addmethod(pd_obj_message_class, (t_method)message_if, gensym("if"),A_DEFSYMBOL,A_FLOAT,A_FLOAT,0);
+ class_addmethod(pd_obj_message_class, (t_method)message_to, gensym("to"),A_FLOAT,A_FLOAT, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_set_, gensym("set"),A_DEFSYMBOL, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_get_, gensym("get"),A_DEFSYMBOL, 0);
+ class_addmethod(pd_obj_message_class, (t_method)message_help, gensym("help"), 0);
+ class_sethelpsymbol(pd_obj_message_class, gensym("xgui/help_message"));
+ /* Declare the class that will contain the value */
+ message_class = class_new(gensym("message"), 0, 0, sizeof(t_message), CLASS_PD, 0);
+
+}
diff --git a/xgui/xgui-lib/number.c b/xgui/xgui-lib/number.c new file mode 100644 index 00000000..f30d10da --- /dev/null +++ b/xgui/xgui-lib/number.c @@ -0,0 +1,249 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* number NOT FINISHED BUT FUNCTIONAL*/
+
+#include "m_pd.h"
+
+t_class *number_class ;
+typedef struct s_number
+{
+ t_pd o_pd;
+ t_int o_refcount;
+ t_float number;
+ t_float b_min;
+ t_float b_max;
+ t_int bound;
+} t_number;
+
+t_class *pd_obj_number_class ;
+typedef struct s_pd_obj_number
+{
+ t_object x_obj;
+ t_symbol *x_sym;
+ t_number *x_num;
+ t_float *x_number;
+ t_float *b_min;
+ t_float *b_max;
+ t_int *bound;
+ t_float min;
+ t_float max;
+ t_float out_min;
+ t_float out_max;
+} t_pd_obj_number;
+
+t_number *number_get(t_symbol *s)
+{
+ t_number *num = (t_number *)pd_findbyclass(s,number_class);
+ if (!num) {
+ num = (t_number *)pd_new(number_class);
+ num->number = 0;
+ num->bound = 0;
+ num->b_min = 0;
+ num->b_max = 0;
+ num->o_refcount = 0;
+ pd_bind(&num->o_pd, s);
+ }
+ num->o_refcount++;
+ return (num);
+}
+
+void number_release(t_symbol *s)
+{ t_number *num = (t_number *)pd_findbyclass(s,number_class);
+ if (num) {
+ if (!--num->o_refcount) {
+ pd_unbind(&num->o_pd, s);
+ pd_free(&num->o_pd);
+ }
+ }
+ else bug("value_release");
+}
+
+void number_check_bound(t_pd_obj_number *x)
+{
+ if (*x->bound != 0)
+ {
+ if (*x->x_number>*x->b_max) *x->x_number = *x->b_max ;
+ if (*x->x_number<*x->b_min) *x->x_number = *x->b_min ;
+ }
+}
+
+void number_help(t_pd_obj_number *x)
+{
+ post(" ");
+ post("number v001");
+ post("+ use : number $variable_name");
+ post("+ symbol list :");
+ post("+l+ help : this help !!!");
+ post("+g+ float $f: set the value to $f ");
+ post("+l+ bang : send the number");
+ post("+g+ !x $f : set the value to $f");
+ post("+l+ ?x : ask for the value the number");
+ post("+g+ if $condition $f1 $f2 : ex.: if => 10 0");
+ post("+l+ do_if $condition $value $selector : ex.: do_if => 10 test");
+ post("+g+ add,sub,mult,div,inv : do some basic calculation");
+ post("+l+ get : get a value from another number");
+ post("+l+ set : set the name of the number");
+ post("+l+ subspace $internal1 $internal2 $external1 $external1");
+ post("+gl?+ round $round_value");
+ post("+g+ bound $min $max");
+ post("+l+ post");
+ post(" ");
+}
+
+void number_post(t_pd_obj_number *x)
+{
+ startpost("%s",*x->x_sym);
+ postfloat(*x->x_number);
+ endpost();
+}
+
+void number_x_equal(t_pd_obj_number *x, t_floatarg f)
+{
+ *x->x_number = f ;
+ number_check_bound(x);
+}
+void number_q_x(t_pd_obj_number *x)
+{
+ t_atom my_atom ;
+ t_atom *my_pointer = &my_atom;
+ SETFLOAT(my_pointer, *x->x_number);
+ outlet_anything(x->x_obj.ob_outlet, gensym("x="), 1,my_pointer);
+}
+
+void number_float(t_pd_obj_number *x, t_floatarg f)
+{
+ *x->x_number = (f - x->out_min)*(x->max-x->min)/(x->out_max-x->out_min)+x->min ;
+ number_check_bound(x);
+}
+
+void number_bang(t_pd_obj_number *x)
+{ t_float temp ;
+ temp = (*x->x_number-x->min)/(x->max-x->min)*(x->out_max-x->out_min)+x->out_min;
+ outlet_float(x->x_obj.ob_outlet,temp) ;
+}
+
+void number_bound(t_pd_obj_number *x, t_floatarg fmin, t_floatarg fmax)
+{
+ *x->bound = 1 ;
+ *x->b_min = fmin;
+ *x->b_max = fmax;
+}
+
+void number_add(t_pd_obj_number *x, t_floatarg f)
+{
+ *(x->x_number) += f ;
+ number_check_bound(x);
+}
+
+void number_sub(t_pd_obj_number *x, t_floatarg f)
+{
+ *(x->x_number) -= f ;
+ number_check_bound(x);
+}
+
+void number_mult(t_pd_obj_number *x, t_floatarg f)
+{
+ *(x->x_number) *= f ;
+ number_check_bound(x);
+}
+
+void number_div(t_pd_obj_number *x, t_floatarg f)
+{
+ *(x->x_number) /= f ;
+ number_check_bound(x);
+}
+
+void number_inv(t_pd_obj_number *x)
+{
+ *x->x_number = 1 / *(x->x_number) ;
+ number_check_bound(x);
+}
+
+void number_subspace(t_pd_obj_number *x, t_floatarg f1, t_floatarg f2, t_floatarg f3, t_floatarg f4)
+{
+ if ((f1==f2)|(f3==f4))
+ {
+ x->min = 0 ; x->max = 1 ; x->out_min = 0 ; x->out_max = 1 ;
+ post("%s ERROR wrong Subspace",*x->x_sym);
+ }
+ else
+ {
+ x->min = f1 ; x->max = f2 ; x->out_min = f3 ; x->out_max = f4 ;
+ }
+}
+
+void number_if(t_pd_obj_number *x,t_symbol *s,t_floatarg f1,t_floatarg f2)
+{
+ if (s == gensym("==")) {if(*x->x_number == f1) *x->x_number = f2 ;}
+ if (s == gensym("!=")) {if(*x->x_number != f1) *x->x_number = f2 ;}
+ if (s == gensym(">")) {if(*x->x_number > f1) *x->x_number = f2 ;}
+ if (s == gensym(">=")) {if(*x->x_number >= f1) *x->x_number = f2 ;}
+ if (s == gensym("<")) {if(*x->x_number < f1) *x->x_number = f2 ;}
+ if (s == gensym("<=")) {if(*x->x_number <= f1) *x->x_number = f2 ;}
+}
+
+void number_do_if(t_pd_obj_number *x,t_symbol *cond,t_floatarg f1,t_symbol *sel)
+{
+ t_atom my_atom ;
+ t_atom *my_pointer = &my_atom;
+ SETFLOAT(my_pointer, *x->x_number);
+ post("t1 %f",f1);
+ if (cond == gensym("==")) {if(*x->x_number == f1) outlet_anything(x->x_obj.ob_outlet, sel, 1,my_pointer);}
+ if (cond == gensym("!=")) {if(*x->x_number != f1) outlet_anything(x->x_obj.ob_outlet, sel, 1,my_pointer);}
+ if (cond == gensym(">")) {if(*x->x_number > f1) outlet_anything(x->x_obj.ob_outlet, sel, 1,my_pointer);}
+ if (cond == gensym(">=")) {if(*x->x_number >= f1) post("test %f",f1);}
+ if (cond == gensym("<")) {if(*x->x_number < f1) outlet_anything(x->x_obj.ob_outlet, sel, 1,my_pointer);}
+ if (cond == gensym("<=")) {if(*x->x_number <= f1) outlet_anything(x->x_obj.ob_outlet, sel, 1,my_pointer);}
+}
+
+void number_get_(t_pd_obj_number *x,t_symbol *s)
+{*x->x_num = *number_get(s);}
+
+void number_set_(t_pd_obj_number *x,t_symbol *s)
+{ x->x_num = number_get(s);}
+
+void number_free(t_pd_obj_number *x){ number_release(x->x_sym); }
+
+void *number_new(t_symbol *s)
+{
+ t_pd_obj_number *x = (t_pd_obj_number *)pd_new(pd_obj_number_class);
+ x->x_sym = s;
+ x->x_num = number_get(s);
+ x->x_number=&(x->x_num->number) ;
+ x->min = 0 ; x->max = 1 ; x->out_min = 0 ; x->out_max = 1 ;
+ x->b_min =&x->x_num->b_min ;
+ x->b_max =&x->x_num->b_max ;
+ x->bound =&x->x_num->bound ;
+ outlet_new(&x->x_obj, &s_float);
+ return (void *)x;
+}
+
+void number_setup(void)
+{
+ pd_obj_number_class = class_new(gensym("number"), (t_newmethod)number_new,
+ (t_method)number_free, sizeof(t_pd_obj_number), 0,A_DEFSYMBOL, 0);
+ class_addcreator((t_newmethod)number_new, gensym("x"), A_DEFSYM, 0);
+ class_addfloat(pd_obj_number_class,number_float);
+ class_addbang(pd_obj_number_class,number_bang);
+ class_addmethod(pd_obj_number_class, (t_method)number_x_equal, gensym("!x"), A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_q_x, gensym("?x"), 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_post, gensym("post"), 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_add, gensym("add"),A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_sub, gensym("sub"),A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_mult, gensym("mult"),A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_div, gensym("div"),A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_inv, gensym("inv"),0);
+ class_addmethod(pd_obj_number_class, (t_method)number_if, gensym("if"),A_DEFSYMBOL,A_FLOAT,A_FLOAT,0);
+ class_addmethod(pd_obj_number_class, (t_method)number_set_, gensym("set"),A_DEFSYMBOL, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_get_, gensym("get"),A_DEFSYMBOL, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_do_if, gensym("do_if"),A_DEFSYMBOL,A_FLOAT,A_DEFSYMBOL,0);
+ class_addmethod(pd_obj_number_class, (t_method)number_subspace, gensym("subspace"),A_FLOAT,A_FLOAT,A_FLOAT,A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_bound, gensym("bound"),A_FLOAT,A_FLOAT, 0);
+ class_addmethod(pd_obj_number_class, (t_method)number_help, gensym("help"), 0);
+ class_sethelpsymbol(pd_obj_number_class, gensym("xgui/help_number"));
+ /* Declare the class that will contain the value */
+ number_class = class_new(gensym("number"), 0, 0, sizeof(t_number), CLASS_PD, 0);
+
+}
diff --git a/xgui/xgui-lib/oname2l.c b/xgui/xgui-lib/oname2l.c new file mode 100644 index 00000000..1b46e8a3 --- /dev/null +++ b/xgui/xgui-lib/oname2l.c @@ -0,0 +1,73 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* oname2l */
+
+#include "m_pd.h"
+#include <string.h>
+
+typedef struct s_pd_obj_oname2l
+{
+ t_object x_obj;
+} t_pd_obj_oname2l;
+
+
+void oname2l_help(t_pd_obj_oname2l *x)
+{
+ post(" ");
+ post("oname2l v001");
+ post("+ selector list :");
+ post("++ help : this help !!!");
+ post("++ symbol : will return a list of symbol");
+ post(" ");
+}
+
+void oname2l_symbol(t_pd_obj_oname2l *x,t_symbol *s)
+{
+ int i,j,l,n=1,k=0;
+ t_atom *my_message ;
+ char *s2split ;
+ t_symbol *a_symbol ;
+ t_atom *an_atom ;
+ for (l=0;s->s_name[l]!=0;l++)
+ {
+ if (s->s_name[l]=='/') {n++;} ;
+ }
+ s2split = (char *)getbytes(l+1) ;
+ memcpy(s2split, s->s_name, l+1) ;
+ my_message = (t_atom *)getbytes(n * sizeof(t_atom));
+ an_atom = my_message ;
+ for (i=0;i<n;i++)
+ {
+ for (j=k;(s2split[j]!='/')&&(j<l);j++) {} ;
+ s2split[j]=0 ;
+ a_symbol = gensym(&(s2split[k]));
+ SETSYMBOL(an_atom,a_symbol);
+ an_atom++;
+ k=j+1;
+ }
+ outlet_anything(x->x_obj.ob_outlet,gensym("list"), n,my_message);
+ freebytes(my_message, n * sizeof(t_atom));
+ freebytes(s2split, l );
+}
+
+void oname2l_free(void) { }
+
+t_class *oname2l_class;
+
+void *oname2l_new(void)
+{
+ t_pd_obj_oname2l *x = (t_pd_obj_oname2l *)pd_new(oname2l_class);
+ outlet_new(&x->x_obj, &s_float);
+ return (void *)x;
+}
+
+void oname2l_setup(void)
+{
+ oname2l_class = class_new(gensym("oname2l"), (t_newmethod)oname2l_new,(t_method)oname2l_free, sizeof( t_pd_obj_oname2l), 0,A_DEFSYMBOL, 0);
+ class_addsymbol(oname2l_class, (t_method)oname2l_symbol);
+ class_addmethod(oname2l_class, (t_method)oname2l_help, gensym("help"), 0);
+ class_sethelpsymbol(oname2l_class, gensym("xgui/help_oname2l"));
+}
+
diff --git a/xgui/xgui-lib/recv2.c b/xgui/xgui-lib/recv2.c new file mode 100644 index 00000000..f49e374c --- /dev/null +++ b/xgui/xgui-lib/recv2.c @@ -0,0 +1,80 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* recv2 */
+
+#include "m_pd.h"
+
+static t_class *recv2_class;
+
+typedef struct _recv2
+{
+ t_object x_obj;
+ t_symbol *x_sym;
+} t_recv2;
+
+static void recv2_bang(t_recv2 *x)
+{
+ outlet_bang(x->x_obj.ob_outlet);
+}
+
+static void recv2_float(t_recv2 *x, t_float f)
+{
+ outlet_float(x->x_obj.ob_outlet, f);
+}
+
+static void recv2_symbol(t_recv2 *x, t_symbol *s)
+{
+ outlet_symbol(x->x_obj.ob_outlet, s);
+}
+
+static void recv2_pointer(t_recv2 *x, t_gpointer *gp)
+{
+ outlet_pointer(x->x_obj.ob_outlet, gp);
+}
+
+static void recv2_list(t_recv2 *x, t_symbol *s, int argc, t_atom *argv)
+{
+ outlet_list(x->x_obj.ob_outlet, s, argc, argv);
+}
+
+static void recv2_anything(t_recv2 *x, t_symbol *s, int argc, t_atom *argv)
+{
+ outlet_anything(x->x_obj.ob_outlet, s, argc, argv);
+}
+
+static void recv2_set(t_recv2 *x, t_symbol *s)
+{
+ pd_unbind(&x->x_obj.ob_pd, x->x_sym);
+ x->x_sym = s;
+ pd_bind(&x->x_obj.ob_pd, s);
+}
+
+static void *recv2_new(t_symbol *s)
+{
+ t_recv2 *x = (t_recv2 *)pd_new(recv2_class);
+ x->x_sym = s;
+ pd_bind(&x->x_obj.ob_pd, s);
+ outlet_new(&x->x_obj, 0);
+ return (x);
+}
+
+static void recv2_free(t_recv2 *x)
+{
+ pd_unbind(&x->x_obj.ob_pd, x->x_sym);
+}
+
+void recv2_setup(void)
+{
+ recv2_class = class_new(gensym("recv2"), (t_newmethod)recv2_new,
+ (t_method)recv2_free, sizeof(t_recv2), 0, A_DEFSYM, 0);
+ class_addbang(recv2_class, recv2_bang);
+ class_addfloat(recv2_class, (t_method)recv2_float);
+ class_addsymbol(recv2_class, recv2_symbol);
+ class_addpointer(recv2_class, recv2_pointer);
+ class_addlist(recv2_class, recv2_list);
+ class_addanything(recv2_class, recv2_anything);
+ class_addmethod(recv2_class, (t_method)recv2_set, gensym("@"),A_DEFSYMBOL, 0);
+ class_sethelpsymbol(recv2_class, gensym("xgui/help_recv2"));
+}
diff --git a/xgui/xgui-lib/replace_selector.c b/xgui/xgui-lib/replace_selector.c new file mode 100644 index 00000000..3c78aa6b --- /dev/null +++ b/xgui/xgui-lib/replace_selector.c @@ -0,0 +1,60 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* code for replace_selector pd class */
+
+#include "m_pd.h"
+#include <string.h>
+
+typedef struct s_pd_obj_replace_selector
+{
+ t_object x_obj;
+ t_symbol *selector ;
+} t_pd_obj_replace_selector;
+
+
+void replace_selector_help(t_pd_obj_replace_selector *x)
+{
+ post(" ");
+ post("replace_selector v001");
+ post("+ selector list :");
+ post("++ help : this help !!!");
+ post("++ anything : will return anything with a diferent selector");
+}
+
+void replace_selector_any_method(t_pd_obj_replace_selector *x,t_symbol *s, int argc, t_atom *argv)
+{
+ t_atom *my_message = (t_atom *)getbytes(argc * sizeof(t_atom));
+ memcpy(my_message, argv, argc * sizeof(t_atom));
+ outlet_anything(x->x_obj.ob_outlet,x->selector, argc,my_message);
+ freebytes(my_message, argc * sizeof(t_atom));
+}
+
+void replace_selector_set2add(t_pd_obj_replace_selector *x, t_symbol *s)
+{
+ x->selector = s ;
+}
+
+void replace_selector_free(void) { }
+
+t_class *replace_selector_class;
+
+void *replace_selector_new(t_symbol *s)
+{
+ t_pd_obj_replace_selector *x = (t_pd_obj_replace_selector *)pd_new(replace_selector_class);
+ x->selector = s;
+ outlet_new(&x->x_obj, &s_float);
+ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("s2add"));
+ return (void *)x;
+}
+
+void replace_selector_setup(void)
+{
+ replace_selector_class = class_new(gensym("replace_selector"), (t_newmethod)replace_selector_new,(t_method)replace_selector_free, sizeof( t_pd_obj_replace_selector), 0,A_DEFSYMBOL, 0);
+ class_addanything(replace_selector_class, replace_selector_any_method);
+ class_addmethod(replace_selector_class, (t_method)replace_selector_set2add, gensym("s2add"), A_SYMBOL, 0);
+ class_addmethod(replace_selector_class, (t_method)replace_selector_help, gensym("help"), 0);
+ class_sethelpsymbol(replace_selector_class, gensym("xgui/help_replace_selector"));
+}
+
diff --git a/xgui/xgui-lib/seg.c b/xgui/xgui-lib/seg.c new file mode 100644 index 00000000..a7a0566e --- /dev/null +++ b/xgui/xgui-lib/seg.c @@ -0,0 +1,90 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* code for seg pd class NOT WORKING YET*/
+
+#include "m_pd.h"
+#include "g_canvas.h"
+#include "t_tk.h"
+
+typedef struct s_pd_obj_seg
+{
+ t_object t_ob;
+ t_symbol *seg_name;
+ t_float *posx;
+ t_float *posy;
+ t_float *x1;
+ t_float *y1;
+ t_float *x2;
+ t_float *y2;
+ t_float *width;
+ t_symbol *color;
+} t_seg;
+
+typedef struct s_seg
+{
+ t_object t_ob;
+ t_symbol* seg_name;
+ t_float posx;
+ t_float posy;
+ t_float x1;
+ t_float y1;
+ t_float x2;
+ t_float y2;
+ t_float width;
+ t_symbol color;
+} t_seg;
+
+void seg_help(t_seg *x)
+{
+ post(" ");
+ post("seg v001");
+ post("+ symbol list :");
+ post("++ help : this help !!!");
+ post(" ");
+}
+
+void seg_width(t_seg *x, t_floatarg f)
+{
+ post("seg: width %f",f);
+ t_atom my_atom ;
+ t_atom *my_pointer = &my_atom;
+ SETFLOAT(my_pointer, *f);
+ outlet_anything(x->x_obj.ob_outlet, gensym("!width"), 1,my_pointer);
+}
+
+
+void seg_pos(t_seg *x, t_floatarg f1, t_floatarg f2)
+{
+ outlet_float(x->x_outlet1, (t_float)f1+(t_float)f2);
+}
+
+void seg_free(void)
+{
+ post("seg_free");
+}
+
+t_class *seg_class;
+
+void *seg_new(void)
+{
+ t_seg *x = (t_seg *)pd_new(seg_class);
+ post("seg created");
+ x->posx = 0; x->posy = 0;
+ x->x1 = 10; x->y1 = 10;
+ x->x1 = 20; x->y1 = 20;
+ x->x_outlet1 = outlet_new(&x->t_ob, &s_float);
+ return (void *)x;
+}
+
+void seg_setup(void)
+{
+ post("seg_setup");
+ seg_class = class_new(gensym("seg"), (t_newmethod)seg_new,(t_method)seg_free, sizeof(t_seg), 0, A_GIMME, 0);
+ class_addmethod(seg_class, (t_method)seg_width, gensym("width"),A_FLOAT, 0);
+ class_addmethod(seg_class, (t_method)seg_pos, gensym("pos"),A_FLOAT,A_FLOAT, 0);
+ class_addmethod(seg_class, (t_method)seg_help, gensym("help"), 0);
+ class_sethelpsymbol(seg_class, gensym("xgui/help_seg"));
+}
+
diff --git a/xgui/xgui-lib/send2.c b/xgui/xgui-lib/send2.c new file mode 100644 index 00000000..a58b87c6 --- /dev/null +++ b/xgui/xgui-lib/send2.c @@ -0,0 +1,67 @@ +/* Copyright (c) 2002 Damien HENRY.
+* For information on usage and redistribution, and for a DISCLAIMER OF ALL
+* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
+
+/* ------------------------ based on remote --------------------------------- */
+/* */
+/* Send data to receive obejct <name>. */
+/* Written by Olaf Matthes (olaf.matthes@gmx.de) */
+
+#include "m_pd.h"
+
+/*dh :
+#include <string.h>
+#include <stdio.h> */
+
+#define MAX_REC 64 /* maximum number of receive objects */
+#define MAX_ARG 32 /* maximum number of arguments to pass on */
+
+static t_class *send2_class;
+
+/*dh: I've removed the static *char */
+
+typedef struct _send2
+{
+ t_object x_obj;
+} t_send2;
+
+ /* send 'anything' to receiver */
+static void send2_anything(t_send2 *x, t_symbol *s, int argc, t_atom *argv)
+{
+ int i;
+ t_atom av[MAX_ARG]; /* the 'new' t_atom without first element */
+ t_int ac = argc - 1; /* the 'new' number of arguments */
+
+ if(argc < 1) /* need <name> <data> */
+ {
+ post("send2: too few arguments!");
+ return;
+ }
+ if(ac > MAX_ARG)
+ {
+ post("send2: too many arguments!");
+ return;
+ }
+
+ for(i = 1; i < argc; i++)
+ {
+ av[i - 1] = argv[i]; /* just copy, don't care about types */
+ }
+ /* send only argument-part to receivers */
+ if (s->s_thing) pd_forwardmess(s->s_thing, argc, argv);
+}
+
+static void *send2_new(void)
+{
+ t_send2 *x = (t_send2 *)pd_new(send2_class);
+ /*dh: I've removed the post here */
+ return (x);
+}
+
+void send2_setup(void)
+{
+ send2_class = class_new(gensym("send2"), (t_newmethod)send2_new, 0,
+ sizeof(t_send2), 0, 0);
+ class_addanything(send2_class, send2_anything);
+ class_sethelpsymbol(send2_class, gensym("xgui/help_send2.pd"));
+}
diff --git a/xgui/xgui-lib/test_xgui_lib.pd b/xgui/xgui-lib/test_xgui_lib.pd new file mode 100644 index 00000000..dc280859 --- /dev/null +++ b/xgui/xgui-lib/test_xgui_lib.pd @@ -0,0 +1,134 @@ +#N canvas 30 89 933 636 10;
+#X obj 60 123 seg;
+#X msg 92 114 width \$1;
+#X floatatom 92 91 5 0 0;
+#X obj 60 146 print seg;
+#X msg 22 91 pos 11 13;
+#X floatatom 29 58 5 0 0;
+#X msg 128 233 help;
+#X msg 89 10 pos 1 13;
+#X floatatom 235 93 5 0 0;
+#X msg 235 70 bang;
+#X msg 324 88 mult 2 \, bang;
+#X msg 324 134 sub 1 \, bang;
+#X msg 324 157 div 2 \, bang;
+#X msg 324 111 inv \, bang;
+#X msg 324 65 add 1 \, bang;
+#X msg 421 68 add 1 \, if >= 10 0 \, bang;
+#X msg 422 128 \$1 \, if < 0 0 \, if >= 10 10 \, bang;
+#X floatatom 422 105 5 0 0;
+#X msg 235 24 help;
+#X floatatom 324 19 5 0 0;
+#X msg 324 42 !x \$1 \, ?x;
+#X floatatom 422 151 5 0 0;
+#X floatatom 425 266 5 0 0;
+#X msg 425 289 !x \$1 \, ?x;
+#X msg 498 270 bang;
+#X obj 235 210 number my_first_number;
+#X msg 565 241 set my_first_number;
+#X obj 425 312 number my_second_number;
+#X msg 565 264 get my_first_number \, bang;
+#X floatatom 422 220 5 0 0;
+#X msg 251 273 do_if => 10 ok;
+#X obj 244 241 print;
+#X obj 422 197 x my_first_number;
+#X msg 235 47 post;
+#X msg 643 211 bound 0;
+#X obj 425 335 print;
+#X msg 422 174 \$1 \, bang;
+#X msg 575 166 subspace 0 1 100 10;
+#X msg 564 202 bound 1 10;
+#X msg 381 20 bound 1 10;
+#X obj 41 351 concat test;
+#X obj 40 381 print;
+#X msg 33 274 1 2 3;
+#X floatatom 93 257 5 0 0;
+#X symbolatom 12 244 10 0 0;
+#X msg 75 306 bonjour truc et bidule;
+#X msg 148 274 symbol alors;
+#X obj 485 538 oname2l;
+#X obj 486 574 print on2l;
+#X msg 540 537 help;
+#X msg 485 510 symbol */test1/test2;
+#X obj 308 540 a2s;
+#X msg 308 518 list * / test / test;
+#X obj 309 562 print a2s;
+#X msg 306 492 list test 1 2 3;
+#X obj 523 397 print;
+#X obj 525 372 recv2 test;
+#X obj 614 400 send test;
+#X msg 617 371 foo;
+#X msg 528 350 test?;
+#X msg 586 336 @ truc;
+#X msg 680 376 test;
+#X obj 685 402 send truc;
+#X msg 637 336 @ test;
+#X msg 161 443 help;
+#X obj 73 591 print;
+#X msg 66 484 1 2 3;
+#X floatatom 126 467 5 0 0;
+#X symbolatom 45 454 10 0 0;
+#X msg 108 516 bonjour truc et bidule;
+#X msg 181 484 symbol alors;
+#X obj 74 561 replace_selector test;
+#X obj 799 411 send2;
+#X msg 819 363 test 2;
+#X msg 756 358 truc 1;
+#X connect 2 0 1 0;
+#X connect 6 0 40 0;
+#X connect 8 0 25 0;
+#X connect 9 0 25 0;
+#X connect 10 0 25 0;
+#X connect 11 0 25 0;
+#X connect 12 0 25 0;
+#X connect 13 0 25 0;
+#X connect 14 0 25 0;
+#X connect 15 0 25 0;
+#X connect 16 0 25 0;
+#X connect 17 0 16 0;
+#X connect 18 0 25 0;
+#X connect 19 0 20 0;
+#X connect 20 0 25 0;
+#X connect 21 0 36 0;
+#X connect 22 0 23 0;
+#X connect 23 0 27 0;
+#X connect 24 0 27 0;
+#X connect 25 0 31 0;
+#X connect 26 0 27 0;
+#X connect 27 0 35 0;
+#X connect 28 0 27 0;
+#X connect 30 0 25 0;
+#X connect 32 0 29 0;
+#X connect 33 0 25 0;
+#X connect 34 0 32 0;
+#X connect 36 0 32 0;
+#X connect 37 0 32 0;
+#X connect 38 0 32 0;
+#X connect 39 0 25 0;
+#X connect 40 0 41 0;
+#X connect 42 0 40 0;
+#X connect 43 0 40 0;
+#X connect 44 0 40 0;
+#X connect 45 0 40 0;
+#X connect 46 0 40 1;
+#X connect 47 0 48 0;
+#X connect 49 0 47 0;
+#X connect 50 0 47 0;
+#X connect 51 0 53 0;
+#X connect 52 0 51 0;
+#X connect 54 0 51 0;
+#X connect 56 0 55 0;
+#X connect 58 0 57 0;
+#X connect 59 0 56 0;
+#X connect 60 0 56 0;
+#X connect 61 0 62 0;
+#X connect 63 0 62 0;
+#X connect 64 0 71 0;
+#X connect 66 0 71 0;
+#X connect 67 0 71 0;
+#X connect 68 0 71 0;
+#X connect 69 0 71 0;
+#X connect 70 0 71 1;
+#X connect 71 0 65 0;
+#X connect 73 0 72 0;
+#X connect 74 0 72 0;
diff --git a/xgui/xgui-lib/try.sh b/xgui/xgui-lib/try.sh new file mode 100644 index 00000000..707f6bab --- /dev/null +++ b/xgui/xgui-lib/try.sh @@ -0,0 +1 @@ +../../bin/pd -open ./test_xgui_lib.pd -verbose
diff --git a/xgui/xgui-lib/xgui_lib.c b/xgui/xgui-lib/xgui_lib.c new file mode 100644 index 00000000..62940bc2 --- /dev/null +++ b/xgui/xgui-lib/xgui_lib.c @@ -0,0 +1,17 @@ +/* xgui */
+
+#include "m_pd.h"
+#include "seg.c"
+#include "number.c"
+
+void seg_setup();
+void number_setup();
+
+void xgui_lib_setup(void)
+{
+ post("++ Xgui - Damien HENRY");
+ post("++ v0.08");
+ seg_setup();
+ number_setup();
+}
+
|