diff options
Diffstat (limited to 'cupd')
-rw-r--r-- | cupd/cupd-help.pd | 19 | ||||
-rw-r--r-- | cupd/cupd.c | 68 | ||||
-rw-r--r-- | cupd/makefile | 105 |
3 files changed, 0 insertions, 192 deletions
diff --git a/cupd/cupd-help.pd b/cupd/cupd-help.pd deleted file mode 100644 index 2bd8d67..0000000 --- a/cupd/cupd-help.pd +++ /dev/null @@ -1,19 +0,0 @@ -#N canvas 0 0 450 300 10; -#X obj 87 161 cupd; -#X obj 87 94 metro 100; -#X obj 87 56 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; -#X obj 110 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 -1; -#X floatatom 87 201 5 0 0 0 - - -; -#X msg 197 102 160; -#X text 109 59 bang counts; -#X text 70 14 cupd counts up ^_^ and down _^_; -#X text 223 101 float sets next; -#X text 132 135 != 0 counts down \, 0 counts up; -#X text 69 235 aaaaah \, simplicity!; -#X connect 0 0 4 0; -#X connect 1 0 0 0; -#X connect 2 0 1 0; -#X connect 3 0 0 1; -#X connect 5 0 0 0; diff --git a/cupd/cupd.c b/cupd/cupd.c deleted file mode 100644 index 66d42c0..0000000 --- a/cupd/cupd.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "m_pd.h" - -t_class *cupd_class; - -typedef struct _cupd -{ - t_object x_obj; - t_int f_count; - t_float f_dir, f_prevdir, firstbang, floatset; - t_outlet *count; -} t_cupd; - -void cupd_float(t_cupd *y, t_floatarg f) -{ - y->f_count = f; - y->floatset = 1; -} - -void cupd_bang(t_cupd *y) -{ - int flag = y->f_dir != y->f_prevdir ? 1 : 0; - if (flag==1&&y->firstbang==0&&y->floatset==0) - { - y->f_count += y->f_dir == 0 ? 2 : -2; - outlet_float(y->count, y->f_count); - y->f_count += y->f_dir == 0 ? 1 : -1; - } - else - { - outlet_float(y->count, y->f_count); - y->f_count += y->f_dir == 0 ? 1 : -1; - y->firstbang = y->floatset = 0; - } - y->f_prevdir = y->f_dir; -} - -void cupd_setbang(t_cupd *y, t_floatarg f) -{ - y->f_count = f; - outlet_float(y->count, y->f_count); - y->f_count += y->f_dir == 0 ? 1 : -1; - y->firstbang = y->floatset = 0; - y->f_prevdir = y->f_dir; -} - -void *cupd_new(t_floatarg f) -{ - t_cupd *y = (t_cupd *)pd_new(cupd_class); - y->f_dir = f; - y->f_count = 0; - y->firstbang = 1; - y->floatset = 0; - floatinlet_new(&y->x_obj, &y->f_dir); - y->count = outlet_new(&y->x_obj, gensym("float")); - return(void *)y; -} - -void cupd_setup(void) -{ - cupd_class = class_new(gensym("cupd"), - (t_newmethod)cupd_new, - 0, sizeof(t_cupd), - 0, A_DEFFLOAT, 0); - post("cupd counts up ^_^ and down _^_"); - - class_addbang(cupd_class, cupd_bang); - class_addfloat(cupd_class, cupd_float); - class_addmethod(cupd_class, (t_method)cupd_setbang, gensym("setbang"), A_DEFFLOAT, 0);} diff --git a/cupd/makefile b/cupd/makefile deleted file mode 100644 index 52abb12..0000000 --- a/cupd/makefile +++ /dev/null @@ -1,105 +0,0 @@ -current: - echo make pd_linux, pd_nt, pd_irix5, pd_irix6 or pd_darwin, then make install - -clean: ; rm -f *.pd_* *.o - -# ----------------------- NT ----------------------- - -pd_nt: cupd.dll - -INSTALL_PREFIX="C:\pd\extra" -EXT=dll -.SUFFIXES: .obj .dll - -PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo -VC="D:\Program Files\Microsoft Visual Studio\Vc98" - -PDNTINCLUDE = /I. /I\tcl\include /I..\..\src /I$(VC)\include - -PDNTLDIR = $(VC)\lib -PDNTLIB = $(PDNTLDIR)\libc.lib \ - $(PDNTLDIR)\oldnames.lib \ - $(PDNTLDIR)\kernel32.lib \ - ..\..\bin\pd.lib - -.c.dll: - cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c - link /dll /export:$*_setup $*.obj $(PDNTLIB) - -# ----------------------- IRIX 5.x ----------------------- - -pd_irix5: cupd.pd_irix5 - -INSTALL_PREFIX=/usr/local -EXT=pd_irix5 -.SUFFIXES: .pd_irix5 - -SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2 - -SGIINCLUDE = -I/usr/local/include - -.c.pd_irix5: - cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c - ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o - rm $*.o - -# ----------------------- IRIX 5.x ----------------------- - -pd_irix6: cupd.pd_irix6 - -INSTALL_PREFIX=/usr/local -EXT=pd_irix6 -.SUFFIXES: .pd_irix6 - -SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2 - -SGIINCLUDE = -I/usr/local/include - -.c.pd_irix6: - cc $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c - ld -elf -shared -rdata_shared -o $*.pd_irix6 $*.o - rm $*.o - -# ----------------------- LINUX i386 ----------------------- - -pd_linux: cupd.pd_linux - -INSTALL_PREFIX=/usr/local -EXT=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/usr/local/include - -.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 - -# ----------------------- Mac OSX ----------------------- - -pd_darwin: cupd.pd_darwin - -INSTALL_PREFIX=/usr/local -EXT=pd_darwin -.SUFFIXES: .pd_darwin - -DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \ - -Wno-unused -Wno-parentheses -Wno-switch - -.c.pd_darwin: - cc $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c - cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o - rm -f $*.o - -# ---------------------------------------------- - -install:: - install -d $(INSTALL_PREFIX)/lib/pd/extra -# install -m 644 *.$(EXT) $(INSTALL_PREFIX)/lib/pd/externs - -install -m 644 cupd.$(EXT) $(INSTALL_PREFIX)/lib/pd/extra - install -m 644 *.pd $(INSTALL_PREFIX)/lib/pd/doc/5.reference |