Update of /cvsroot/pure-data/externals/grill/flext/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2336/source
Modified Files: flattr.cpp flbase.cpp flbase.h fllib.cpp Log Message: ""
Index: flbase.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flbase.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** flbase.cpp 20 Mar 2004 03:23:11 -0000 1.15 --- flbase.cpp 3 Apr 2004 02:21:04 -0000 1.16 *************** *** 97,101 **** }
! const t_symbol *flext_obj::GetParamSym(const t_symbol *sym,t_canvas *c) { #if FLEXT_SYS == FLEXT_SYS_PD --- 97,101 ---- }
! bool flext_obj::GetParamSym(t_atom &dst,const t_symbol *sym,t_canvas *c) { #if FLEXT_SYS == FLEXT_SYS_PD *************** *** 104,107 **** --- 104,108 ---- 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] != '$') { *************** *** 109,116 **** strcpy(tmp,s); tmp[0] = '$'; ! return canvas_realizedollar(c,const_cast<t_symbol *>(MakeSymbol(tmp))); } else ! return canvas_realizedollar(c,const_cast<t_symbol *>(sym)); } else --- 110,127 ---- strcpy(tmp,s); tmp[0] = '$'; ! res = canvas_realizedollar(c,const_cast<t_symbol *>(MakeSymbol(tmp))); } else ! 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 *************** *** 118,122 **** #pragma message("Not implemented") #endif ! return sym; }
--- 129,134 ---- #pragma message("Not implemented") #endif ! SetSymbol(dst,sym); ! return true; }
Index: flattr.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flattr.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** flattr.cpp 6 Mar 2004 03:25:48 -0000 1.21 --- flattr.cpp 3 Apr 2004 02:21:04 -0000 1.22 *************** *** 239,243 **** case a_symbol: if(argc == 1 && IsSymbol(argv[0])) { ! any.st = const_cast<t_symbol *>(GetParamSym(GetSymbol(argv[0]),thisCanvas())); ((methfun_1)a->fun)(this,any); } --- 239,245 ---- case a_symbol: if(argc == 1 && IsSymbol(argv[0])) { ! // \todo shall we analyze the patcher args???? ! // any.st = const_cast<t_symbol *>(GetParamSym(GetSymbol(argv[0]),thisCanvas())); ! any.st = GetSymbol(argv[0]); ((methfun_1)a->fun)(this,any); } *************** *** 255,259 **** for(int i = 0; i < argc; ++i) if(IsSymbol(argv[i])) ! SetSymbol(la[i],GetParamSym(GetSymbol(argv[i]),thisCanvas())); else la[i] = argv[i]; --- 257,261 ---- for(int i = 0; i < argc; ++i) if(IsSymbol(argv[i])) ! GetParamSym(la[i],GetSymbol(argv[i]),thisCanvas()); else la[i] = argv[i];
Index: flbase.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flbase.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** flbase.h 20 Mar 2004 03:23:11 -0000 1.23 --- flbase.h 3 Apr 2004 02:21:04 -0000 1.24 *************** *** 259,263 ****
//! Convert $0 or #0 symbol into appropriate value ! static const t_symbol *GetParamSym(const t_symbol *s,t_canvas *c);
//! Get the canvas arguments --- 259,263 ----
//! Convert $0 or #0 symbol into appropriate value ! static bool GetParamSym(t_atom &dst,const t_symbol *s,t_canvas *c);
//! Get the canvas arguments
Index: fllib.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/fllib.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** fllib.cpp 6 Mar 2004 03:25:48 -0000 1.22 --- fllib.cpp 3 Apr 2004 02:21:04 -0000 1.23 *************** *** 293,296 **** --- 293,298 ----
+ #define NEWARGS 256 // must be larger than FLEXT_NEWARGS = 5 + typedef flext_obj *(*libfun)(int,t_atom *);
*************** *** 311,315 **** if(lo) { bool ok = true; ! t_atom args[FLEXT_MAXNEWARGS];
int argc = _argc_; --- 313,317 ---- if(lo) { bool ok = true; ! t_atom args[NEWARGS];
int argc = _argc_; *************** *** 339,343 **** break; case FLEXTTPN_SYM: ! if(IsSymbol(argv[i])) SetSymbol(args[i],GetParamSym(GetSymbol(argv[i]),NULL)); else ok = false; break; --- 341,348 ---- break; case FLEXTTPN_SYM: ! // \todo shall we analyze the patcher args????... should already be done! ! if(IsSymbol(argv[i])) ! // SetSymbol(args[i],GetParamSym(GetSymbol(argv[i]),NULL)); ! args[i] = argv[i]; else ok = false; break; *************** *** 368,374 **** #error #endif - // post("NEWINST CLID %p",clid);
! flext_obj::m_holder = obj; flext_obj::m_holdname = s; flext_obj::m_holdattr = lo->attr; --- 373,378 ---- #error #endif
! flext_obj::m_holder = obj; flext_obj::m_holdname = s; flext_obj::m_holdattr = lo->attr; *************** *** 376,391 **** // get actual flext object (newfun calls "new flext_obj()") if(lo->argc >= 0) - // for interpreted arguments (patcher parameters have already been converted) obj->data = lo->newfun(lo->argc,args); ! else { ! // convert eventual patcher parameters ! for(int i = 0; i < argc; ++i) ! if(IsSymbol(argv[i])) ! SetSymbol(args[i],GetParamSym(GetSymbol(argv[i]),NULL)); ! else ! args[i] = argv[i]; ! ! obj->data = lo->newfun(argc,args); ! } flext_obj::m_holder = NULL; --- 380,386 ---- // get actual flext object (newfun calls "new flext_obj()") if(lo->argc >= 0) obj->data = lo->newfun(lo->argc,args); ! else ! obj->data = lo->newfun(argc,argv); flext_obj::m_holder = NULL; *************** *** 398,404 ****
if(ok) { ! // store creation args for attribute initialization (inside flext_base::Init()) ! flext_obj::m_holdaargc = _argc_-argc; ! flext_obj::m_holdaargv = argv+argc;
// call virtual init function --- 393,408 ----
if(ok) { ! if(lo->attr) { ! // DON'T convert eventual patcher args here... this is done by the actual attribute stuff ! // so that the initial $- or #- be preserved! ! ! // store creation args for attribute initialization (inside flext_base::Init()) ! flext_obj::m_holdaargc = _argc_-argc; ! flext_obj::m_holdaargv = argv+argc; ! } ! else { ! flext_obj::m_holdaargc = 0; ! flext_obj::m_holdaargv = NULL; ! }
// call virtual init function