aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flbase.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-04-03 02:21:04 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-04-03 02:21:04 +0000
commit079bcdc0e050c002b77e4bf86e919fed44f6a7db (patch)
treedec2e5220e94123664ff75da8d9e50f5dff85969 /externals/grill/flext/source/flbase.cpp
parent94fcd3d8d61c431778f51ba91f86e1a97b7fc813 (diff)
""
svn path=/trunk/; revision=1540
Diffstat (limited to 'externals/grill/flext/source/flbase.cpp')
-rw-r--r--externals/grill/flext/source/flbase.cpp20
1 files changed, 16 insertions, 4 deletions
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<t_symbol *>(MakeSymbol(tmp)));
+ res = canvas_realizedollar(c,const_cast<t_symbol *>(MakeSymbol(tmp)));
}
else
- return canvas_realizedollar(c,const_cast<t_symbol *>(sym));
+ res = canvas_realizedollar(c,const_cast<t_symbol *>(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;
}