From dcbc90c265de6782a1dc6f2e5e7e9fa3c4743f87 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 26 Jan 2005 05:02:06 +0000 Subject: - fixed typos and 64-bit compatibility usage of symbols for method and attribute adding fixed buggy unbinding of receive symbols reconsidered flext::buffer:Update some restructuring added object construction and destruction flags better templates, some minor changes build system: added profiler mode, more fixes added method for clicks into object box - conform to idle callback functionality in devel_0_38 oops, forgot about SIMD for Windows fix for ToOut calls in dsp time svn path=/trunk/; revision=2540 --- externals/grill/flext/build/config-win.def | 3 + externals/grill/flext/buildsys/win/nmake-msvc.inc | 2 +- externals/grill/flext/changes.txt | 3 + externals/grill/flext/source/flatom.cpp | 2 +- externals/grill/flext/source/flatom_app.cpp | 2 +- externals/grill/flext/source/flatom_part.cpp | 2 +- externals/grill/flext/source/flatom_pr.cpp | 2 +- externals/grill/flext/source/flattr.cpp | 15 +- externals/grill/flext/source/flattr_ed.cpp | 70 +++++--- externals/grill/flext/source/flbase.cpp | 2 +- externals/grill/flext/source/flbase.h | 2 +- externals/grill/flext/source/flbind.cpp | 2 +- externals/grill/flext/source/flclass.h | 199 ++++++++++++++-------- externals/grill/flext/source/fldefs.h | 2 +- externals/grill/flext/source/fldefs_attradd.h | 34 ++-- externals/grill/flext/source/fldefs_attrcb.h | 2 +- externals/grill/flext/source/fldefs_attrvar.h | 2 +- externals/grill/flext/source/fldefs_hdr.h | 2 +- externals/grill/flext/source/fldefs_methadd.h | 60 +++---- externals/grill/flext/source/fldefs_methbind.h | 2 +- externals/grill/flext/source/fldefs_methcall.h | 2 +- externals/grill/flext/source/fldefs_methcb.h | 2 +- externals/grill/flext/source/fldefs_meththr.h | 2 +- externals/grill/flext/source/fldefs_setup.h | 2 +- externals/grill/flext/source/fldoxygen.h | 2 +- externals/grill/flext/source/fldsp.cpp | 63 +++---- externals/grill/flext/source/fldsp.h | 17 +- externals/grill/flext/source/flext.cpp | 8 +- externals/grill/flext/source/flinternal.h | 2 +- externals/grill/flext/source/flitem.cpp | 2 +- externals/grill/flext/source/fllib.cpp | 2 +- externals/grill/flext/source/flmap.h | 2 +- externals/grill/flext/source/flmeth.cpp | 34 ++-- externals/grill/flext/source/flmsg.cpp | 2 +- externals/grill/flext/source/flmspbuffer.h | 2 +- externals/grill/flext/source/flout.cpp | 26 +-- externals/grill/flext/source/flprefix.h | 2 +- externals/grill/flext/source/flproxy.cpp | 2 +- externals/grill/flext/source/flqueue.cpp | 2 +- externals/grill/flext/source/flsimd.cpp | 55 ++++++ externals/grill/flext/source/flsndobj.cpp | 2 +- externals/grill/flext/source/flsndobj.h | 2 +- externals/grill/flext/source/flstk.cpp | 2 +- externals/grill/flext/source/flstk.h | 2 +- externals/grill/flext/source/flsupport.cpp | 2 +- externals/grill/flext/source/flsupport.h | 5 + externals/grill/flext/source/flthr.cpp | 2 +- externals/grill/flext/source/fltimer.cpp | 2 +- externals/grill/flext/source/flutil.cpp | 2 +- externals/grill/flext/source/flxlet.cpp | 2 +- 50 files changed, 386 insertions(+), 278 deletions(-) (limited to 'externals/grill/flext') diff --git a/externals/grill/flext/build/config-win.def b/externals/grill/flext/build/config-win.def index a5afc913..cddb322f 100644 --- a/externals/grill/flext/build/config-win.def +++ b/externals/grill/flext/build/config-win.def @@ -1,3 +1,6 @@ +# use SIMD instructions (Intel SSE)? +SIMD=1 + # where is the STK installation? # (uncomment the line with # to disable STK support) #STK=c:\data\prog\audio\stk diff --git a/externals/grill/flext/buildsys/win/nmake-msvc.inc b/externals/grill/flext/buildsys/win/nmake-msvc.inc index 826e99fb..c5e58d9c 100644 --- a/externals/grill/flext/buildsys/win/nmake-msvc.inc +++ b/externals/grill/flext/buildsys/win/nmake-msvc.inc @@ -22,7 +22,7 @@ CFLAGS=$(CFLAGS) /YX$(PRECOMPILE) /Fp$(OBJPATH)\precompiled.pch CFLAGS=$(CFLAGS) /LD # enable exception handling -CFLAGS=$(CFLAGS) /GX +CFLAGS=$(CFLAGS) /EHsc # no banner CFLAGS=$(CFLAGS) /nologo diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt index 2615e9ff..2bc79870 100644 --- a/externals/grill/flext/changes.txt +++ b/externals/grill/flext/changes.txt @@ -26,7 +26,10 @@ Version history: - use new PD idle callback for queues messages (currently in devel_0_38) - fixed bug with unregistering for bound symbols - removed virtual m_assist function (which was only useful for Max)... stick to static assist strings +- removed virtual flext_dsp::m_enable function (which wasn't present for Max/MSP) - added m_click method which gets called on alt-click (PD) resp. double clicks (Max) onto the object box +- in ToOut check if we are inside dsp (and use ToQueue then...) +- some restructuring and use symbols (rather the char *) natively for AddMethod* and AddAttrib* functions 0.4.7: - added flext::GetBool (just because flext::GetInt has been there for a while) diff --git a/externals/grill/flext/source/flatom.cpp b/externals/grill/flext/source/flatom.cpp index c4c2161c..3562e904 100644 --- a/externals/grill/flext/source/flatom.cpp +++ b/externals/grill/flext/source/flatom.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flatom_app.cpp b/externals/grill/flext/source/flatom_app.cpp index 96fe010d..d028202b 100755 --- a/externals/grill/flext/source/flatom_app.cpp +++ b/externals/grill/flext/source/flatom_app.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flatom_part.cpp b/externals/grill/flext/source/flatom_part.cpp index e5c9c533..9f648e59 100755 --- a/externals/grill/flext/source/flatom_part.cpp +++ b/externals/grill/flext/source/flatom_part.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flatom_pr.cpp b/externals/grill/flext/source/flatom_pr.cpp index cfc69266..47430366 100644 --- a/externals/grill/flext/source/flatom_pr.cpp +++ b/externals/grill/flext/source/flatom_pr.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flattr.cpp b/externals/grill/flext/source/flattr.cpp index 764e1f02..c1a98ecf 100644 --- a/externals/grill/flext/source/flattr.cpp +++ b/externals/grill/flext/source/flattr.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -43,9 +43,8 @@ flext_base::AttrDataCont::~AttrDataCont() //! Add get and set attributes -void flext_base::AddAttrib(ItemCont *aa,ItemCont *ma,const char *attr,metharg tp,methfun gfun,methfun sfun) +void flext_base::AddAttrib(ItemCont *aa,ItemCont *ma,const t_symbol *asym,metharg tp,methfun gfun,methfun sfun) { - const t_symbol *asym = MakeSymbol(attr); AttrItem *a,*b; FLEXT_ASSERT(asym != sym__ && asym != sym_list && asym != sym_float && asym != sym_symbol && asym != sym_anything); @@ -71,7 +70,7 @@ void flext_base::AddAttrib(ItemCont *aa,ItemCont *ma,const char *attr,metharg tp aa->Add(b,asym); static char tmp[256] = "get"; - strcpy(tmp+3,attr); + strcpy(tmp+3,GetString(asym)); // bind attribute to a method MethItem *mi = new MethItem(b); @@ -87,7 +86,7 @@ void flext_base::AddAttrib(ItemCont *aa,ItemCont *ma,const char *attr,metharg tp } } -void flext_base::AddAttrib(const char *attr,metharg tp,methfun gfun,methfun sfun) +void flext_base::AddAttrib(const t_symbol *attr,metharg tp,methfun gfun,methfun sfun) { if(procattr) AddAttrib(ThAttrs(),ThMeths(),attr,tp,gfun,sfun); @@ -95,7 +94,7 @@ void flext_base::AddAttrib(const char *attr,metharg tp,methfun gfun,methfun sfun error("%s - attribute procession is not enabled!",thisName()); } -void flext_base::AddAttrib(t_classid c,const char *attr,metharg tp,methfun gfun,methfun sfun) +void flext_base::AddAttrib(t_classid c,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun) { AddAttrib(ClAttrs(c),ClMeths(c),attr,tp,gfun,sfun); } @@ -169,12 +168,14 @@ bool flext_base::InitAttrib(int argc,const t_atom *argv) return true; } +static const t_symbol *sym_attributes = flext::MakeSymbol("attributes"); + bool flext_base::ListAttrib() const { if(procattr) { AtomList la; ListAttrib(la); - ToOutAnything(GetOutAttr(),MakeSymbol("attributes"),la.Count(),la.Atoms()); + ToOutAnything(GetOutAttr(),sym_attributes,la.Count(),la.Atoms()); return true; } else diff --git a/externals/grill/flext/source/flattr_ed.cpp b/externals/grill/flext/source/flattr_ed.cpp index 8757c803..cf625e7c 100644 --- a/externals/grill/flext/source/flattr_ed.cpp +++ b/externals/grill/flext/source/flattr_ed.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -14,7 +14,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flext.h" -#if FLEXT_SYS == FLEXT_SYS_PD && !defined(FLEXT_NOATTREDIT) +#if FLEXT_SYS == FLEXT_SYS_PD + +#ifdef _MSC_VER +#pragma warning( disable : 4091 ) +#endif /* #ifdef PD_DEVEL_VERSION @@ -22,10 +26,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #endif */ -#ifdef _MSC_VER -#pragma warning( disable : 4091 ) -#endif - #ifndef FLEXT_CLONEWIDGET // This is problematic... non-public headers! // compilation is specific for a compiled version!! @@ -39,6 +39,39 @@ WARRANTIES, see the file, "license.txt," in this distribution. static t_widgetbehavior widgetbehavior; +void flext_base::SetGfx(t_classid c) +{ + // widgetbehavior struct MUST be resident... (static is just ok here) + +#ifndef FLEXT_CLONEWIDGET + widgetbehavior.w_visfn = c->c_wb->w_visfn; + widgetbehavior.w_selectfn = c->c_wb->w_selectfn; + widgetbehavior.w_getrectfn = c->c_wb->w_getrectfn; + widgetbehavior.w_displacefn = c->c_wb->w_displacefn; + widgetbehavior.w_activatefn = c->c_wb->w_activatefn; + widgetbehavior.w_deletefn = c->c_wb->w_deletefn; + widgetbehavior.w_selectfn = c->c_wb->w_selectfn; +#else + widgetbehavior.w_visfn = text_widgetbehavior.w_visfn; + widgetbehavior.w_selectfn = text_widgetbehavior.w_selectfn; + widgetbehavior.w_getrectfn = text_widgetbehavior.w_getrectfn; + widgetbehavior.w_displacefn = text_widgetbehavior.w_displacefn; + widgetbehavior.w_activatefn = text_widgetbehavior.w_activatefn; + widgetbehavior.w_deletefn = text_widgetbehavior.w_deletefn; + widgetbehavior.w_selectfn = text_widgetbehavior.w_selectfn; +#endif + +#ifndef FLEXT_NOATTREDIT + attrsetup(c); +#endif // FLEXT_NOATTREDIT + + widgetbehavior.w_clickfn = cb_click; + class_setwidget(c, &widgetbehavior); +} + + +#ifndef FLEXT_NOATTREDIT + #ifndef FLEXT_CLONEWIDGET static void (*ori_vis)(t_gobj *c, t_glist *, int vis) = NULL; static void (*ori_select)(t_gobj *c, t_glist *, int state) = NULL; @@ -408,26 +441,16 @@ static void tclscript() ); } -void flext_base::SetAttrEditor(t_classid c) +void flext_base::attrsetup(t_classid c) { - // widgetbehavior struct MUST be resident... (static is just ok here) - #ifndef FLEXT_CLONEWIDGET ori_vis = c->c_wb->w_visfn; ori_select = c->c_wb->w_selectfn; - widgetbehavior.w_getrectfn = c->c_wb->w_getrectfn; - widgetbehavior.w_displacefn = c->c_wb->w_displacefn; - widgetbehavior.w_activatefn = c->c_wb->w_activatefn; - widgetbehavior.w_deletefn = c->c_wb->w_deletefn; - widgetbehavior.w_selectfn = c->c_wb->w_selectfn; -#else - widgetbehavior.w_getrectfn = text_widgetbehavior.w_getrectfn; - widgetbehavior.w_displacefn = text_widgetbehavior.w_displacefn; - widgetbehavior.w_activatefn = text_widgetbehavior.w_activatefn; - widgetbehavior.w_deletefn = text_widgetbehavior.w_deletefn; - widgetbehavior.w_selectfn = text_widgetbehavior.w_selectfn; #endif + widgetbehavior.w_visfn = cb_GfxVis; + widgetbehavior.w_selectfn = cb_GfxSelect; + #if PD_MINOR_VERSION >= 37 class_setpropertiesfn(c,cb_GfxProperties); class_setsavefn(c,cb_GfxSave); @@ -436,11 +459,6 @@ void flext_base::SetAttrEditor(t_classid c) widgetbehavior.w_savefn = cb_GfxSave; #endif - widgetbehavior.w_clickfn = cb_click; - widgetbehavior.w_visfn = cb_GfxVis; - widgetbehavior.w_selectfn = cb_GfxSelect; - class_setwidget(c, &widgetbehavior); - tclscript(); } @@ -800,5 +818,7 @@ void flext_base::BinbufAttr(t_binbuf *b,bool transdoll) } } +#endif // FLEXT_NOATTREDIT + #endif // FLEXT_SYS_PD diff --git a/externals/grill/flext/source/flbase.cpp b/externals/grill/flext/source/flbase.cpp index fd666632..7101b484 100644 --- a/externals/grill/flext/source/flbase.cpp +++ b/externals/grill/flext/source/flbase.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flbase.h b/externals/grill/flext/source/flbase.h index 732cccbe..7cf0d8cc 100644 --- a/externals/grill/flext/source/flbase.h +++ b/externals/grill/flext/source/flbase.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flbind.cpp b/externals/grill/flext/source/flbind.cpp index 4ec9686b..5b0bfeac 100644 --- a/externals/grill/flext/source/flbind.cpp +++ b/externals/grill/flext/source/flbind.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h index dc444260..b32f49fa 100644 --- a/externals/grill/flext/source/flclass.h +++ b/externals/grill/flext/source/flclass.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -20,6 +20,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flbase.h" #include "flsupport.h" #include "flmap.h" +#include "flinternal.h" #ifdef _MSC_VER #pragma warning(disable: 4786) @@ -195,6 +196,9 @@ public: //! Get number of signal outlets int CntOutSig() const { return outsigs; } + //! Check if we are in DSP time + bool InDsp() const { return indsp; } + //! Retrieve currently processed message tag (NULL if no message processing) const t_symbol *thisTag() const { return curtag; } @@ -333,35 +337,45 @@ public: @{ */ - void AddMethodDef(int inlet,const char *tag = NULL); // call virtual function for tag && inlet - - void AddMethod(int inlet,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ThMeths(),inlet,"list",(methfun)m,a_list,a_null); } - void AddMethod(int inlet,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,"list",(methfun)m,a_list,a_null); } - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_null); } // pure method - void AddMethod(int inlet,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ThMeths(),inlet,"anything",(methfun)m,a_any,a_null); } // anything - void AddMethod(int inlet,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,"anything",(methfun)m,a_any,a_null); } // anything - void AddMethod(int inlet,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ThMeths(),inlet,"symbol",(methfun)m,a_symbol,a_null); } // single symbol - void AddMethod(int inlet,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ThMeths(),inlet,"symbol",(methfun)m,a_symbol,a_null); } // single symbol - void AddMethod(int inlet,bool (*m)(flext_base *,float &)) { AddMethod(ThMeths(),inlet,"float",(methfun)m,a_float,a_null); } // single float - void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(ThMeths(),inlet,"list",(methfun)m,a_float,a_float,a_null); } // list of 2 floats - void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &,float &)) { AddMethod(ThMeths(),inlet,"list",(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats + void AddMethodDef(int inlet,const t_symbol *tag = NULL); // call virtual function for tag && inlet + void AddMethodDef(int inlet,const char *tag = NULL) { AddMethodDef(inlet,MakeSymbol(tag)); } + + void AddMethod(int inlet,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_list,a_null); } + void AddMethod(int inlet,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_list,a_null); } + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_null); } // pure method + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ThMeths(),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything + void AddMethod(int inlet,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything + void AddMethod(int inlet,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ThMeths(),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol + void AddMethod(int inlet,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ThMeths(),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol + void AddMethod(int inlet,bool (*m)(flext_base *,float &)) { AddMethod(ThMeths(),inlet,sym_float,(methfun)m,a_float,a_null); } // single float + void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_float,a_float,a_null); } // list of 2 floats + void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &,float &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats #if FLEXT_SYS == FLEXT_SYS_PD - void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,"float",(methfun)m,a_int,a_null); } // single float + void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,sym_float,(methfun)m,a_int,a_null); } // single float #elif FLEXT_SYS == FLEXT_SYS_MAX || FLEXT_SYS == FLEXT_SYS_JMAX - void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,"int",(methfun)m,a_int,a_null); } // single float + void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,sym_int,(methfun)m,a_int,a_null); } // single float #else #error #endif - void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(ThMeths(),inlet,"list",(methfun)m,a_int,a_int,a_null); } // list of 2 floats - void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &,int &)) { AddMethod(ThMeths(),inlet,"list",(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_float,a_null); } // method+float - void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_int,a_null); } // method+int + void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_int,a_int,a_null); } // list of 2 floats + void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &,int &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,float &)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_float,a_null); } // method+float + void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_int,a_null); } // method+int + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(inlet,MakeSymbol(tag),m); } + void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(inlet,MakeSymbol(tag),m); } //! Set Max/MSP style of distributing list elements over (message) inlets void SetDist(bool d = true) { distmsgs = d; } @@ -373,33 +387,42 @@ public: @{ */ - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,"list",(methfun)m,a_list,a_null); } - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,"list",(methfun)m,a_list,a_null); } - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_null); } // pure method - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,"anything",(methfun)m,a_any,a_null); } // anything - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,"anything",(methfun)m,a_any,a_null); } // anything - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ClMeths(c),inlet,"symbol",(methfun)m,a_symbol,a_null); } // single symbol - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ClMeths(c),inlet,"symbol",(methfun)m,a_symbol,a_null); } // single symbol - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &)) { AddMethod(ClMeths(c),inlet,"float",(methfun)m,a_float,a_null); } // single float - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(ClMeths(c),inlet,"list",(methfun)m,a_float,a_float,a_null); } // list of 2 floats - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &,float &,float &)) { AddMethod(ClMeths(c),inlet,"list",(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_list,a_null); } + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_list,a_null); } + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_null); } // pure method + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ClMeths(c),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ClMeths(c),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &)) { AddMethod(ClMeths(c),inlet,sym_float,(methfun)m,a_float,a_null); } // single float + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_float,a_float,a_null); } // list of 2 floats + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &,float &,float &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats #if FLEXT_SYS == FLEXT_SYS_PD - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,"float",(methfun)m,a_int,a_null); } // single integer + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,sym_float,(methfun)m,a_int,a_null); } // single integer #elif FLEXT_SYS == FLEXT_SYS_MAX || FLEXT_SYS == FLEXT_SYS_JMAX - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,"int",(methfun)m,a_int,a_null); } // single integer + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,sym_int,(methfun)m,a_int,a_null); } // single integer #else #error #endif - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(ClMeths(c),inlet,"list",(methfun)m,a_int,a_int,a_null); } // list of 2 floats - static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &,int &,int &)) { AddMethod(ClMeths(c),inlet,"list",(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_float,a_null); } // method+float - static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_int,a_null); } // method+int + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_int,a_int,a_null); } // list of 2 floats + static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &,int &,int &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,float &)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_float,a_null); } // method+float + static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_int,a_null); } // method+int + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(c,inlet,MakeSymbol(tag),m); } + static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(c,inlet,MakeSymbol(tag),m); } //! @} FLEXT_C_CADDMETHOD @@ -518,13 +541,20 @@ protected: @{ */ - void AddAttrib(const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(attr,a_float,(methfun)get,(methfun)set); } - void AddAttrib(const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(attr,a_int,(methfun)get,(methfun)set); } - void AddAttrib(const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(attr,a_bool,(methfun)get,(methfun)set); } - void AddAttrib(const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); } - void AddAttrib(const char *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); } - void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(attr,a_LIST,(methfun)get,(methfun)set); } - void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(attr,a_ANY,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(attr,a_float,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(attr,a_int,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(attr,a_bool,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(attr,a_LIST,(methfun)get,(methfun)set); } + void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(attr,a_ANY,(methfun)get,(methfun)set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(MakeSymbol(attr),get,set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(MakeSymbol(attr),get,set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(MakeSymbol(attr),get,set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(MakeSymbol(attr),get,set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(MakeSymbol(attr),get,set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(MakeSymbol(attr),get,set); } + void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(MakeSymbol(attr),get,set); } //! @} FLEXT_C_ATTR @@ -532,13 +562,20 @@ protected: @{ */ - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(c,attr,a_float,(methfun)get,(methfun)set); } - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(c,attr,a_int,(methfun)get,(methfun)set); } - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(c,attr,a_bool,(methfun)get,(methfun)set); } - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(c,attr,a_symbol,(methfun)get,(methfun)set); } - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(c,attr,a_symbol,(methfun)get,(methfun)set); } - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(c,attr,a_LIST,(methfun)get,(methfun)set); } - static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(c,attr,a_ANY,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(c,attr,a_float,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(c,attr,a_int,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(c,attr,a_bool,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(c,attr,a_symbol,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(c,attr,a_symbol,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(c,attr,a_LIST,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(c,attr,a_ANY,(methfun)get,(methfun)set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(c,MakeSymbol(attr),get,set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(c,MakeSymbol(attr),get,set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(c,MakeSymbol(attr),get,set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(c,MakeSymbol(attr),get,set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(c,MakeSymbol(attr),get,set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(c,MakeSymbol(attr),get,set); } + static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(c,MakeSymbol(attr),get,set); } //! @} FLEXT_C_CATTR @@ -740,14 +777,28 @@ protected: }; // these outlet functions don't check for thread but send directly to the real-time system - void ToSysBang(int n) const; - void ToSysFloat(int n,float f) const; - void ToSysInt(int n,int f) const; +#if FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX + void ToSysBang(int n) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_bang((t_outlet *)o); CRITOFF(); } } + void ToSysFloat(int n,float f) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_float((t_outlet *)o,f); CRITOFF(); } } + void ToSysInt(int n,int f) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_flint((t_outlet *)o,f); CRITOFF(); } } + void ToSysSymbol(int n,const t_symbol *s) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_symbol((t_outlet *)o,const_cast(s)); CRITOFF(); } } + void ToSysList(int n,int argc,const t_atom *argv) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_list((t_outlet *)o,const_cast(sym_list),argc,(t_atom *)argv); CRITOFF(); } } + void ToSysAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_anything((t_outlet *)o,const_cast(s),argc,(t_atom *)argv); CRITOFF(); } } +#elif FLEXT_SYS == FLEXT_SYS_JMAX + void ToSysBang(int n) const { fts_outlet_bang((fts_object *)thisHdr(),n); } + void ToSysFloat(int n,float f) const { fts_outlet_float((fts_object *)thisHdr(),n,f); } + void ToSysInt(int n,int f) const { fts_outlet_int((fts_object *)thisHdr(),n,f); } + void ToSysSymbol(int n,const t_symbol *s) const { fts_outlet_symbol((fts_object *)thisHdr(),n,s); } + void ToSysList(int n,int argc,const t_atom *argv) const { fts_outlet_send((fts_object *)thisHdr(),n,sym_list,argc,(t_atom *)argv); } + void ToSysAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const { fts_outlet_send((fts_object *)thisHdr(),n,const_cast(s),argc,(t_atom *)argv); } +#else +#error Not implemented +#endif void ToSysBool(int n,bool f) const { ToSysInt(n,f?1:0); } - void ToSysSymbol(int n,const t_symbol *s) const; void ToSysAtom(int n,const t_atom &at) const; - void ToSysList(int n,int argc,const t_atom *argv) const; - void ToSysAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const; + + // flag if we are within DSP + bool indsp; private: class pxbnd_object; @@ -772,14 +823,14 @@ public: ItemCont *ThMeths() { return methhead; } static ItemCont *ClMeths(t_classid c) { return GetClassArr(c,0); } - static void AddMethod(ItemCont *ma,int inlet,const char *tag,methfun fun,metharg tp,...); + static void AddMethod(ItemCont *ma,int inlet,const t_symbol *tag,methfun fun,metharg tp,...); ItemCont *ThAttrs() { return attrhead; } static ItemCont *ClAttrs(t_classid c) { return GetClassArr(c,1); } - static void AddAttrib(ItemCont *aa,ItemCont *ma,const char *attr,metharg tp,methfun gfun,methfun sfun); - void AddAttrib(const char *attr,metharg tp,methfun gfun,methfun sfun); - static void AddAttrib(t_classid c,const char *attr,metharg tp,methfun gfun,methfun sfun); + static void AddAttrib(ItemCont *aa,ItemCont *ma,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun); + void AddAttrib(const t_symbol *attr,metharg tp,methfun gfun,methfun sfun); + static void AddAttrib(t_classid c,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun); private: @@ -835,7 +886,6 @@ private: static int CheckAttrib(int argc,const t_atom *argv); bool InitAttrib(int argc,const t_atom *argv); - bool ListMethods(int inlet = 0) const; bool ListAttrib() const; bool DumpAttrib(const t_symbol *tag,AttrItem *a) const; bool GetAttrib(const t_symbol *tag,AttrItem *a,AtomList &l) const; @@ -863,10 +913,11 @@ private: #if FLEXT_SYS == FLEXT_SYS_PD + static void SetGfx(t_classid c); + #if !defined(FLEXT_NOATTREDIT) // attribute editor - static void SetAttrEditor(t_classid c); - + static void attrsetup(t_classid c); static bool cb_AttrDialog(flext_base *c,int argc,const t_atom *argv); static void cb_GfxProperties(t_gobj *c, t_glist *); static void cb_GfxVis(t_gobj *c, t_glist *gl, int vis); diff --git a/externals/grill/flext/source/fldefs.h b/externals/grill/flext/source/fldefs.h index 4f8a4264..fd31506b 100644 --- a/externals/grill/flext/source/fldefs.h +++ b/externals/grill/flext/source/fldefs.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_attradd.h b/externals/grill/flext/source/fldefs_attradd.h index df2f9407..de48b0a4 100644 --- a/externals/grill/flext/source/fldefs_attradd.h +++ b/externals/grill/flext/source/fldefs_attradd.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -26,43 +26,43 @@ WARRANTIES, see the file, "license.txt," in this distribution. //! Add handler for a gettable attribute #define FLEXT_CADDATTR_GET(CL,NAME,GFUN) \ \ -AddAttrib(CL,NAME,(FLEXT_GET_PRE(GFUN)),NULL) +AddAttrib(CL,flext::MakeSymbol(NAME),(FLEXT_GET_PRE(GFUN)),NULL) //! Add handler for a settable attribute #define FLEXT_CADDATTR_SET(CL,NAME,SFUN) \ \ -AddAttrib(CL,NAME,NULL,(FLEXT_SET_PRE(SFUN))) +AddAttrib(CL,flext::MakeSymbol(NAME),NULL,(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable attribute #define FLEXT_CADDATTR_VAR(CL,NAME,GFUN,SFUN) \ \ -AddAttrib(CL,NAME,(FLEXT_GET_PRE(GFUN)),(FLEXT_SET_PRE(SFUN))) +AddAttrib(CL,flext::MakeSymbol(NAME),(FLEXT_GET_PRE(GFUN)),(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable attribute #define FLEXT_CADDATTR_VAR1(CL,NAME,FUN) \ \ -AddAttrib(CL,NAME,(FLEXT_GET_PRE(FUN)),(FLEXT_SET_PRE(FUN))) +AddAttrib(CL,flext::MakeSymbol(NAME),(FLEXT_GET_PRE(FUN)),(FLEXT_SET_PRE(FUN))) //! Add handler for a gettable enum attribute #define FLEXT_CADDATTR_GET_E(CL,NAME,GFUN) \ \ -AddAttrib(CL,NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),NULL) +AddAttrib(CL,flext::MakeSymbol(NAME),(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),NULL) //! Add handler for a settable enum attribute #define FLEXT_CADDATTR_SET_E(CL,NAME,SFUN) \ \ -AddAttrib(CL,NAME,NULL,(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) +AddAttrib(CL,flext::MakeSymbol(NAME),NULL,(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable enum attribute #define FLEXT_CADDATTR_VAR_E(CL,NAME,GFUN,SFUN) \ \ -AddAttrib(CL,NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) +AddAttrib(CL,flext::MakeSymbol(NAME),(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable enum attribute #define FLEXT_CADDATTR_VAR1_E(CL,NAME,FUN) \ \ -AddAttrib(CL,NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(FUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(FUN))) +AddAttrib(CL,flext::MakeSymbol(NAME),(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(FUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(FUN))) //! @} FLEXT_D_CADDATTR @@ -77,43 +77,43 @@ AddAttrib(CL,NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(FUN)),(bool (*)(f //! Add handler for a gettable attribute #define FLEXT_ADDATTR_GET(NAME,GFUN) \ \ -AddAttrib(NAME,(FLEXT_GET_PRE(GFUN)),NULL) +AddAttrib(flext::MakeSymbol(NAME),(FLEXT_GET_PRE(GFUN)),NULL) //! Add handler for a settable attribute #define FLEXT_ADDATTR_SET(NAME,SFUN) \ \ -AddAttrib(NAME,NULL,(FLEXT_SET_PRE(SFUN))) +AddAttrib(flext::MakeSymbol(NAME),NULL,(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable attribute #define FLEXT_ADDATTR_VAR(NAME,GFUN,SFUN) \ \ -AddAttrib(NAME,(FLEXT_GET_PRE(GFUN)),(FLEXT_SET_PRE(SFUN))) +AddAttrib(flext::MakeSymbol(NAME),(FLEXT_GET_PRE(GFUN)),(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable attribute #define FLEXT_ADDATTR_VAR1(NAME,FUN) \ \ -AddAttrib(NAME,(FLEXT_GET_PRE(FUN)),(FLEXT_SET_PRE(FUN))) +AddAttrib(flext::MakeSymbol(NAME),(FLEXT_GET_PRE(FUN)),(FLEXT_SET_PRE(FUN))) //! Add handler for a gettable enum attribute #define FLEXT_ADDATTR_GET_E(NAME,GFUN) \ \ -AddAttrib(NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),NULL) +AddAttrib(flext::MakeSymbol(NAME),(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),NULL) //! Add handler for a settable enum attribute #define FLEXT_ADDATTR_SET_E(NAME,SFUN) \ \ -AddAttrib(NAME,NULL,(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) +AddAttrib(flext::MakeSymbol(NAME),NULL,(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable enum attribute #define FLEXT_ADDATTR_VAR_E(NAME,GFUN,SFUN) \ \ -AddAttrib(NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) +AddAttrib(flext::MakeSymbol(NAME),(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(GFUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(SFUN))) //! Add handlers for a both get- and settable enum attribute #define FLEXT_ADDATTR_VAR1_E(NAME,FUN) \ \ -AddAttrib(NAME,(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(FUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(FUN))) +AddAttrib(flext::MakeSymbol(NAME),(bool (*)(flext_base *,int &))(FLEXT_GET_PRE(FUN)),(bool (*)(flext_base *,int &))(FLEXT_SET_PRE(FUN))) //! @} FLEXT_D_ADDATTR diff --git a/externals/grill/flext/source/fldefs_attrcb.h b/externals/grill/flext/source/fldefs_attrcb.h index 85625a23..13ca8014 100644 --- a/externals/grill/flext/source/fldefs_attrcb.h +++ b/externals/grill/flext/source/fldefs_attrcb.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_attrvar.h b/externals/grill/flext/source/fldefs_attrvar.h index 7f7db5ef..e996b460 100644 --- a/externals/grill/flext/source/fldefs_attrvar.h +++ b/externals/grill/flext/source/fldefs_attrvar.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_hdr.h b/externals/grill/flext/source/fldefs_hdr.h index 99e15872..12b17c79 100644 --- a/externals/grill/flext/source/fldefs_hdr.h +++ b/externals/grill/flext/source/fldefs_hdr.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_methadd.h b/externals/grill/flext/source/fldefs_methadd.h index 562b72e3..e1ab66b4 100644 --- a/externals/grill/flext/source/fldefs_methadd.h +++ b/externals/grill/flext/source/fldefs_methadd.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -26,7 +26,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. //! Add a method handler for bang #define FLEXT_CADDBANG(CL,IX,M_FUN) \ \ -AddMethod(CL,IX,"bang",FLEXT_CALL_PRE(M_FUN)) +AddMethod(CL,IX,flext::sym_bang,FLEXT_CALL_PRE(M_FUN)) //! Add a handler for a method with either no, list or anything arguments #define FLEXT_CADDMETHOD(CL,IX,M_FUN) \ @@ -35,37 +35,37 @@ AddMethod(CL,IX,FLEXT_CALL_PRE(M_FUN)) //! Add a a handler for a method with implicit arguments #define FLEXT_CADDMETHOD_(CL,IX,M_TAG,M_FUN) \ \ -AddMethod(CL,IX,M_TAG,FLEXT_CALL_PRE(M_FUN)) +AddMethod(CL,IX,flext::MakeSymbol(M_TAG),FLEXT_CALL_PRE(M_FUN)) //! Add a handler for a method with 1 enum type argument #define FLEXT_CADDMETHOD_E(CL,IX,M_TAG,M_FUN) \ \ -AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),a_int,a_null) +AddMethod(ClMeths(CL),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),a_int,a_null) //! Add a handler for a method with 1 argument #define FLEXT_CADDMETHOD_1(CL,IX,M_TAG,M_FUN,TP1) \ \ -AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),a_null) +AddMethod(ClMeths(CL),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),a_null) //! Add a handler for a method with 2 arguments #define FLEXT_CADDMETHOD_2(CL,IX,M_TAG,M_FUN,TP1,TP2) \ \ -AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),a_null) +AddMethod(ClMeths(CL),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),a_null) //! Add a handler for a method with 3 arguments #define FLEXT_CADDMETHOD_3(CL,IX,M_TAG,M_FUN,TP1,TP2,TP3) \ \ -AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),a_null) +AddMethod(ClMeths(CL),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),a_null) //! Add a handler for a method with 4 arguments #define FLEXT_CADDMETHOD_4(CL,IX,M_TAG,M_FUN,TP1,TP2,TP3,TP4) \ \ -AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),a_null) +AddMethod(ClMeths(CL),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),a_null) //! Add a handler for a method with 5 arguments #define FLEXT_CADDMETHOD_5(CL,IX,M_TAG,M_FUN,TP1,TP2,TP3,TP4,TP5) \ \ -AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),FLEXTARG(TP5),a_null) +AddMethod(ClMeths(CL),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),FLEXTARG(TP5),a_null) // Shortcuts @@ -73,37 +73,37 @@ AddMethod(ClMeths(CL),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FL //! Add a handler for a method with a boolean argument #define FLEXT_CADDMETHOD_B(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_1(CL,IX,M_TAG,M_FUN,bool) +FLEXT_CADDMETHOD_1(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,bool) //! Add a handler for a method with 1 float argument #define FLEXT_CADDMETHOD_F(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_1(CL,IX,M_TAG,M_FUN,float) +FLEXT_CADDMETHOD_1(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,float) //! Add a handler for a method with 2 float arguments #define FLEXT_CADDMETHOD_FF(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_2(CL,IX,M_TAG,M_FUN,float,float) +FLEXT_CADDMETHOD_2(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,float,float) //! Add a handler for a method with 3 float arguments #define FLEXT_CADDMETHOD_FFF(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_3(CL,IX,M_TAG,M_FUN,float,float,float) +FLEXT_CADDMETHOD_3(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,float,float,float) //! Add a handler for a method with 1 integer argument #define FLEXT_CADDMETHOD_I(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_1(CL,IX,M_TAG,M_FUN,int) +FLEXT_CADDMETHOD_1(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,int) //! Add a handler for a method with 2 integer arguments #define FLEXT_CADDMETHOD_II(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_2(CL,IX,M_TAG,M_FUN,int,int) +FLEXT_CADDMETHOD_2(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,int,int) //! Add a handler for a method with 3 integer arguments #define FLEXT_CADDMETHOD_III(CL,IX,M_TAG,M_FUN) \ \ -FLEXT_CADDMETHOD_3(CL,IX,M_TAG,M_FUN,int,int,int) +FLEXT_CADDMETHOD_3(CL,IX,flext::MakeSymbol(M_TAG),M_FUN,int,int,int) //! @} FLEXT_D_CADDMETHOD @@ -153,37 +153,37 @@ AddMethod(IX,FLEXT_CALL_PRE(M_FUN)) //! Add a a handler for a tagged method with implicit arguments #define FLEXT_ADDMETHOD_(IX,M_TAG,M_FUN) \ \ -AddMethod(IX,M_TAG,FLEXT_CALL_PRE(M_FUN)) +AddMethod(IX,flext::MakeSymbol(M_TAG),FLEXT_CALL_PRE(M_FUN)) //! Add a handler for a method with 1 enum type argument #define FLEXT_ADDMETHOD_E(IX,M_TAG,M_FUN) \ \ -AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),a_int,a_null) +AddMethod(ThMeths(),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),a_int,a_null) //! Add a handler for a method with 1 argument #define FLEXT_ADDMETHOD_1(IX,M_TAG,M_FUN,TP1) \ \ -AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),a_null) +AddMethod(ThMeths(),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),a_null) //! Add a handler for a method with 2 arguments #define FLEXT_ADDMETHOD_2(IX,M_TAG,M_FUN,TP1,TP2) \ \ -AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),a_null) +AddMethod(ThMeths(),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),a_null) //! Add a handler for a method with 3 arguments #define FLEXT_ADDMETHOD_3(IX,M_TAG,M_FUN,TP1,TP2,TP3) \ \ -AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),a_null) +AddMethod(ThMeths(),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),a_null) //! Add a handler for a method with 4 arguments #define FLEXT_ADDMETHOD_4(IX,M_TAG,M_FUN,TP1,TP2,TP3,TP4) \ \ -AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),a_null) +AddMethod(ThMeths(),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),a_null) //! Add a handler for a method with 5 arguments #define FLEXT_ADDMETHOD_5(IX,M_TAG,M_FUN,TP1,TP2,TP3,TP4,TP5) \ \ -AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),FLEXTARG(TP5),a_null) +AddMethod(ThMeths(),IX,flext::MakeSymbol(M_TAG),(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEXTARG(TP2),FLEXTARG(TP3),FLEXTARG(TP4),FLEXTARG(TP5),a_null) // Shortcuts @@ -191,37 +191,37 @@ AddMethod(ThMeths(),IX,M_TAG,(methfun)(FLEXT_CALL_PRE(M_FUN)),FLEXTARG(TP1),FLEX //! Add a handler for a method with a boolean argument #define FLEXT_ADDMETHOD_B(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_1(IX,M_TAG,M_FUN,bool) +FLEXT_ADDMETHOD_1(IX,flext::MakeSymbol(M_TAG),M_FUN,bool) //! Add a handler for a method with 1 float argument #define FLEXT_ADDMETHOD_F(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_1(IX,M_TAG,M_FUN,float) +FLEXT_ADDMETHOD_1(IX,flext::MakeSymbol(M_TAG),M_FUN,float) //! Add a handler for a method with 2 float arguments #define FLEXT_ADDMETHOD_FF(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_2(IX,M_TAG,M_FUN,float,float) +FLEXT_ADDMETHOD_2(IX,flext::MakeSymbol(M_TAG),M_FUN,float,float) //! Add a handler for a method with 3 float arguments #define FLEXT_ADDMETHOD_FFF(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_3(IX,M_TAG,M_FUN,float,float,float) +FLEXT_ADDMETHOD_3(IX,flext::MakeSymbol(M_TAG),M_FUN,float,float,float) //! Add a handler for a method with 1 integer argument #define FLEXT_ADDMETHOD_I(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_1(IX,M_TAG,M_FUN,int) +FLEXT_ADDMETHOD_1(IX,flext::MakeSymbol(M_TAG),M_FUN,int) //! Add a handler for a method with 2 integer arguments #define FLEXT_ADDMETHOD_II(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_2(IX,M_TAG,M_FUN,int,int) +FLEXT_ADDMETHOD_2(IX,flext::MakeSymbol(M_TAG),M_FUN,int,int) //! Add a handler for a method with 3 integer arguments #define FLEXT_ADDMETHOD_III(IX,M_TAG,M_FUN) \ \ -FLEXT_ADDMETHOD_3(IX,M_TAG,M_FUN,int,int,int) +FLEXT_ADDMETHOD_3(IX,flext::MakeSymbol(M_TAG),M_FUN,int,int,int) //! @} FLEXT_D_ADDMETHOD diff --git a/externals/grill/flext/source/fldefs_methbind.h b/externals/grill/flext/source/fldefs_methbind.h index 70b29300..46dd8186 100644 --- a/externals/grill/flext/source/fldefs_methbind.h +++ b/externals/grill/flext/source/fldefs_methbind.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_methcall.h b/externals/grill/flext/source/fldefs_methcall.h index 1c4d30c1..1602faf0 100644 --- a/externals/grill/flext/source/fldefs_methcall.h +++ b/externals/grill/flext/source/fldefs_methcall.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_methcb.h b/externals/grill/flext/source/fldefs_methcb.h index 929a7929..c1112b85 100644 --- a/externals/grill/flext/source/fldefs_methcb.h +++ b/externals/grill/flext/source/fldefs_methcb.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_meththr.h b/externals/grill/flext/source/fldefs_meththr.h index 7d9e3e13..7aa36ddf 100644 --- a/externals/grill/flext/source/fldefs_meththr.h +++ b/externals/grill/flext/source/fldefs_meththr.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldefs_setup.h b/externals/grill/flext/source/fldefs_setup.h index 9864c3c9..11af5d77 100644 --- a/externals/grill/flext/source/fldefs_setup.h +++ b/externals/grill/flext/source/fldefs_setup.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fldoxygen.h b/externals/grill/flext/source/fldoxygen.h index c55859db..51579520 100644 --- a/externals/grill/flext/source/fldoxygen.h +++ b/externals/grill/flext/source/fldoxygen.h @@ -57,7 +57,7 @@ Currently, flext supports Flext is covered by the GPL. flext - C++ layer for Max/MSP and pd (pure data) externals
-Copyright (C) 2001-2003 Thomas Grill +Copyright (C) 2001-2005 Thomas Grill This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/externals/grill/flext/source/fldsp.cpp b/externals/grill/flext/source/fldsp.cpp index 3dd97f4c..91400346 100644 --- a/externals/grill/flext/source/fldsp.cpp +++ b/externals/grill/flext/source/fldsp.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -28,7 +28,6 @@ void flext_dsp::Setup(t_classid id) #if FLEXT_SYS == FLEXT_SYS_MAX dsp_initclass(); -// dsp_initboxclass(); add_dsp(c,cb_dsp); #elif FLEXT_SYS == FLEXT_SYS_PD CLASS_MAINSIGNALIN(c,flext_hdr,defsig); // float messages going into the left inlet are converted to signal @@ -100,11 +99,15 @@ t_int *flext_dsp::dspmeth(t_int *w) #endif */ #if FLEXT_SYS == FLEXT_SYS_MAX - if(!obj->thisHdr()->z_disabled) + if(!obj->thisHdr()->z_disabled) #else - if(obj->dspon) + if(obj->dspon) #endif + { + obj->indsp = true; obj->m_signal(obj->blksz,obj->invecs,obj->outvecs); + obj->indsp = false; + } return w+2; } #endif @@ -119,7 +122,15 @@ void flext_dsp::cb_dsp(t_class *c,t_signal **sp) { flext_dsp *obj = thisObject(c); - if(obj->CntInSig()+obj->CntOutSig() == 0) return; + int i; + int in = obj->CntInSig(); + int out = obj->CntOutSig(); +#if FLEXT_SYS == FLEXT_SYS_PD + // min. 1 input channel! (CLASS_MAININLET in pd...) + if(!in) in = 1; +#else + if(in+out == 0) return; +#endif // store current dsp parameters #if FLEXT_SYS == FLEXT_SYS_JMAX @@ -132,33 +143,31 @@ void flext_dsp::cb_dsp(t_class *c,t_signal **sp) #endif // store in and out signal vectors - int i; - int in = obj->chnsin = obj->CntInSig(); - int out = obj->chnsout = obj->CntOutSig(); - -#if FLEXT_SYS == FLEXT_SYS_PD - // min. 1 input channel! (CLASS_MAININLET in pd...) - if(!in) { obj->chnsin = in = 1; } -#endif - if(obj->invecs) delete[] obj->invecs; - obj->invecs = new t_signalvec[in]; + if(in != obj->chnsin) { + if(obj->invecs) delete[] obj->invecs; + obj->invecs = in?new t_signalvec[in]:NULL; + obj->chnsin = in; + } for(i = 0; i < in; ++i) obj->invecs[i] = #if FLEXT_SYS == FLEXT_SYS_JMAX - fts_dsp_get_input_name(dsp,i); + fts_dsp_get_input_name(dsp,i); #else - sp[i]->s_vec; + sp[i]->s_vec; #endif - if(obj->outvecs) delete[] obj->outvecs; - obj->outvecs = new t_signalvec[out]; + if(out != obj->chnsout) { + if(obj->outvecs) delete[] obj->outvecs; + obj->outvecs = out?new t_signalvec[out]:NULL; + obj->chnsout = out; + } for(i = 0; i < out; ++i) obj->outvecs[i] = #if FLEXT_SYS == FLEXT_SYS_JMAX - fts_dsp_get_output_name(dsp,i); + fts_dsp_get_output_name(dsp,i); #else - sp[in+i]->s_vec; + sp[in+i]->s_vec; #endif // with the following call derived classes can do their eventual DSP setup @@ -195,15 +204,9 @@ void flext_dsp::m_signal(int n,t_sample *const * /*insigs*/,t_sample *const *out for(int i = 0; i < CntOutSig(); ++i) ZeroSamples(outs[i],n); } -#if FLEXT_SYS != FLEXT_SYS_MAX - #if FLEXT_SYS == FLEXT_SYS_PD -void flext_dsp::cb_enable(t_class *c,t_float on) { thisObject(c)->m_enable(on != 0); } +void flext_dsp::cb_enable(t_class *c,t_float on) { thisObject(c)->dspon = on != 0; } #elif FLEXT_SYS == FLEXT_SYS_JMAX -void flext_dsp::cb_enable(fts_object_t *c, int winlet, fts_symbol_t s, int ac, const fts_atom_t *at) -{ thisObject(c)->m_enable(fts_get_int(at+0) != 0); } -#endif - -void flext_dsp::m_enable(bool en) { dspon = en; } +void flext_dsp::cb_enable(fts_object_t *c, int winlet, fts_symbol_t s, int ac, const fts_atom_t *at) +{ thisObject(c)->dspon = fts_get_int(at+0) != 0; } #endif - diff --git a/externals/grill/flext/source/fldsp.h b/externals/grill/flext/source/fldsp.h index 80731848..7b7f381a 100644 --- a/externals/grill/flext/source/fldsp.h +++ b/externals/grill/flext/source/fldsp.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -51,14 +51,10 @@ public: //! returns current block (aka vector) size int Blocksize() const { return blksz; } - /*! \brief returns number of audio system input channels - \bug Doesn't work in Max/MSP - is always 0 - */ + //! returns number of input channels int ChannelsIn() const { return chnsin; } - /*! \brief returns number of audio system output channels - \bug Doesn't work in Max/MSP - is always 0 - */ + //! returns number of output channels int ChannelsOut() const { return chnsout; } //! typedef describing a signal vector @@ -93,13 +89,6 @@ public: */ virtual void m_signal(int n,t_sample *const *insigs,t_sample *const *outsigs); -#if FLEXT_SYS != FLEXT_SYS_MAX - /*! \brief called with "enable" message: pauses/resumes dsp - \note PD only - implicitely defined in Max/MSP - */ - virtual void m_enable(bool on); -#endif - //! @} diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp index 1e932360..6509697e 100644 --- a/externals/grill/flext/source/flext.cpp +++ b/externals/grill/flext/source/flext.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -21,6 +21,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. bool flext_base::compatibility = true; flext_base::FLEXT_CLASSDEF(flext_base)(): + indsp(false), inlist(NULL),outlist(NULL), curtag(NULL), incnt(0),outcnt(0), @@ -161,10 +162,13 @@ void flext_base::Setup(t_classid id) #if FLEXT_SYS == FLEXT_SYS_PD && !defined(FLEXT_NOATTREDIT) AddMethod(id,0,"attributedialog",cb_AttrDialog); - SetAttrEditor(id); #endif } +#if FLEXT_SYS == FLEXT_SYS_PD + SetGfx(id); +#endif + SetProxies(c); StartQueue(); diff --git a/externals/grill/flext/source/flinternal.h b/externals/grill/flext/source/flinternal.h index 1a1f0f4b..65ca8ea8 100644 --- a/externals/grill/flext/source/flinternal.h +++ b/externals/grill/flext/source/flinternal.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flitem.cpp b/externals/grill/flext/source/flitem.cpp index 0c3f0f03..92ce01cd 100755 --- a/externals/grill/flext/source/flitem.cpp +++ b/externals/grill/flext/source/flitem.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fllib.cpp b/externals/grill/flext/source/fllib.cpp index 2132ddf2..b7f32592 100755 --- a/externals/grill/flext/source/fllib.cpp +++ b/externals/grill/flext/source/fllib.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flmap.h b/externals/grill/flext/source/flmap.h index 64d4f565..980c2c99 100644 --- a/externals/grill/flext/source/flmap.h +++ b/externals/grill/flext/source/flmap.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flmeth.cpp b/externals/grill/flext/source/flmeth.cpp index e0ecb172..4eceb612 100755 --- a/externals/grill/flext/source/flmeth.cpp +++ b/externals/grill/flext/source/flmeth.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -39,15 +39,14 @@ void flext_base::MethItem::SetArgs(methfun _fun,int _argc,metharg *_args) } -void flext_base::AddMethodDef(int inlet,const char *tag) +void flext_base::AddMethodDef(int inlet,const t_symbol *tag) { - const t_symbol *t = tag?MakeSymbol(tag):NULL; - methhead->Add(new MethItem,t,inlet); + methhead->Add(new MethItem,tag,inlet); } /*! \brief Add a method to the queue */ -void flext_base::AddMethod(ItemCont *ma,int inlet,const char *tag,methfun fun,metharg tp,...) +void flext_base::AddMethod(ItemCont *ma,int inlet,const t_symbol *tag,methfun fun,metharg tp,...) { va_list marker; @@ -60,7 +59,7 @@ void flext_base::AddMethod(ItemCont *ma,int inlet,const char *tag,methfun fun,me if(argc > 0) { if(argc > FLEXT_MAXMETHARGS) { - error("flext - method %s: only %i arguments are type-checkable: use variable argument list for more",tag?tag:"?",FLEXT_MAXMETHARGS); + error("flext - method %s: only %i arguments are type-checkable: use variable argument list for more",tag?GetString(tag):"?",FLEXT_MAXMETHARGS); argc = FLEXT_MAXMETHARGS; } @@ -88,7 +87,7 @@ void flext_base::AddMethod(ItemCont *ma,int inlet,const char *tag,methfun fun,me MethItem *mi = new MethItem; mi->index = ma->Members(); mi->SetArgs(fun,argc,args); - ma->Add(mi,MakeSymbol(tag),inlet); + ma->Add(mi,tag,inlet); } void flext_base::ListMethods(AtomList &la,int inlet) const @@ -123,25 +122,18 @@ void flext_base::ListMethods(AtomList &la,int inlet) const SetSymbol(la[ix++],it.data()); } -bool flext_base::ListMethods(int inlet) const -{ - static const t_symbol *sym_methods = MakeSymbol("methods"); +static const t_symbol *sym_methods = flext::MakeSymbol("methods"); - if(procattr) { +bool flext_base::cb_ListMethods(flext_base *c,int argc,const t_atom *argv) +{ + if(c->procattr && (argc == 0 || (argc == 1 && CanbeInt(argv[0])))) { + int inlet = argc?GetAInt(argv[0]):0; AtomList la; - ListMethods(la,inlet); - ToOutAnything(GetOutAttr(),sym_methods,la.Count(),la.Atoms()); + c->ListMethods(la,inlet); + c->ToOutAnything(c->GetOutAttr(),sym_methods,la.Count(),la.Atoms()); return true; } else return false; } -bool flext_base::cb_ListMethods(flext_base *c,int argc,const t_atom *argv) -{ - if(argc == 0 || (argc == 1 && CanbeInt(argv[0]))) - return c->ListMethods(argc?GetAInt(argv[0]):0); - else - return false; -} - diff --git a/externals/grill/flext/source/flmsg.cpp b/externals/grill/flext/source/flmsg.cpp index 3191edc0..917cc66c 100755 --- a/externals/grill/flext/source/flmsg.cpp +++ b/externals/grill/flext/source/flmsg.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flmspbuffer.h b/externals/grill/flext/source/flmspbuffer.h index 88023806..7810e7bc 100755 --- a/externals/grill/flext/source/flmspbuffer.h +++ b/externals/grill/flext/source/flmspbuffer.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flout.cpp b/externals/grill/flext/source/flout.cpp index 70c940ef..7a2d2e8e 100644 --- a/externals/grill/flext/source/flout.cpp +++ b/externals/grill/flext/source/flout.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -17,14 +17,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include #if FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX - -void flext_base::ToSysBang(int n) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_bang((t_outlet *)o); CRITOFF(); } } -void flext_base::ToSysFloat(int n,float f) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_float((t_outlet *)o,f); CRITOFF(); } } -void flext_base::ToSysInt(int n,int f) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_flint((t_outlet *)o,f); CRITOFF(); } } -void flext_base::ToSysSymbol(int n,const t_symbol *s) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_symbol((t_outlet *)o,const_cast(s)); CRITOFF(); } } -void flext_base::ToSysList(int n,int argc,const t_atom *argv) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_list((t_outlet *)o,const_cast(sym_list),argc,(t_atom *)argv); CRITOFF(); } } -void flext_base::ToSysAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_anything((t_outlet *)o,const_cast(s),argc,(t_atom *)argv); CRITOFF(); } } - void flext_base::ToSysAtom(int n,const t_atom &at) const { outlet *o = GetOut(n); @@ -47,28 +39,18 @@ void flext_base::ToSysAtom(int n,const t_atom &at) const CRITOFF(); } } - -#elif FLEXT_SYS == FLEXT_SYS_JMAX - -void flext_base::ToSysBang(int n) const { fts_outlet_bang((fts_object *)thisHdr(),n); } -void flext_base::ToSysFloat(int n,float f) const { fts_outlet_float((fts_object *)thisHdr(),n,f); } -void flext_base::ToSysInt(int n,int f) const { fts_outlet_int((fts_object *)thisHdr(),n,f); } -void flext_base::ToSysSymbol(int n,const t_symbol *s) const { fts_outlet_symbol((fts_object *)thisHdr(),n,s); } -void flext_base::ToSysList(int n,int argc,const t_atom *argv) const { fts_outlet_send((fts_object *)thisHdr(),n,sym_list,argc,(t_atom *)argv); } -void flext_base::ToSysAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const { fts_outlet_send((fts_object *)thisHdr(),n,const_cast(s),argc,(t_atom *)argv); } - #else #error Not implemented #endif #if defined(FLEXT_THREADS) #if FLEXT_QMODE == 2 - #define CHKTHR() (IsSystemThread() || IsThread(flext::thrmsgid)) + #define CHKTHR() ((IsSystemThread() || IsThread(flext::thrmsgid)) && !InDsp()) #else - #define CHKTHR() IsSystemThread() + #define CHKTHR() (IsSystemThread() && !InDsp()) #endif #else - #define CHKTHR() true + #define CHKTHR() (!InDsp()) #endif void flext_base::ToOutBang(int n) const { if(CHKTHR()) ToSysBang(n); else ToQueueBang(n); } diff --git a/externals/grill/flext/source/flprefix.h b/externals/grill/flext/source/flprefix.h index ba9b4b50..ab09390e 100755 --- a/externals/grill/flext/source/flprefix.h +++ b/externals/grill/flext/source/flprefix.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flproxy.cpp b/externals/grill/flext/source/flproxy.cpp index c2f906b3..ca72faf3 100755 --- a/externals/grill/flext/source/flproxy.cpp +++ b/externals/grill/flext/source/flproxy.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flqueue.cpp b/externals/grill/flext/source/flqueue.cpp index a7a7ceda..e6ec9326 100755 --- a/externals/grill/flext/source/flqueue.cpp +++ b/externals/grill/flext/source/flqueue.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flsimd.cpp b/externals/grill/flext/source/flsimd.cpp index 9ed22de7..7b35903b 100755 --- a/externals/grill/flext/source/flsimd.cpp +++ b/externals/grill/flext/source/flsimd.cpp @@ -1592,3 +1592,58 @@ loopu: #endif } +void flext::ScaleSamples(t_sample *dst,const t_sample *src,t_sample opmul,const t_sample *add,int cnt) +{ + { + int n = cnt>>3; + cnt -= n<<3; + if(dst == add) { + while(n--) { + dst[0] += src[0]*opmul; dst[1] += src[1]*opmul; + dst[2] += src[2]*opmul; dst[3] += src[3]*opmul; + dst[4] += src[4]*opmul; dst[5] += src[5]*opmul; + dst[6] += src[6]*opmul; dst[7] += src[7]*opmul; + src += 8,dst += 8; + } + while(cnt--) *(dst++) += *(src++)*opmul; + } + else { + while(n--) { + dst[0] = src[0]*opmul+add[0]; dst[1] = src[1]*opmul+add[1]; + dst[2] = src[2]*opmul+add[2]; dst[3] = src[3]*opmul+add[3]; + dst[4] = src[4]*opmul+add[4]; dst[5] = src[5]*opmul+add[5]; + dst[6] = src[6]*opmul+add[6]; dst[7] = src[7]*opmul+add[7]; + src += 8,dst += 8,add += 8; + } + while(cnt--) *(dst++) = *(src++)*opmul+*(add++); + } + } +} + +void flext::ScaleSamples(t_sample *dst,const t_sample *src,const t_sample *mul,const t_sample *add,int cnt) +{ + { + int n = cnt>>3; + cnt -= n<<3; + if(dst == add) { + while(n--) { + dst[0] += src[0]*mul[0]; dst[1] += src[1]*mul[1]; + dst[2] += src[2]*mul[2]; dst[3] += src[3]*mul[3]; + dst[4] += src[4]*mul[4]; dst[5] += src[5]*mul[5]; + dst[6] += src[6]*mul[6]; dst[7] += src[7]*mul[7]; + src += 8,dst += 8,mul += 8; + } + while(cnt--) *(dst++) += *(src++) * *(mul++); + } + else { + while(n--) { + dst[0] = src[0]*mul[0]+add[0]; dst[1] = src[1]*mul[1]+add[1]; + dst[2] = src[2]*mul[2]+add[2]; dst[3] = src[3]*mul[3]+add[3]; + dst[4] = src[4]*mul[4]+add[4]; dst[5] = src[5]*mul[5]+add[5]; + dst[6] = src[6]*mul[6]+add[6]; dst[7] = src[7]*mul[7]+add[7]; + src += 8,dst += 8,mul += 8,add += 8; + } + while(cnt--) *(dst++) = *(src++)* *(mul++) + *(add++); + } + } +} diff --git a/externals/grill/flext/source/flsndobj.cpp b/externals/grill/flext/source/flsndobj.cpp index 48b45096..830a7b46 100644 --- a/externals/grill/flext/source/flsndobj.cpp +++ b/externals/grill/flext/source/flsndobj.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flsndobj.h b/externals/grill/flext/source/flsndobj.h index f45080d5..9cff9461 100644 --- a/externals/grill/flext/source/flsndobj.h +++ b/externals/grill/flext/source/flsndobj.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flstk.cpp b/externals/grill/flext/source/flstk.cpp index 24739b28..b3a6204c 100644 --- a/externals/grill/flext/source/flstk.cpp +++ b/externals/grill/flext/source/flstk.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flstk.h b/externals/grill/flext/source/flstk.h index a610e9c6..7f15edd9 100644 --- a/externals/grill/flext/source/flstk.h +++ b/externals/grill/flext/source/flstk.h @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index 9eec7abd..1c19f546 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2004 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index 71332f6b..8d6b5d3d 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -353,6 +353,9 @@ public: static const t_symbol *sym_signal; #endif + //! \note This is used in macros where the type of the arg is not clear + static const t_symbol *MakeSymbol(const t_symbol *s) { return s; } + #if FLEXT_SYS == FLEXT_SYS_JMAX //! Make a symbol from a string static const t_symbol *MakeSymbol(const char *s) { return ::fts_new_symbol(s); } @@ -1150,6 +1153,8 @@ public: static void AddSamples(t_sample *dst,const t_sample *src,t_sample add,int cnt); static void AddSamples(t_sample *dst,const t_sample *src,const t_sample *add,int cnt); static void ScaleSamples(t_sample *dst,const t_sample *src,t_sample mul,t_sample add,int cnt); + static void ScaleSamples(t_sample *dst,const t_sample *src,t_sample mul,const t_sample *add,int cnt); + static void ScaleSamples(t_sample *dst,const t_sample *src,const t_sample *mul,const t_sample *add,int cnt); //! @} FLEXT_S_SIMD diff --git a/externals/grill/flext/source/flthr.cpp b/externals/grill/flext/source/flthr.cpp index fe70dfdd..0750dd83 100644 --- a/externals/grill/flext/source/flthr.cpp +++ b/externals/grill/flext/source/flthr.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/fltimer.cpp b/externals/grill/flext/source/fltimer.cpp index 9cab8e90..c317df45 100755 --- a/externals/grill/flext/source/fltimer.cpp +++ b/externals/grill/flext/source/fltimer.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flutil.cpp b/externals/grill/flext/source/flutil.cpp index 2e80b6e6..b4aba60c 100644 --- a/externals/grill/flext/source/flutil.cpp +++ b/externals/grill/flext/source/flutil.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. diff --git a/externals/grill/flext/source/flxlet.cpp b/externals/grill/flext/source/flxlet.cpp index f3afb207..b3ef7f86 100755 --- a/externals/grill/flext/source/flxlet.cpp +++ b/externals/grill/flext/source/flxlet.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. -- cgit v1.2.1