Commit 64339745 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@108 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent ede0f09b
......@@ -66,7 +66,7 @@ Version history:
0.2.0:
- internal proxy objects for any non-leftmost inlets
- Max/MSP: all signal inlets can receive messages
- method/argument parsing is done by flext
- method/argument parsing is done by flext - float/int are not distinguished, the first handler wins
- integrated more system functions into flext_base & eliminated superfluous #defines
- distribute list (into inlet 0) elements over inlets (right to left, only if no explicit list handler defined)
- added outlets for anythings
......@@ -125,7 +125,7 @@ general:
- where to put flext source/lib in linux: /usr/local/lib,/usr/local/include ?
bugs:
no unfixed known
- PD: problems with timed buffer redrawing (takes a lot of cpu time)
tests:
- PD: figure out what "pointer" messages do and where they occur
......
No preview for this file type
......@@ -465,11 +465,12 @@ typedef V (*methfun_0)(flext_base *c);
#define MAXARGS 5
// the args MUST all have 32 bits (float, t_symbol *)
typedef V (*methfun_1)(flext_base *c,I);
typedef V (*methfun_2)(flext_base *c,I,I);
typedef V (*methfun_3)(flext_base *c,I,I,I);
typedef V (*methfun_4)(flext_base *c,I,I,I,I);
typedef V (*methfun_5)(flext_base *c,I,I,I,I,I);
// the reference is needed for PPC processors
typedef V (*methfun_1)(flext_base *c,I &);
typedef V (*methfun_2)(flext_base *c,I &,I &);
typedef V (*methfun_3)(flext_base *c,I &,I &,I &);
typedef V (*methfun_4)(flext_base *c,I &,I &,I &,I &);
typedef V (*methfun_5)(flext_base *c,I &,I &,I &,I &,I &);
BL flext_base::m_methodmain(I inlet,const t_symbol *s,I argc,t_atom *argv)
......@@ -505,7 +506,6 @@ BL flext_base::m_methodmain(I inlet,const t_symbol *s,I argc,t_atom *argv)
switch(m->args[ix]) {
case a_float: {
ASSERT(sizeof(F) == sizeof(I));
F a;
if(is_float(argv[ix])) iargs[ix] = *(I *)&(a = get_float(argv[ix]));
else if(is_int(argv[ix])) iargs[ix] = *(I *)&(a = get_int(argv[ix]));
......@@ -670,7 +670,13 @@ V flext_base::add_meth_ixd(I inlet,const C *tag,methfun fun,metharg tp,...)
V flext_base::geta_string(const t_atom &a,C *buf,I szbuf)
{
#ifdef PD
atom_string(const_cast<t_atom *>(&a),buf,szbuf);
#else
if(is_symbol(a)) strcpy(buf,get_string(a));
else if(is_float(a)) sprintf(buf,"%f",get_float(a));
else if(is_int(a)) sprintf(buf,"%i",get_int(a));
#endif
}
......
......@@ -191,6 +191,7 @@ public:
V add_meth_one(I inlet,const C *tag,methfun fun,metharg tp,...);
// V add_meth_ixd(I inlet,const C *tag,methfun fun,metharg tp,...);
/*
V add_meth(I inlet,V (*m)(flext_base *,I argc,t_atom *argv)) { add_meth_one(inlet,"list",(methfun)m,a_gimme,a_null); }
V add_meth(I inlet,const C *tag,V (*m)(flext_base *)) { add_meth_one(inlet,tag,(methfun)m,a_null); } // pure method
V add_meth(I inlet,V (*m)(flext_base *,t_symbol *s,I argc,t_atom *argv)) { add_meth_one(inlet,"anything",(methfun)m,a_gimme,a_null); } // anything
......@@ -206,7 +207,23 @@ public:
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,t_symbol *s)) { add_meth_one(inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,F)) { add_meth_one(inlet,tag,(methfun)m,a_float,a_null); } // method+float
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,I)) { add_meth_one(inlet,tag,(methfun)m,a_int,a_null); } // method+int
*/
V add_meth(I inlet,V (*m)(flext_base *,I argc,t_atom *argv)) { add_meth_one(inlet,"list",(methfun)m,a_gimme,a_null); }
V add_meth(I inlet,const C *tag,V (*m)(flext_base *)) { add_meth_one(inlet,tag,(methfun)m,a_null); } // pure method
V add_meth(I inlet,V (*m)(flext_base *,t_symbol *s,I argc,t_atom *argv)) { add_meth_one(inlet,"anything",(methfun)m,a_gimme,a_null); } // anything
V add_meth(I inlet,V (*m)(flext_base *,t_symbol *s)) { add_meth_one(inlet,"symbol",(methfun)m,a_symbol,a_null); } // anything
V add_meth(I inlet,V (*m)(flext_base *,F &)) { add_meth_one(inlet,"float",(methfun)m,a_float,a_null); } // single float
V add_meth(I inlet,V (*m)(flext_base *,F &,F &)) { add_meth_one(inlet,"list",(methfun)m,a_float,a_float,a_null); } // list of 2 floats
V add_meth(I inlet,V (*m)(flext_base *,F &,F &,F &)) { add_meth_one(inlet,"list",(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats
V add_meth(I inlet,V (*m)(flext_base *,I &)) { add_meth_one(inlet,"int",(methfun)m,a_int,a_null); } // single float
V add_meth(I inlet,V (*m)(flext_base *,I &,I &)) { add_meth_one(inlet,"list",(methfun)m,a_int,a_int,a_null); } // list of 2 floats
V add_meth(I inlet,V (*m)(flext_base *,I &,I &,I &)) { add_meth_one(inlet,"list",(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,I argc,t_atom *argv)) { add_meth_one(inlet,tag,(methfun)m,a_gimme,a_null); } // method+gimme
// V add_meth(I inlet,const C *tag,V (*m)(flext_base *,BL b)) { add_meth_one(inlet,tag,(methfun)m,a_bool,a_gimme,a_null); } // method+boolean
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,t_symbol *s)) { add_meth_one(inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,F &)) { add_meth_one(inlet,tag,(methfun)m,a_float,a_null); } // method+float
V add_meth(I inlet,const C *tag,V (*m)(flext_base *,I &)) { add_meth_one(inlet,tag,(methfun)m,a_int,a_null); } // method+int
// --- various symbols --------------------------------------------
......@@ -460,26 +477,26 @@ static void cb_ ## M_FUN(flext_base *c,int argc,t_atom *argv) { dynamic_cast<thi
// converting t_flint to bool
#define FLEXT_CALLBACK_B(M_FUN) \
static void cb_ ## M_FUN(flext_base *c,int arg1) { dynamic_cast<thisType *>(c)->M_FUN(arg1 != 0); }
static void cb_ ## M_FUN(flext_base *c,int &arg1) { dynamic_cast<thisType *>(c)->M_FUN(arg1 != 0); }
// converting t_flint to enum
#define FLEXT_CALLBACK_E(M_FUN,TPE) \
static void cb_ ## M_FUN(flext_base *c,int arg1) { dynamic_cast<thisType *>(c)->M_FUN((TPE)(int)arg1); }
static void cb_ ## M_FUN(flext_base *c,int &arg1) { dynamic_cast<thisType *>(c)->M_FUN((TPE)(int)arg1); }
#define FLEXT_CALLBACK_1(M_FUN,TP1) \
static void cb_ ## M_FUN(flext_base *c,TP1 arg1) { dynamic_cast<thisType *>(c)->M_FUN(arg1); }
static void cb_ ## M_FUN(flext_base *c,TP1 &arg1) { dynamic_cast<thisType *>(c)->M_FUN(arg1); }
#define FLEXT_CALLBACK_2(M_FUN,TP1,TP2) \
static void cb_ ## M_FUN(flext_base *c,TP1 arg1,TP2 arg2) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2); }
static void cb_ ## M_FUN(flext_base *c,TP1 &arg1,TP2 &arg2) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2); }
#define FLEXT_CALLBACK_3(M_FUN,TP1,TP2,TP3) \
static void cb_ ## M_FUN(flext_base *c,TP1 arg1,TP2 arg2,TP3 arg3) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2,arg3); }
static void cb_ ## M_FUN(flext_base *c,TP1 &arg1,TP2 &arg2,TP3 &arg3) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2,arg3); }
#define FLEXT_CALLBACK_4(M_FUN,TP1,TP2,TP3,TP4) \
static void cb_ ## M_FUN(flext_base *c,TP1 arg1,TP2 arg2,TP3 arg3.TP4 arg4) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2,arg3,arg4); }
static void cb_ ## M_FUN(flext_base *c,TP1 &arg1,TP2 &arg2,TP3 &arg3,TP4 &arg4) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2,arg3,arg4); }
#define FLEXT_CALLBACK_5(M_FUN,TP1,TP2,TP3,TP4,TP5) \
static void cb_ ## M_FUN(flext_base *c,TP1 arg1,TP2 arg2,TP3 arg3.TP4 arg4,TP5 arg5) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2,arg3,arg4,arg5); }
static void cb_ ## M_FUN(flext_base *c,TP1 &arg1,TP2 &arg2,TP3 &arg3,TP4 &arg4,TP5 &arg5) { dynamic_cast<thisType *>(c)->M_FUN(arg1,arg2,arg3,arg4,arg5); }
// Shortcuts for method arguments
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment