From 9e5b1dbdc05765ffba00e61bb5a0518c3cda9336 Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Sun, 22 May 2005 20:48:00 +0000 Subject: removed obsolete externals, updated for win compilation svn path=/trunk/externals/ggee/; revision=3070 --- signal/rtin~.c | 81 ---------------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 signal/rtin~.c (limited to 'signal/rtin~.c') diff --git a/signal/rtin~.c b/signal/rtin~.c deleted file mode 100755 index 5338137..0000000 --- a/signal/rtin~.c +++ /dev/null @@ -1,81 +0,0 @@ -/* (C) Guenter Geiger */ - -#include -#include -#include -#include -#include - -#ifdef NT -#include -void gettimeofday(struct timeval* t,void* timezone) -{ struct timeb timebuffer; - ftime( &timebuffer ); - t->tv_sec=timebuffer.time; - t->tv_usec=1000*timebuffer.millitm; -} -#endif - -#include "math.h" -#include - - -/* ----------------------------- rtin ----------------------------- */ -static t_class *rtin_class; - - -#define INVTWOPI 0.15915494f - -typedef struct _rtin -{ - t_object x_obj; - t_int fd; - t_int usec; -} t_rtin; - -static void *rtin_new(t_symbol *s, int argc, t_atom *argv) -{ - t_rtin *x = (t_rtin *)pd_new(rtin_class); - /* inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);*/ - outlet_new(&x->x_obj, &s_float); - - x->usec=0; - x->fd = open("/dev/midi00",O_RDWR|O_NDELAY); - - return (x); - -} - -t_int *rtin_perform(t_int *w) -{ - struct timeval tv; - long diff; - t_rtin* x = (t_rtin *)(w[1]); -// int n = (int)(w[2]); - char c; - - - if (read(x->fd,&c,1) == 1) { - gettimeofday(&tv, NULL); - diff = tv.tv_usec - x->usec; - if (diff < 0) diff+=1000000; - if (diff > 10000) outlet_float(x->x_obj.ob_outlet,diff*0.001); - x->usec=tv.tv_usec; - } - - - return (w+2); -} - -static void rtin_dsp(t_rtin *x, t_signal **sp) -{ - dsp_add(rtin_perform, 1, x); -} - -void rtin_tilde_setup(void) -{ - rtin_class = class_new(gensym("rtin~"), (t_newmethod)rtin_new, 0, - sizeof(t_rtin), 0, A_GIMME, 0); - class_addmethod(rtin_class, nullfn, gensym("signal"), 0); - class_addmethod(rtin_class, (t_method)rtin_dsp, gensym("dsp"), 0); -} -- cgit v1.2.1