aboutsummaryrefslogtreecommitdiff
path: root/externals
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-05-13 02:34:30 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-05-13 02:34:30 +0000
commitc275b9ecc894ad21159f10873c39bb0195f01eb8 (patch)
tree286970cca5fd58ef067fb8b4d1239d52c2778b58 /externals
parent9c0e19a3be2288db79e2502e5fa450c3e20a668d (diff)
""
svn path=/trunk/; revision=615
Diffstat (limited to 'externals')
-rw-r--r--externals/grill/flext/changes.txt8
-rw-r--r--externals/grill/flext/flext.cwbin572771 -> 755733 bytes
-rw-r--r--externals/grill/flext/source/flattr.cpp2
-rw-r--r--externals/grill/flext/source/flbind.cpp26
-rw-r--r--externals/grill/flext/source/flclass.h51
-rw-r--r--externals/grill/flext/source/fldefs_methbind.h7
-rw-r--r--externals/grill/flext/source/fldsp.cpp12
-rw-r--r--externals/grill/flext/source/flsupport.cpp3
-rw-r--r--externals/grill/flext/source/flsupport.h13
-rw-r--r--externals/grill/vasp/vasp.cwbin356360 -> 356360 bytes
-rwxr-xr-xexternals/grill/xsample/xsample.cwbin280733 -> 280733 bytes
11 files changed, 92 insertions, 30 deletions
diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt
index 21777ed2..c4405bc9 100644
--- a/externals/grill/flext/changes.txt
+++ b/externals/grill/flext/changes.txt
@@ -20,7 +20,10 @@ Version history:
- added flext_base::ToSelf* methods for queued (deferred) self messaging
- deleted flext::buffer console outputs for undefined arrays/buffer~s: should be done by externals
- a few changes for the flext shared library
-- tiny update for PD 0.37 header usage
+- tiny update for PD 0.37 header file usage
+- fixed a bug associated to attribute argument lists
+- added functions for version number and string (flext::Version and flext::VerStr, mainly for usage of a shared flext library)
+- flext_base::UnbindMethod returns user data
0.4.3:
- added forgotten flext_base::ToQueueString method
@@ -247,7 +250,7 @@ general:
- documentation
- add log messages for debugging version
- MaxMSP: how to call separate help files for objects in a library? -> object mappings (in OSX)
-- use PD's t_float type for floating point values (and what about t_int?)
+- use PD's t_float and t_int types (or comparable for 32-Bit safety)
bugs:
- PD: problems with timed buffer redrawing (takes a lot of cpu time)
@@ -257,7 +260,6 @@ bugs:
tests:
- PD: figure out what "pointer" messages do and where they occur
-- some more mutexes needed for thread safety?
- buffer resize: flext_base::buffer::Frames(): should we use buffer or system sample rate?
- what about FLEXT_ADDMETHOD_V (for var arg lists) and FLEXT_ADDMETHOD_A (anythings)... nonsense?
diff --git a/externals/grill/flext/flext.cw b/externals/grill/flext/flext.cw
index ba92d4ea..d52eaaba 100644
--- a/externals/grill/flext/flext.cw
+++ b/externals/grill/flext/flext.cw
Binary files differ
diff --git a/externals/grill/flext/source/flattr.cpp b/externals/grill/flext/source/flattr.cpp
index 8b5ede86..0cdc74c9 100644
--- a/externals/grill/flext/source/flattr.cpp
+++ b/externals/grill/flext/source/flattr.cpp
@@ -44,7 +44,7 @@ void flext_base::AddAttrib(itemarr *aa,itemarr *ma,const char *attr,metharg tp,m
// bind attribute to a method
methitem *mi = new methitem(0,asym,a);
- mi->SetArgs(sfun,1,&tp);
+ mi->SetArgs(sfun,1,new metharg(tp));
ma->Add(mi);
}
diff --git a/externals/grill/flext/source/flbind.cpp b/externals/grill/flext/source/flbind.cpp
index fe1846e2..53f041c6 100644
--- a/externals/grill/flext/source/flbind.cpp
+++ b/externals/grill/flext/source/flbind.cpp
@@ -77,6 +77,18 @@ flext_base::binditem::~binditem()
}
}
+#if FLEXT_SYS == FLEXT_SYS_PD
+ //! Bind object to a symbol
+ bool flext_base::Bind(const t_symbol *sym) { pd_bind(&thisHdr()->ob_pd,const_cast<t_symbol *>(sym)); return true; }
+ //! Unbind object from a symbol
+ bool flext_base::Unbind(const t_symbol *sym) { pd_unbind(&thisHdr()->ob_pd,const_cast<t_symbol *>(sym)); return true; }
+#elif FLEXT_SYS == FLEXT_SYS_MAX
+ //! Bind object to a symbol
+ bool flext_base::Bind(const t_symbol *sym) { if(sym->s_thing) return false; else { const_cast<t_symbol *>(sym)->s_thing = (t_object *)thisHdr(); return true; } }
+ //! Unbind object from a symbol
+ bool flext_base::Unbind(const t_symbol *sym) { if(sym->s_thing != (t_object *)thisHdr()) return false; else { const_cast<t_symbol *>(sym)->s_thing = NULL; return true; } }
+#endif
+
bool flext_base::BindMethod(const t_symbol *sym,bool (*fun)(flext_base *,t_symbol *s,int argc,t_atom *argv,void *data),void *data)
{
if(!bindhead)
@@ -123,16 +135,18 @@ bool flext_base::BindMethod(const t_symbol *sym,bool (*fun)(flext_base *,t_symbo
}
-bool flext_base::UnbindMethod(const t_symbol *sym)
+bool flext_base::UnbindMethod(const t_symbol *sym,void **data)
{
- item *it = bindhead?bindhead->Find(sym,0):NULL;
+ bool ok = false;
+ binditem *it = bindhead?(binditem *)bindhead->Find(sym,0):NULL;
+ void *d = NULL;
if(it) {
- bool ok = bindhead->Remove(it);
+ d = it->px->data;
+ ok = bindhead->Remove(it);
if(ok) delete it;
- return ok;
}
- else
- return true;
+ if(data) *data = d;
+ return ok;
}
void flext_base::pxbnd_object::px_method(pxbnd_object *c,const t_symbol *s,int argc,t_atom *argv)
diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h
index 676cb4a9..4fa4f614 100644
--- a/externals/grill/flext/source/flclass.h
+++ b/externals/grill/flext/source/flclass.h
@@ -391,37 +391,48 @@ public:
#if FLEXT_SYS == FLEXT_SYS_PD
//! Bind object to a symbol
- bool Bind(const t_symbol *s) { pd_bind(&thisHdr()->ob_pd,const_cast<t_symbol *>(s)); return true; }
+ bool Bind(const t_symbol *sym);
//! Unbind object from a symbol
- bool Unbind(const t_symbol *s) { pd_unbind(&thisHdr()->ob_pd,const_cast<t_symbol *>(s)); return true; }
-#elif FLEXT_SYS == FLEXT_SYS_MAX
- //! Bind object to a symbol
- bool Bind(const t_symbol *s) { if(s->s_thing) return false; else { const_cast<t_symbol *>(s)->s_thing = (t_object *)thisHdr(); return true; } }
- //! Unbind object from a symbol
- bool Unbind(const t_symbol *s) { if(s->s_thing != (t_object *)thisHdr()) return false; else { const_cast<t_symbol *>(s)->s_thing = NULL; return true; } }
+ bool Unbind(const t_symbol *sym);
#endif
#if FLEXT_SYS == FLEXT_SYS_JMAX
//! Bind object to a symbol (as string)
- bool Bind(const char *c); // ** TODO **
+ bool Bind(const char *sym); // ** TODO **
//! Unbind object from a symbol (as string)
- bool Unbind(const char *c); // ** TODO **
+ bool Unbind(const char *sym); // ** TODO **
#else
//! Bind object to a symbol (as string)
- bool Bind(const char *c) { return Bind(MakeSymbol(c)); }
+ bool Bind(const char *sym) { return Bind(MakeSymbol(sym)); }
//! Unbind object from a symbol (as string)
- bool Unbind(const char *c) { return Unbind(MakeSymbol(c)); }
+ bool Unbind(const char *sym) { return Unbind(MakeSymbol(sym)); }
#endif
- //! Bind a method to a symbol
- bool BindMethod(const t_symbol *s,bool (*m)(flext_base *,t_symbol *s,int argc,t_atom *argv,void *data),void *data = NULL);
- //! Unbind a method from a symbol
- bool UnbindMethod(const t_symbol *s);
-
- //! Bind a method to a symbol (as string)
- bool BindMethod(const char *c,bool (*m)(flext_base *,t_symbol *s,int argc,t_atom *argv,void *data),void *data = NULL) { return BindMethod(MakeSymbol(c),m,data); }
- //! Unbind a method from a symbol (as string)
- bool UnbindMethod(const char *c) { return UnbindMethod(MakeSymbol(c)); }
+ /*! \brief Bind a method to a symbol
+ \param sym Symbol to bind to
+ \param meth Function to bind
+ \param data User data that is passed to the function
+ \return true on success
+ */
+ bool BindMethod(const t_symbol *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data),void *data = NULL);
+ /*! \brief Unbind a method from a symbol
+ \param data returns data pointer specified with BindMethod
+ \return true on success
+ */
+ bool UnbindMethod(const t_symbol *sym,void **data = NULL);
+
+ /*! \brief Bind a method to a symbol (as string)
+ \param sym Symbol to bind to
+ \param meth Function to bind
+ \param data User data that is passed to the function
+ \return true on success
+ */
+ bool BindMethod(const char *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data),void *data = NULL) { return BindMethod(MakeSymbol(sym),meth,data); }
+ /*! \brief Unbind a method from a symbol (as string)
+ \param data returns data pointer specified with BindMethod
+ \return true on success
+ */
+ bool UnbindMethod(const char *sym,void **data = NULL) { return UnbindMethod(MakeSymbol(sym),data); }
//! @} FLEXT_C_BIND
diff --git a/externals/grill/flext/source/fldefs_methbind.h b/externals/grill/flext/source/fldefs_methbind.h
index 977e22f8..70b29300 100644
--- a/externals/grill/flext/source/fldefs_methbind.h
+++ b/externals/grill/flext/source/fldefs_methbind.h
@@ -34,6 +34,13 @@ BindMethod(SYM,FLEXT_CALL_PRE(M_FUN),DATA)
\
UnbindMethod(SYM)
+/*! \brief Unbind any handler for a method from a symbol and return user data pointer by DATA
+ \note Memory associated to the DATA parameter of FLEXT_BINDMETHOD will *not* be freed here.
+*/
+#define FLEXT_UNBINDMETHOD_X(SYM,DATA) \
+\
+UnbindMethod(SYM,&DATA)
+
//! @} FLEXT_D_BINDMETHOD
diff --git a/externals/grill/flext/source/fldsp.cpp b/externals/grill/flext/source/fldsp.cpp
index 2c33387f..252f2da7 100644
--- a/externals/grill/flext/source/fldsp.cpp
+++ b/externals/grill/flext/source/fldsp.cpp
@@ -79,8 +79,18 @@ flext_dsp::~flext_dsp()
#if FLEXT_SYS == FLEXT_SYS_JMAX
fts_dsp_object_delete(thisHdr());
#endif
+
+/*
+#if FLEXT_SYS == FLEXT_SYS_MAX
+ // switch off dsp as the dsp function might get called afterwards (?!)
+ thisHdr()->z_disabled = true;
+
if(invecs) delete[] invecs;
if(outvecs) delete[] outvecs;
+#elif FLEXT_SYS == FLEXT_SYS_PD
+ dspon = false;
+#endif
+*/
}
#if FLEXT_SYS == FLEXT_SYS_JMAX
@@ -91,6 +101,7 @@ void flext_dsp::dspmeth(fts_word_t *w)
t_int *flext_dsp::dspmeth(t_int *w)
{
flext_dsp *obj = (flext_dsp *)w[1];
+/*
#ifdef FLEXT_DEBUG
if(!obj->thisHdr()) {
// object is already deleted!
@@ -98,6 +109,7 @@ t_int *flext_dsp::dspmeth(t_int *w)
return w+3;
}
#endif
+*/
#if FLEXT_SYS == FLEXT_SYS_MAX
if(!obj->thisHdr()->z_disabled)
#else
diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp
index 26ddc51f..20474812 100644
--- a/externals/grill/flext/source/flsupport.cpp
+++ b/externals/grill/flext/source/flsupport.cpp
@@ -29,6 +29,9 @@ const t_symbol *flext::sym_anything = NULL;
const t_symbol *flext::sym_signal = NULL;
#endif
+int flext::Version() { return FLEXT_VERSION; }
+const char *flext::VersionStr() { return FLEXT_VERSTR; }
+
void flext::Setup()
{
static bool issetup = false;
diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h
index f4b81c58..2235e854 100644
--- a/externals/grill/flext/source/flsupport.h
+++ b/externals/grill/flext/source/flsupport.h
@@ -38,6 +38,19 @@ class FLEXT_SHARE flext {
*/
public:
+// --- version -----------------------------------------------
+
+ /*! \brief Flext version number
+
+ Return the version number of the flext library.
+ For statically linked flext this is identical to the header definition FLEXT_VERSION,
+ otherwise it reflects the version number of the shared flext library.
+ */
+ static int Version();
+
+ //! Flext version string
+ static const char *VersionStr();
+
// --- console output -----------------------------------------------
#if FLEXT_SYS == FLEXT_SYS_JMAX
diff --git a/externals/grill/vasp/vasp.cw b/externals/grill/vasp/vasp.cw
index 4d44555f..e45ae977 100644
--- a/externals/grill/vasp/vasp.cw
+++ b/externals/grill/vasp/vasp.cw
Binary files differ
diff --git a/externals/grill/xsample/xsample.cw b/externals/grill/xsample/xsample.cw
index c26c417f..af146954 100755
--- a/externals/grill/xsample/xsample.cw
+++ b/externals/grill/xsample/xsample.cw
Binary files differ