From 0c9b89b1018eb7760708ee5b080cd96846861328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 2 Jun 2005 18:25:00 +0000 Subject: updated to release-1.16 svn path=/trunk/externals/iemlib/; revision=3102 --- src/iem_t3_lib/t3_timer.c | 110 +++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'src/iem_t3_lib/t3_timer.c') diff --git a/src/iem_t3_lib/t3_timer.c b/src/iem_t3_lib/t3_timer.c index c52a926..c6dc392 100644 --- a/src/iem_t3_lib/t3_timer.c +++ b/src/iem_t3_lib/t3_timer.c @@ -1,55 +1,55 @@ -/* For information on usage and redistribution, and for a DISCLAIMER OF ALL -* WARRANTIES, see the file, "LICENSE.txt," in this distribution. - -iem_t3_lib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2003 */ - -#ifdef NT -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4305 ) -#endif - -#include "m_pd.h" -#include "iemlib.h" -#include -#include -#include - -/* -------------------------- t3_timer ------------------------------ */ -static t_class *t3_timer_class; - -typedef struct _t3_timer -{ - t_object x_obj; - double x_settime; - double x_t3_off; -} t_t3_timer; - -static void t3_timer_float(t_t3_timer *x, t_float t3_bang) -{ - x->x_settime = (double)clock_getsystime(); - x->x_t3_off = (double)t3_bang; -} - -static void t3_timer_ft1(t_t3_timer *x, t_float t3_bang) -{ - outlet_float(x->x_obj.ob_outlet, clock_gettimesince(x->x_settime) - + (double)t3_bang - x->x_t3_off); -} - -static void *t3_timer_new(void) -{ - t_t3_timer *x = (t_t3_timer *)pd_new(t3_timer_class); - t3_timer_float(x, 0.0); - outlet_new(&x->x_obj, &s_float); - inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft1")); - return (x); -} - -void t3_timer_setup(void) -{ - t3_timer_class = class_new(gensym("t3_timer"), (t_newmethod)t3_timer_new, 0, - sizeof(t_t3_timer), 0, 0); - class_addfloat(t3_timer_class, t3_timer_float); - class_addmethod(t3_timer_class, (t_method)t3_timer_ft1, gensym("ft1"), A_FLOAT, 0); - class_sethelpsymbol(t3_timer_class, gensym("iemhelp/help-t3_timer")); -} +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL +* WARRANTIES, see the file, "LICENSE.txt," in this distribution. + +iem_t3_lib written by Gerhard Eckel, Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */ + +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +#include "m_pd.h" +#include "iemlib.h" +#include +#include +#include + +/* -------------------------- t3_timer ------------------------------ */ +static t_class *t3_timer_class; + +typedef struct _t3_timer +{ + t_object x_obj; + double x_settime; + double x_t3_off; +} t_t3_timer; + +static void t3_timer_float(t_t3_timer *x, t_float t3_bang) +{ + x->x_settime = (double)clock_getsystime(); + x->x_t3_off = (double)t3_bang; +} + +static void t3_timer_ft1(t_t3_timer *x, t_float t3_bang) +{ + outlet_float(x->x_obj.ob_outlet, clock_gettimesince(x->x_settime) + + (double)t3_bang - x->x_t3_off); +} + +static void *t3_timer_new(void) +{ + t_t3_timer *x = (t_t3_timer *)pd_new(t3_timer_class); + t3_timer_float(x, 0.0); + outlet_new(&x->x_obj, &s_float); + inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft1")); + return (x); +} + +void t3_timer_setup(void) +{ + t3_timer_class = class_new(gensym("t3_timer"), (t_newmethod)t3_timer_new, 0, + sizeof(t_t3_timer), 0, 0); + class_addfloat(t3_timer_class, t3_timer_float); + class_addmethod(t3_timer_class, (t_method)t3_timer_ft1, gensym("ft1"), A_FLOAT, 0); + class_sethelpsymbol(t3_timer_class, gensym("iemhelp/help-t3_timer")); +} -- cgit v1.2.1