From: Paul Brossier Date: Thu, 15 May 2008 18:20:06 +0000 (+0200) Subject: plugins/puredata/aubio_setup.c: add aubio_new function to clean up loading of the... X-Git-Tag: bzr2git~391 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9bfecce3969604d57b4ec90e138c675b67e75221;p=aubio.git plugins/puredata/aubio_setup.c: add aubio_new function to clean up loading of the aubio external with [aubio], indent, bump version number --- diff --git a/plugins/puredata/aubio_setup.c b/plugins/puredata/aubio_setup.c index 2c3f848a..31f474ae 100644 --- a/plugins/puredata/aubio_setup.c +++ b/plugins/puredata/aubio_setup.c @@ -1,8 +1,16 @@ #include -char aubio_version[] = "aubio external for pd, version 0.1"; +char aubio_version[] = "aubio external for pd, version 0.2"; +static t_class *aubio_class; + +typedef struct aubio +{ + t_object x_ob; +} t_aubio; + +void *aubio_new (void); void aubio_setup (void); extern void aubioonset_tilde_setup (void); extern void aubiotempo_tilde_setup (void); @@ -10,12 +18,20 @@ extern void aubiotss_tilde_setup (void); extern void aubioquiet_tilde_setup (void); extern void aubiopitch_tilde_setup (void); +void *aubio_new (void) +{ + t_aubio *x = (t_aubio *)pd_new(aubio_class); + return (void *)x; +} + void aubio_setup (void) { - post(aubio_version); - aubioonset_tilde_setup(); - aubiotempo_tilde_setup(); - aubiotss_tilde_setup(); - aubioquiet_tilde_setup(); - aubiopitch_tilde_setup(); + post(aubio_version); + aubioonset_tilde_setup(); + aubiotempo_tilde_setup(); + aubiotss_tilde_setup(); + aubioquiet_tilde_setup(); + aubiopitch_tilde_setup(); + aubio_class = class_new(gensym("aubio"), (t_newmethod)aubio_new, 0, + sizeof(t_aubio), 0, 0); }