From 079bcdc0e050c002b77e4bf86e919fed44f6a7db Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 3 Apr 2004 02:21:04 +0000 Subject: "" svn path=/trunk/; revision=1540 --- externals/grill/flext/source/flbase.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'externals/grill/flext/source/flbase.cpp') diff --git a/externals/grill/flext/source/flbase.cpp b/externals/grill/flext/source/flbase.cpp index 9b2d5506..72e07999 100644 --- a/externals/grill/flext/source/flbase.cpp +++ b/externals/grill/flext/source/flbase.cpp @@ -96,28 +96,40 @@ void flext_obj::DefineHelp(t_classid c,const char *ref,const char *dir,bool addt #endif } -const t_symbol *flext_obj::GetParamSym(const t_symbol *sym,t_canvas *c) +bool flext_obj::GetParamSym(t_atom &dst,const t_symbol *sym,t_canvas *c) { #if FLEXT_SYS == FLEXT_SYS_PD if(!c) c = canvas_getcurrent(); const char *s = GetString(sym); if((s[0] == '$' || s[0] == '#') && isdigit(s[1])) { + const t_symbol *res; // patcher parameter detected... get value! if(s[0] != '$') { char tmp[MAXPDSTRING]; strcpy(tmp,s); tmp[0] = '$'; - return canvas_realizedollar(c,const_cast(MakeSymbol(tmp))); + res = canvas_realizedollar(c,const_cast(MakeSymbol(tmp))); } else - return canvas_realizedollar(c,const_cast(sym)); + res = canvas_realizedollar(c,const_cast(sym)); + + // check for number + const char *c = GetString(res); + while(*c && (isdigit(*c) || *c == '.')) ++c; + + if(!*c) + SetFloat(dst,(float)atof(GetString(res))); + else + SetSymbol(dst,res); + return true; } else #else #pragma message("Not implemented") #endif - return sym; + SetSymbol(dst,sym); + return true; } -- cgit v1.2.1