Update of /cvsroot/pure-data/externals/grill/flext/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29779/source
Modified Files: flbase.h fllib.cpp flstdc.h flsupport.cpp flsupport.h Log Message: ""
Index: flstdc.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flstdc.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** flstdc.h 27 Mar 2004 03:22:14 -0000 1.21 --- flstdc.h 23 Apr 2004 02:32:55 -0000 1.22 *************** *** 3,7 **** flext - C++ layer for Max/MSP and pd (pure data) externals
! Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. --- 3,7 ---- flext - C++ layer for Max/MSP and pd (pure data) externals
! Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. *************** *** 78,81 **** --- 78,82 ---- #define A_FLINT A_FLOAT #define A_DEFFLINT A_DEFFLOAT + #define A_DEFSYMBOL A_DEFSYM
*************** *** 136,143 **** --- 137,152 ---- #endif
+ #ifndef A_DEFINT + #define A_DEFINT A_DEFLONG + #endif + #ifndef A_SYMBOL #define A_SYMBOL A_SYM #endif
+ #ifndef A_DEFSYMBOL + #define A_DEFSYMBOL A_DEFSYM + #endif +
#elif FLEXT_SYS == FLEXT_SYS_JMAX
Index: flbase.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flbase.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** flbase.h 3 Apr 2004 02:21:04 -0000 1.24 --- flbase.h 23 Apr 2004 02:32:55 -0000 1.25 *************** *** 3,7 **** flext - C++ layer for Max/MSP and pd (pure data) externals
! Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. --- 3,7 ---- flext - C++ layer for Max/MSP and pd (pure data) externals
! Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. *************** *** 412,418 **** --- 412,421 ---- #else #define FLEXTTPN_INT A_INT + #define FLEXTTPN_DEFINT A_DEFINT #endif #define FLEXTTPN_FLOAT A_FLOAT + #define FLEXTTPN_DEFFLOAT A_DEFFLOAT #define FLEXTTPN_SYM A_SYMBOL + #define FLEXTTPN_DEFSYM A_DEFSYMBOL #define FLEXTTPN_VAR A_GIMME #else *************** *** 423,426 **** --- 426,432 ---- #define FLEXTTPN_SYM 4 #define FLEXTTPN_VAR 5 + #define FLEXTTPN_DEFINT 6 + #define FLEXTTPN_DEFFLOAT 7 + #define FLEXTTPN_DEFSYM 8 #endif
*************** *** 429,432 **** --- 435,439 ---- #define CALLBTYPE_void void #define FLEXTTYPE_float FLEXTTPN_FLOAT + #define FLEXTTYPE_float0 FLEXTTPN_DEFFLOAT #define CALLBTYPE_float float #define FLEXTTYPE_t_float FLEXTTPN_FLOAT *************** *** 435,441 **** --- 442,450 ---- #if FLEXT_SYS == FLEXT_SYS_PD #define FLEXTTYPE_int FLEXTTPN_FLOAT + #define FLEXTTYPE_int0 FLEXTTPN_DEFFLOAT #define CALLBTYPE_int float #elif FLEXT_SYS == FLEXT_SYS_MAX || FLEXT_SYS == FLEXT_SYS_JMAX #define FLEXTTYPE_int FLEXTTPN_INT + #define FLEXTTYPE_int0 FLEXTTPN_DEFINT #define CALLBTYPE_int int #else *************** *** 444,449 ****
#define FLEXTTYPE_t_symptr FLEXTTPN_SYM #define CALLBTYPE_t_symptr t_symptr ! #define FLEXTTYPE_t_symtype FLEXTTPN_SYM #define CALLBTYPE_t_symtype t_symptr #define FLEXTTYPE_t_ptrtype FLEXTTPN_PTR --- 453,460 ----
#define FLEXTTYPE_t_symptr FLEXTTPN_SYM + #define FLEXTTYPE_t_symptr0 FLEXTTPN_DEFSYM #define CALLBTYPE_t_symptr t_symptr ! #define FLEXTTYPE_t_symtype FLEXTTYPE_t_symptr ! #define FLEXTTYPE_t_symtype0 FLEXTTYPE_t_symptr0 #define CALLBTYPE_t_symtype t_symptr #define FLEXTTYPE_t_ptrtype FLEXTTPN_PTR *************** *** 455,462 ****
#define ARGMEMBER_int(a) GetInt(a) #define ARGMEMBER_float(a) GetFloat(a) #define ARGMEMBER_t_symptr(a) GetSymbol(a) ! #define ARGMEMBER_t_symtype(a) GetSymbol(a) ! #define ARGCAST(arg,tp) ARGMEMBER_##tp(arg)
--- 466,477 ----
#define ARGMEMBER_int(a) GetInt(a) + #define ARGMEMBER_int0(a) ARGMEMBER_int(a) #define ARGMEMBER_float(a) GetFloat(a) + #define ARGMEMBER_float0(a) ARGMEMBER_float(a) #define ARGMEMBER_t_symptr(a) GetSymbol(a) ! #define ARGMEMBER_t_symptr0(a) ARGMEMBER_t_symptr(a) ! #define ARGMEMBER_t_symtype(a) ARGMEMBER_t_symptr(a) ! #define ARGMEMBER_t_symtype0(a) ARGMEMBER_t_symptr0(a) ! #define ARGCAST(a,tp) ARGMEMBER_##tp(a)
*************** *** 484,488 ****
#define REAL_NEW_1(NAME,NEW_CLASS,DSP,LIB, TYPE1) \ ! flext_obj *NEW_CLASS::__init__(int ,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1)); \ --- 499,503 ----
#define REAL_NEW_1(NAME,NEW_CLASS,DSP,LIB, TYPE1) \ ! flext_obj *NEW_CLASS::__init__(int,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1)); \ *************** *** 495,499 ****
#define REAL_NEW_2(NAME,NEW_CLASS,DSP,LIB, TYPE1,TYPE2) \ ! flext_obj *NEW_CLASS::__init__(int ,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1),ARGCAST(argv[1],TYPE2)); \ --- 510,514 ----
#define REAL_NEW_2(NAME,NEW_CLASS,DSP,LIB, TYPE1,TYPE2) \ ! flext_obj *NEW_CLASS::__init__(int,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1),ARGCAST(argv[1],TYPE2)); \ *************** *** 506,510 ****
#define REAL_NEW_3(NAME,NEW_CLASS,DSP,LIB, TYPE1, TYPE2, TYPE3) \ ! flext_obj *NEW_CLASS::__init__(int ,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1),ARGCAST(argv[1],TYPE2),ARGCAST(argv[2],TYPE3)); \ --- 521,525 ----
#define REAL_NEW_3(NAME,NEW_CLASS,DSP,LIB, TYPE1, TYPE2, TYPE3) \ ! flext_obj *NEW_CLASS::__init__(int,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1),ARGCAST(argv[1],TYPE2),ARGCAST(argv[2],TYPE3)); \ *************** *** 517,521 ****
#define REAL_NEW_4(NAME,NEW_CLASS,DSP,LIB, TYPE1,TYPE2, TYPE3, TYPE4) \ ! flext_obj *NEW_CLASS::__init__(int ,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1),ARGCAST(argv[1],TYPE2),ARGCAST(argv[2],TYPE3),ARGCAST(argv[3],TYPE4)); \ --- 532,536 ----
#define REAL_NEW_4(NAME,NEW_CLASS,DSP,LIB, TYPE1,TYPE2, TYPE3, TYPE4) \ ! flext_obj *NEW_CLASS::__init__(int,t_atom *argv) \ { \ return new NEW_CLASS(ARGCAST(argv[0],TYPE1),ARGCAST(argv[1],TYPE2),ARGCAST(argv[2],TYPE3),ARGCAST(argv[3],TYPE4)); \
Index: flsupport.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** flsupport.cpp 14 Apr 2004 02:33:06 -0000 1.36 --- flsupport.cpp 23 Apr 2004 02:32:55 -0000 1.37 *************** *** 24,27 **** --- 24,28 ---- #endif
+ const t_symbol *flext::sym__ = NULL; const t_symbol *flext::sym_float = NULL; const t_symbol *flext::sym_symbol = NULL; *************** *** 51,54 **** --- 52,56 ----
#if FLEXT_SYS == FLEXT_SYS_PD + sym__ = gensym(""); sym_anything = gensym("anything"); sym_pointer = gensym("pointer"); *************** *** 60,63 **** --- 62,66 ---- sym_int = gensym("int"); #elif FLEXT_SYS == FLEXT_SYS_MAX + sym__ = gensym(""); sym_int = gensym("int"); sym_float = gensym("float"); *************** *** 67,70 **** --- 70,74 ---- sym_anything = gensym("anything"); #elif FLEXT_SYS == FLEXT_SYS_JMAX + sym__ = fts_new_symbol("");; // is there a static symbol for that? sym_int = fts_s_int; sym_float = fts_s_float;
Index: flsupport.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** flsupport.h 26 Mar 2004 03:22:11 -0000 1.66 --- flsupport.h 23 Apr 2004 02:32:55 -0000 1.67 *************** *** 290,293 **** --- 290,295 ---- */
+ //! Symbol constant for "" + static const t_symbol *sym__; //! Symbol constant for "float" static const t_symbol *sym_float;
Index: fllib.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/fllib.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** fllib.cpp 3 Apr 2004 02:21:04 -0000 1.23 --- fllib.cpp 23 Apr 2004 02:32:55 -0000 1.24 *************** *** 325,360 **** #endif
! if(argc == lo->argc) { ! for(int i = 0; /*ok &&*/ i < lo->argc; ++i) { ! switch(lo->argv[i]) { #if FLEXT_SYS != FLEXT_SYS_PD ! case FLEXTTPN_INT: ! if(IsInt(argv[i])) args[i] = argv[i]; ! else if(flext::IsFloat(argv[i])) flext::SetInt(args[i],(int)flext::GetFloat(argv[i])); ! else ok = false; ! break; #endif ! case FLEXTTPN_FLOAT: ! if(IsInt(argv[i])) flext::SetFloat(args[i],(float)flext::GetInt(argv[i])); ! else if(flext::IsFloat(argv[i])) args[i] = argv[i]; ! else ok = false; ! 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; ! } ! } ! ! if(!ok) ! post("%s: Creation arguments do not match",GetString(s)); ! } ! else { ! error("%s: %s creation arguments",GetString(s),argc < lo->argc?"Not enough":"Too many"); ! ok = false; } }
--- 325,372 ---- #endif
! int misnum = 0; ! if(argc > lo->argc) { ok = false; misnum = 1; } ! ! for(int i = 0; ok && i < lo->argc; ++i) { ! switch(lo->argv[i]) { #if FLEXT_SYS != FLEXT_SYS_PD ! case FLEXTTPN_INT: ! case FLEXTTPN_DEFINT: ! if(i >= argc) ! if(lo->argv[i] == FLEXTTPN_DEFINT) SetInt(args[i],0); ! else { misnum = -1,ok = false; break; } ! else if(IsInt(argv[i])) args[i] = argv[i]; ! else if(IsFloat(argv[i])) SetInt(args[i],(int)GetFloat(argv[i])); ! else ok = false; ! break; #endif ! case FLEXTTPN_FLOAT: ! case FLEXTTPN_DEFFLOAT: ! if(i >= argc) ! if(lo->argv[i] == FLEXTTPN_DEFFLOAT) SetFloat(args[i],0); ! else { misnum = -1,ok = false; break; } ! else if(IsInt(argv[i])) SetFloat(args[i],(float)GetInt(argv[i])); ! else if(IsFloat(argv[i])) args[i] = argv[i]; ! else ok = false; ! break; ! case FLEXTTPN_SYM: ! case FLEXTTPN_DEFSYM: ! // \todo shall we analyze the patcher args????... should already be done! ! if(i >= argc) ! if(lo->argv[i] == FLEXTTPN_DEFSYM) SetSymbol(args[i],sym__); ! else { misnum = -1,ok = false; break; } ! else if(IsSymbol(argv[i])) // SetSymbol(args[i],GetParamSym(GetSymbol(argv[i]),NULL)); ! args[i] = argv[i]; ! else ok = false; ! break; ! } } + + if(!ok) + if(misnum) + error("%s: %s creation arguments",GetString(s),misnum < 0?"Not enough":"Too many"); + else + error("%s: Creation arguments do not match",GetString(s)); }