From de86cb7754d773a2dba3ae92eb0dfc4cb9d77cbd Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 29 Aug 2003 13:53:51 +0000 Subject: imported latest version 1.4 direct from Olaf svn path=/trunk/externals/maxlib/; revision=898 --- src/velocity.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/velocity.c') diff --git a/src/velocity.c b/src/velocity.c index a01aae5..7a003d0 100644 --- a/src/velocity.c +++ b/src/velocity.c @@ -83,19 +83,30 @@ static void *velocity_new(t_floatarg f) { t_velocity *x = (t_velocity *)pd_new(velocity_class); x->x_out = outlet_new(&x->x_ob, gensym("float")); -#ifndef MAXLIB - post(version); -#endif x->x_lasttime = clock_getlogicaltime(); return (void *)x; } +#ifndef MAXLIB void velocity_setup(void) { velocity_class = class_new(gensym("velocity"), (t_newmethod)velocity_new, (t_method)velocity_free, sizeof(t_velocity), 0, A_DEFFLOAT, 0); +#else +void maxlib_velocity_setup(void) +{ + velocity_class = class_new(gensym("maxlib_velocity"), (t_newmethod)velocity_new, + (t_method)velocity_free, sizeof(t_velocity), 0, A_DEFFLOAT, 0); + class_addcreator((t_newmethod)velocity_new, gensym("velocity"), A_DEFFLOAT, 0); +#endif class_addfloat(velocity_class, velocity_float); class_addbang(velocity_class, velocity_bang); +#ifndef MAXLIB + class_sethelpsymbol(velocity_class, gensym("help-velocity.pd")); + post(version); +#else + class_sethelpsymbol(velocity_class, gensym("maxlib/help-velocity.pd")); +#endif } -- cgit v1.2.1