From d3ee59e709bbc51fea444584fed70c7fb084fd45 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 30 Mar 2004 04:18:55 +0000 Subject: sonogram 0.12 svn path=/trunk/externals/unauthorized/; revision=1515 --- sonogram~/sonogram~.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'sonogram~/sonogram~.c') diff --git a/sonogram~/sonogram~.c b/sonogram~/sonogram~.c index 8c1d989..a0b8472 100644 --- a/sonogram~/sonogram~.c +++ b/sonogram~/sonogram~.c @@ -37,9 +37,7 @@ #include #include #include -#ifndef MACOSX #include -#endif #include #include #ifdef UNIX @@ -98,7 +96,7 @@ static int ignorevisible=1; // ignore visible test #define THREAD_SLEEP_TIME 100000 // 100000 us = 100 ms -static char *sonogram_version = "sonogram~: version 0.11, written by Yves Degoyon (ydegoyon@free.fr)"; +static char *sonogram_version = "sonogram~: version 0.12, written by Yves Degoyon (ydegoyon@free.fr)"; static t_class *sonogram_class; t_widgetbehavior sonogram_widgetbehavior; @@ -2018,6 +2016,7 @@ void sonogram_tilde_setup(void) post(sonogram_version); sonogram_class = class_new(gensym("sonogram~"), (t_newmethod)sonogram_new, (t_method)sonogram_free, sizeof(t_sonogram), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); + class_sethelpsymbol( sonogram_class, gensym("sonogram~.pd") ); // set callbacks sonogram_widgetbehavior.w_getrectfn = sonogram_getrect; @@ -2027,18 +2026,14 @@ void sonogram_tilde_setup(void) sonogram_widgetbehavior.w_deletefn = sonogram_delete; sonogram_widgetbehavior.w_visfn = sonogram_vis; sonogram_widgetbehavior.w_clickfn = sonogram_click; - /* - * : As of 0.37, pd does not have these last - * two elements in t_widgetbehavoir anymore. - * see pd/src/notes.txt: - * savefunction and dialog into class structure - */ -#if PD_MINOR_VERSION < 37 || !defined(PD_MINOR_VERSION) + + +#if PD_MINOR_VERSION >= 37 + class_setpropertiesfn(sonogram_class, NULL); + class_setsavefn(sonogram_class, sonogram_save); +#else sonogram_widgetbehavior.w_propertiesfn = NULL; sonogram_widgetbehavior.w_savefn = sonogram_save; -#else - class_setpropertiesfn(sonogram_class, NULL); - class_setsavefn(sonogram_class, &sonogram_save); #endif CLASS_MAINSIGNALIN( sonogram_class, t_sonogram, x_f ); -- cgit v1.2.1