Commit 7003b2dc authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@318 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent e8f9850f
...@@ -212,6 +212,10 @@ SOURCE=.\source\flstdc.h ...@@ -212,6 +212,10 @@ SOURCE=.\source\flstdc.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\source\flsupport.cpp
# End Source File
# Begin Source File
SOURCE=.\source\flsupport.h SOURCE=.\source\flsupport.h
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -20,6 +20,7 @@ Package files: ...@@ -20,6 +20,7 @@ Package files:
- flclass.h,flext.cpp: actual base classes for message (flext_base) and dsp (flext_dsp) processing - flclass.h,flext.cpp: actual base classes for message (flext_base) and dsp (flext_dsp) processing
- fldsp.h,fldsp.cpp: code for signal externals - fldsp.h,fldsp.cpp: code for signal externals
- flthr.h,flthr.cpp: code for threaded methods - flthr.h,flthr.cpp: code for threaded methods
- flsupport.h: various flext support functions and classes
- flatom.cpp: code for functions dealing with lists of atoms - flatom.cpp: code for functions dealing with lists of atoms
- flutil.cpp: additional utility functions - flutil.cpp: additional utility functions
- flxlet.cpp: code for variable inlet/outlet stuff - flxlet.cpp: code for variable inlet/outlet stuff
...@@ -66,6 +67,7 @@ pros: ...@@ -66,6 +67,7 @@ pros:
- any input to any inlet (with the exception of signal streams) - any input to any inlet (with the exception of signal streams)
- transparent use of threads for methods - transparent use of threads for methods
- libraries of externals in MaxMSP - libraries of externals in MaxMSP
- more than 3 typed creation arguments possible for MaxMSP
cons: cons:
- introduces a small overhead to speed of message handling - introduces a small overhead to speed of message handling
...@@ -80,6 +82,7 @@ Version history: ...@@ -80,6 +82,7 @@ Version history:
0.4.0: 0.4.0:
- introduced a flext namespace instead of using numerous static class functions (better isolation of functions, easier usage of flext functions outside inherited flext classes) - introduced a flext namespace instead of using numerous static class functions (better isolation of functions, easier usage of flext functions outside inherited flext classes)
- completely redesigned class and object setup -> all argument checking is now handled by flext
- added OSX/darwin support (originally done by Adam T. Lindsay) - added OSX/darwin support (originally done by Adam T. Lindsay)
- SndObj interface now also available for cygwin and BCC - SndObj interface now also available for cygwin and BCC
- added prepend and append functions to AtomList class - added prepend and append functions to AtomList class
......
...@@ -14,23 +14,23 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -14,23 +14,23 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h" #include "flext.h"
namespace flext { //namespace flext {
AtomList::AtomList(int argc,const t_atom *argv): flext::AtomList::AtomList(int argc,const t_atom *argv):
lst(NULL),cnt(0) lst(NULL),cnt(0)
{ {
operator()(argc,argv); operator()(argc,argv);
} }
AtomList::AtomList(const AtomList &a): flext::AtomList::AtomList(const AtomList &a):
lst(NULL),cnt(0) lst(NULL),cnt(0)
{ {
operator =(a); operator =(a);
} }
AtomList::~AtomList() { Clear(); } flext::AtomList::~AtomList() { Clear(); }
AtomList &AtomList::operator()(int argc,const t_atom *argv) flext::AtomList &flext::AtomList::operator()(int argc,const t_atom *argv)
{ {
if(lst && cnt != argc) { delete[] lst; lst = NULL; cnt = 0; } if(lst && cnt != argc) { delete[] lst; lst = NULL; cnt = 0; }
...@@ -72,7 +72,7 @@ AtomList &AtomList::operator()(int argc,const t_atom *argv) ...@@ -72,7 +72,7 @@ AtomList &AtomList::operator()(int argc,const t_atom *argv)
} }
AtomList &AtomList::Append(const t_atom &a) flext::AtomList &flext::AtomList::Append(const t_atom &a)
{ {
t_atom *nlst = new t_atom[cnt+1]; t_atom *nlst = new t_atom[cnt+1];
for(int i = 0; i < cnt; ++i) SetAtom(nlst[i],lst[i]); for(int i = 0; i < cnt; ++i) SetAtom(nlst[i],lst[i]);
...@@ -85,7 +85,7 @@ AtomList &AtomList::Append(const t_atom &a) ...@@ -85,7 +85,7 @@ AtomList &AtomList::Append(const t_atom &a)
return *this; return *this;
} }
AtomList &AtomList::Append(int argc,const t_atom *argv) flext::AtomList &flext::AtomList::Append(int argc,const t_atom *argv)
{ {
t_atom *nlst = new t_atom[cnt+argc]; t_atom *nlst = new t_atom[cnt+argc];
int i; int i;
...@@ -99,7 +99,7 @@ AtomList &AtomList::Append(int argc,const t_atom *argv) ...@@ -99,7 +99,7 @@ AtomList &AtomList::Append(int argc,const t_atom *argv)
return *this; return *this;
} }
AtomList &AtomList::Prepend(const t_atom &a) flext::AtomList &flext::AtomList::Prepend(const t_atom &a)
{ {
t_atom *nlst = new t_atom[cnt+1]; t_atom *nlst = new t_atom[cnt+1];
for(int i = 0; i < cnt; ++i) SetAtom(nlst[i+1],lst[i]); for(int i = 0; i < cnt; ++i) SetAtom(nlst[i+1],lst[i]);
...@@ -112,7 +112,7 @@ AtomList &AtomList::Prepend(const t_atom &a) ...@@ -112,7 +112,7 @@ AtomList &AtomList::Prepend(const t_atom &a)
return *this; return *this;
} }
AtomList &AtomList::Prepend(int argc,const t_atom *argv) flext::AtomList &flext::AtomList::Prepend(int argc,const t_atom *argv)
{ {
t_atom *nlst = new t_atom[cnt+argc]; t_atom *nlst = new t_atom[cnt+argc];
int i; int i;
...@@ -126,7 +126,7 @@ AtomList &AtomList::Prepend(int argc,const t_atom *argv) ...@@ -126,7 +126,7 @@ AtomList &AtomList::Prepend(int argc,const t_atom *argv)
return *this; return *this;
} }
AtomList AtomList::GetPart(int offs,int len) const flext::AtomList flext::AtomList::GetPart(int offs,int len) const
{ {
if(offs+len > Count()) { if(offs+len > Count()) {
len = Count()-offs; len = Count()-offs;
...@@ -136,4 +136,4 @@ AtomList AtomList::GetPart(int offs,int len) const ...@@ -136,4 +136,4 @@ AtomList AtomList::GetPart(int offs,int len) const
return AtomList(len,Atoms()+offs); return AtomList(len,Atoms()+offs);
} }
} // namespace flext //} // namespace flext
...@@ -16,6 +16,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -16,6 +16,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flbase.h" #include "flbase.h"
#include "flinternal.h" #include "flinternal.h"
#include <string.h>
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
// //
...@@ -33,7 +34,7 @@ const char *flext_obj::m_holdname; ...@@ -33,7 +34,7 @@ const char *flext_obj::m_holdname;
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
flext_obj :: flext_obj() flext_obj :: flext_obj()
: x_obj(m_holder) : x_obj(m_holder)
, m_name(flext::strdup(m_holdname)) , m_name(flext_util::strdup(m_holdname))
, init_ok(true) , init_ok(true)
{ {
#ifdef PD #ifdef PD
...@@ -54,6 +55,22 @@ flext_obj :: ~flext_obj() ...@@ -54,6 +55,22 @@ flext_obj :: ~flext_obj()
} }
void flext_obj::DefineHelp(t_class *c,const char *ref,const char *dir,bool addtilde)
{
#ifdef PD
char tmp[256];
if(dir) {
strcpy(tmp,dir);
strcat(tmp,"/");
strcat(tmp,ref);
if(addtilde) strcat(tmp,"~");
}
else
strcpy(tmp,ref);
::class_sethelpsymbol(c,gensym(const_cast<char *>(tmp)));
#else
#endif
}
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
......
...@@ -18,6 +18,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -18,6 +18,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define __FLEXT_BASE_H #define __FLEXT_BASE_H
#include "flstdc.h" #include "flstdc.h"
#include "flsupport.h"
#ifdef FLEXT_THREADS #ifdef FLEXT_THREADS
#include <pthread.h> #include <pthread.h>
...@@ -84,7 +85,8 @@ struct FLEXT_EXT flext_hdr ...@@ -84,7 +85,8 @@ struct FLEXT_EXT flext_hdr
*/ */
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class FLEXT_EXT flext_obj class FLEXT_EXT flext_obj:
public flext
{ {
public: public:
...@@ -126,6 +128,19 @@ class FLEXT_EXT flext_obj ...@@ -126,6 +128,19 @@ class FLEXT_EXT flext_obj
void InitProblem() { init_ok = false; } void InitProblem() { init_ok = false; }
// --- help -------------------------------------------------------
/*! \defgroup FLEXT_C_HELP Flext help/assistance functionality
@{
*/
static void DefineHelp(t_class *c,const char *ref,const char *dir = NULL,bool addtilde = false);
void DefineHelp(const char *ref,const char *dir = NULL,bool addtilde = false) { DefineHelp(thisClass(),ref,dir,addtilde); }
//! @}
protected: protected:
//! The object header //! The object header
...@@ -169,7 +184,8 @@ class FLEXT_EXT flext_obj ...@@ -169,7 +184,8 @@ class FLEXT_EXT flext_obj
static t_class *lib_class; static t_class *lib_class;
static t_symbol *lib_name; static t_symbol *lib_name;
static void libfun_add(const char *name,t_newmethod newfun,void (*freefun)(flext_hdr *),int argtp1,...); static void libfun_add(bool lib,bool dsp,t_class *&clss,const char *name,void setupfun(t_class *),t_newmethod newfun,void (*freefun)(flext_hdr *),int argtp1,...);
// static void libfun_add(const char *name,t_newmethod newfun,void (*freefun)(flext_hdr *),int argtp1,...);
static flext_hdr *libfun_new(t_symbol *s,int argc,t_atom *argv); static flext_hdr *libfun_new(t_symbol *s,int argc,t_atom *argv);
static void libfun_free(flext_hdr *o); static void libfun_free(flext_hdr *o);
//@} //@}
...@@ -180,7 +196,7 @@ class FLEXT_EXT flext_obj ...@@ -180,7 +196,7 @@ class FLEXT_EXT flext_obj
//@{ //@{
//! Some utility functions for class setup //! Some utility functions for class setup
namespace flext { namespace flext_util {
const char *extract(const char *name,int ix = 0); const char *extract(const char *name,int ix = 0);
char *strdup(const char *name); char *strdup(const char *name);
bool chktilde(const char *name); bool chktilde(const char *name);
...@@ -227,11 +243,15 @@ static inline NEW_CLASS *thisObject(void *c) { return FLEXT_CAST<NEW_CLASS *>((( ...@@ -227,11 +243,15 @@ static inline NEW_CLASS *thisObject(void *c) { return FLEXT_CAST<NEW_CLASS *>(((
#define FLEXT_STPF(NAME,OTP) FLEXT_STPF_(OTP)(NAME) #define FLEXT_STPF(NAME,OTP) FLEXT_STPF_(OTP)(NAME)
#define REAL_NEW(NAME,NEW_CLASS,DSP) REAL_INST(0,NAME,NEW_CLASS,DSP) #define REAL_NEW(NAME,NEW_CLASS,DSP,LIB) REAL_INST(LIB,NAME,NEW_CLASS,DSP)
#define REAL_NEW_V(NAME,NEW_CLASS,DSP) REAL_INST_V(0,NAME,NEW_CLASS,DSP) #define REAL_NEW_V(NAME,NEW_CLASS,DSP,LIB) REAL_INST_V(LIB,NAME,NEW_CLASS,DSP)
#define REAL_NEW_1(NAME,NEW_CLASS,DSP,TYPE1) REAL_INST_1(0,NAME,NEW_CLASS,DSP,TYPE1) #define REAL_NEW_1(NAME,NEW_CLASS,DSP,LIB,TYPE1) REAL_INST_1(LIB,NAME,NEW_CLASS,DSP,TYPE1)
#define REAL_NEW_2(NAME,NEW_CLASS,DSP,TYPE1,TYPE2) REAL_INST_2(0,NAME,NEW_CLASS,DSP,TYPE1,TYPE2) #define REAL_NEW_2(NAME,NEW_CLASS,DSP,LIB,TYPE1,TYPE2) REAL_INST_2(LIB,NAME,NEW_CLASS,DSP,TYPE1,TYPE2)
#define REAL_NEW_3(NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3) REAL_INST_3(0,NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3) #define REAL_NEW_3(NAME,NEW_CLASS,DSP,LIB,TYPE1,TYPE2,TYPE3) REAL_INST_3(LIB,NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3)
#define REAL_NEW_4(NAME,NEW_CLASS,DSP,LIB,TYPE1,TYPE2,TYPE3,TYPE4) REAL_INST_4(LIB,NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3,TYPE4)
/* // 0.4.0
#ifdef PD #ifdef PD
#define REAL_EXT(NEW_CLASS,DSP) #define REAL_EXT(NEW_CLASS,DSP)
...@@ -249,6 +269,14 @@ static inline NEW_CLASS *thisObject(void *c) { return FLEXT_CAST<NEW_CLASS *>((( ...@@ -249,6 +269,14 @@ static inline NEW_CLASS *thisObject(void *c) { return FLEXT_CAST<NEW_CLASS *>(((
#define REAL_LIB_3(NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3) REAL_NEWLIB_3(NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3) #define REAL_LIB_3(NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3) REAL_NEWLIB_3(NAME,NEW_CLASS,DSP,TYPE1,TYPE2,TYPE3)
#endif #endif
*/
#ifdef PD
#define REAL_EXT(NEW_CLASS,DSP)
#else // MAXMSP
#define REAL_EXT(NEW_CLASS,DSP) extern "C" FLEXT_EXT int main() { FLEXT_STPF(NEW_CLASS,DSP)(); return 0; }
#endif
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
...@@ -258,7 +286,7 @@ static inline NEW_CLASS *thisObject(void *c) { return FLEXT_CAST<NEW_CLASS *>((( ...@@ -258,7 +286,7 @@ static inline NEW_CLASS *thisObject(void *c) { return FLEXT_CAST<NEW_CLASS *>(((
// --------------------------------------------------- // ---------------------------------------------------
#define FLEXT_EXP_0 extern "C" FLEXT_EXT #define FLEXT_EXP_0 extern "C" FLEXT_EXT
#define FLEXT_EXP_1 #define FLEXT_EXP_1
#define FLEXT_EXP(LIB) FLEXT_EXP_##LIB #define FLEXT_EXP(LIB) FLEXT_EXP_##LIB
#define FLEXT_SETUP(cl) \ #define FLEXT_SETUP(cl) \
...@@ -318,6 +346,8 @@ return 0; \ ...@@ -318,6 +346,8 @@ return 0; \
#define CALLBTP(TP) CALLBTYPE_ ## TP #define CALLBTP(TP) CALLBTYPE_ ## TP
#if 0 // 0.4.0
#ifdef PD #ifdef PD
#define FLEXT_NEWFN ::class_new #define FLEXT_NEWFN ::class_new
#define FLEXT_CLREF(NAME,CLASS) gensym(const_cast<char *>(NAME)) #define FLEXT_CLREF(NAME,CLASS) gensym(const_cast<char *>(NAME))
...@@ -349,6 +379,8 @@ return 0; \ ...@@ -349,6 +379,8 @@ return 0; \
#endif #endif
#endif // 0.4.0
#define ARGMEMBER_int i //* #define ARGMEMBER_int i //*
#define ARGMEMBER_float f #define ARGMEMBER_float f
#define ARGMEMBER_t_symptr s #define ARGMEMBER_t_symptr s
...@@ -359,6 +391,8 @@ return 0; \ ...@@ -359,6 +391,8 @@ return 0; \
//#define EXTPROTO_1 //#define EXTPROTO_1
//#define EXTPROTO(LIB) EXTPROTO_ ## LIB //#define EXTPROTO(LIB) EXTPROTO_ ## LIB
#if 0 // 0.4.0
#ifdef _DEBUG #ifdef _DEBUG
#define CHECK_TILDE(OBJNAME,DSP) if(DSP) flext::chktilde(OBJNAME) #define CHECK_TILDE(OBJNAME,DSP) if(DSP) flext::chktilde(OBJNAME)
#else #else
...@@ -393,6 +427,8 @@ return 0; \ ...@@ -393,6 +427,8 @@ return 0; \
#define FLEXT_CLOPTS(NEW_CLASS,OTP) NULL #define FLEXT_CLOPTS(NEW_CLASS,OTP) NULL
#endif #endif
#endif // 0.4.0
// ---------------------------------------------------- // ----------------------------------------------------
// These should never be called or used directly!!! // These should never be called or used directly!!!
// //
...@@ -400,6 +436,8 @@ return 0; \ ...@@ -400,6 +436,8 @@ return 0; \
// ---------------------------------------------------- // ----------------------------------------------------
#if 0
// ---------------------------------------------------- // ----------------------------------------------------
// no args // no args
// ---------------------------------------------------- // ----------------------------------------------------
...@@ -559,8 +597,8 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \ ...@@ -559,8 +597,8 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \ { \
CHECK_TILDE(NAME,DSP); \ CHECK_TILDE(NAME,DSP); \
NEW_CLASS::__class__ = flext_obj::lib_class; \ NEW_CLASS::__class__ = flext_obj::lib_class; \
flext_obj::libfun_add(NAME,(t_method)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),A_NULL); \ flext_obj::libfun_add(NAME,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),A_NULL); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \ NEW_CLASS::callb_setup(NEW_CLASS::__class__); \
} }
...@@ -727,6 +765,83 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \ ...@@ -727,6 +765,83 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
NEW_CLASS::callb_setup(flext_obj::lib_class); \ NEW_CLASS::callb_setup(flext_obj::lib_class); \
} }
#else
#define REAL_INST(LIB,NAME,NEW_CLASS, DSP) \
t_class * NEW_CLASS::__class__ = NULL; \
static flext_obj *class_ ## NEW_CLASS () \
{ \
return new NEW_CLASS; \
} \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
flext_obj::libfun_add(LIB,DSP,NEW_CLASS::__class__,NAME,NEW_CLASS::callb_setup,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,A_NULL); \
}
#define REAL_INST_V(LIB,NAME,NEW_CLASS, DSP) \
t_class * NEW_CLASS::__class__ = NULL; \
static flext_obj *class_ ## NEW_CLASS (int argc,t_atom *argv) \
{ \
return new NEW_CLASS(argc,argv); \
} \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
flext_obj::libfun_add(LIB,DSP,NEW_CLASS::__class__,NAME,NEW_CLASS::callb_setup,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,A_GIMME,A_NULL); \
}
#define REAL_INST_1(LIB,NAME,NEW_CLASS, DSP, TYPE1) \
t_class * NEW_CLASS::__class__ = NULL; \
static flext_obj *class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1) \
{ \
return new NEW_CLASS(ARGCAST(arg1,TYPE1)); \
} \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
flext_obj::libfun_add(LIB,DSP,NEW_CLASS::__class__,NAME,NEW_CLASS::callb_setup,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),A_NULL); \
}
#define REAL_INST_2(LIB,NAME,NEW_CLASS, DSP, TYPE1,TYPE2) \
t_class * NEW_CLASS::__class__ = NULL; \
static flext_obj *class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1,const flext_obj::lib_arg &arg2) \
{ \
return new NEW_CLASS(ARGCAST(arg1,TYPE1),ARGCAST(arg2,TYPE2)); \
} \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
flext_obj::libfun_add(LIB,DSP,NEW_CLASS::__class__,NAME,NEW_CLASS::callb_setup,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),FLEXTTP(TYPE2),A_NULL); \
}
#define REAL_INST_3(LIB,NAME,NEW_CLASS, DSP, TYPE1, TYPE2, TYPE3) \
t_class * NEW_CLASS::__class__ = NULL; \
static flext_obj *class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1,const flext_obj::lib_arg &arg2,const flext_obj::lib_arg &arg3) \
{ \
return new NEW_CLASS(ARGCAST(arg1,TYPE1),ARGCAST(arg2,TYPE2),ARGCAST(arg3,TYPE3)); \
} \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
flext_obj::libfun_add(LIB,DSP,NEW_CLASS::__class__,NAME,NEW_CLASS::callb_setup,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),FLEXTTP(TYPE2),FLEXTTP(TYPE3),A_NULL); \
}
#define REAL_INST_4(LIB,NAME,NEW_CLASS, DSP, TYPE1,TYPE2, TYPE3, TYPE4) \
t_class * NEW_CLASS::__class__ = NULL; \
static flext_obj *class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1) \
{ \
return new NEW_CLASS(ARGCAST(arg1,TYPE1),ARGCAST(arg2,TYPE2),ARGCAST(arg3,TYPE3),ARGCAST(arg4,TYPE4)); \
} \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
flext_obj::libfun_add(LIB,DSP,NEW_CLASS::__class__,NAME,NEW_CLASS::callb_setup,(t_newmethod)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),FLEXTTP(TYPE2),FLEXTTP(TYPE3),FLEXTTP(TYPE4),A_NULL); \
}
/*
#define REAL_NEWLIB(NAME,NEW_CLASS, DSP) REAL_INST(1,NAME,NEW_CLASS, DSP)
#define REAL_NEWLIB_V(NAME,NEW_CLASS, DSP) REAL_INST_V(1,NAME,NEW_CLASS, DSP)
#define REAL_NEWLIB_1(NAME,NEW_CLASS, DSP,TYPE1) REAL_INST_1(1,NAME,NEW_CLASS, DSP,TYPE1)
#define REAL_NEWLIB_2(NAME,NEW_CLASS, DSP,TYPE1,TYPE2) REAL_INST_2(1,NAME,NEW_CLASS, DSP,TYPE1,TYPE2)
#define REAL_NEWLIB_3(NAME,NEW_CLASS, DSP,TYPE1,TYPE2,TYPE3) REAL_INST_3(1,NAME,NEW_CLASS, DSP,TYPE1,TYPE2,TYPE3)
#define REAL_NEWLIB_4(NAME,NEW_CLASS, DSP,TYPE1,TYPE2,TYPE3,TYPE4) REAL_INST_4(1,NAME,NEW_CLASS, DSP,TYPE1,TYPE2,TYPE3,TYPE4)
*/
#endif
// Shortcuts for method arguments: // Shortcuts for method arguments:
......
...@@ -22,9 +22,9 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -22,9 +22,9 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define DIRTY_INTERVAL 0 // buffer dirty check in msec #define DIRTY_INTERVAL 0 // buffer dirty check in msec
#endif #endif
namespace flext {
buffer::buffer(const t_symbol *bn,bool delayed):
flext::buffer::buffer(const t_symbol *bn,bool delayed):
sym(NULL),data(NULL), sym(NULL),data(NULL),
chns(0),frames(0) chns(0),frames(0)
{ {
...@@ -39,14 +39,14 @@ buffer::buffer(const t_symbol *bn,bool delayed): ...@@ -39,14 +39,14 @@ buffer::buffer(const t_symbol *bn,bool delayed):
if(bn) Set(bn,delayed); if(bn) Set(bn,delayed);
} }
buffer::~buffer() flext::buffer::~buffer()
{ {
#ifdef PD #ifdef PD
clock_free(tick); clock_free(tick);
#endif #endif
} }
int buffer::Set(const t_symbol *s,bool nameonly) int flext::buffer::Set(const t_symbol *s,bool nameonly)
{ {
int ret = 0; int ret = 0;
bool valid = data != NULL; // valid now? (before change) bool valid = data != NULL; // valid now? (before change)
...@@ -115,7 +115,7 @@ int buffer::Set(const t_symbol *s,bool nameonly) ...@@ -115,7 +115,7 @@ int buffer::Set(const t_symbol *s,bool nameonly)
return ret; return ret;
} }
bool buffer::Update() bool flext::buffer::Update()
{ {
if(!Ok()) return false; if(!Ok()) return false;
...@@ -152,7 +152,7 @@ bool buffer::Update() ...@@ -152,7 +152,7 @@ bool buffer::Update()
#endif #endif
} }
void buffer::Frames(int fr,bool keep) void flext::buffer::Frames(int fr,bool keep)
{ {
#ifdef PD #ifdef PD
::garray_resize(arr,(float)fr); ::garray_resize(arr,(float)fr);
...@@ -192,7 +192,7 @@ void buffer::Frames(int fr,bool keep) ...@@ -192,7 +192,7 @@ void buffer::Frames(int fr,bool keep)
#ifdef PD #ifdef PD
void buffer::SetRefrIntv(float intv) void flext::buffer::SetRefrIntv(float intv)
{ {
interval = intv; interval = intv;
if(interval == 0 && ticking) { if(interval == 0 && ticking) {
...@@ -201,11 +201,11 @@ void buffer::SetRefrIntv(float intv) ...@@ -201,11 +201,11 @@ void buffer::SetRefrIntv(float intv)
} }
} }
#else #else
void buffer::SetRefrIntv(float) {} void flext::buffer::SetRefrIntv(float) {}
#endif #endif
void buffer::Dirty(bool force) void flext::buffer::Dirty(bool force)
{ {
if(sym) { if(sym) {
#ifdef PD #ifdef PD
...@@ -236,7 +236,7 @@ void buffer::Dirty(bool force) ...@@ -236,7 +236,7 @@ void buffer::Dirty(bool force)
} }
#ifdef PD #ifdef PD
void buffer::cb_tick(buffer *b) void flext::buffer::cb_tick(buffer *b)
{ {
if(b->arr) garray_redraw(b->arr); if(b->arr) garray_redraw(b->arr);
#ifdef _DEBUG #ifdef _DEBUG
...@@ -253,5 +253,3 @@ void buffer::cb_tick(buffer *b) ...@@ -253,5 +253,3 @@ void buffer::cb_tick(buffer *b)