Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
flext
Commits
37e20c9c
Commit
37e20c9c
authored
Aug 20, 2002
by
thomas
Browse files
no message
git-svn-id:
https://svn.grrrr.org/ext/trunk@254
4d9ac71a-51e6-0310-8455-cad1006bcd31
parent
806bb3aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
flext.dsp
View file @
37e20c9c
...
...
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "pd-msvc\s"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GR /O2 /I "c:\programme\audio\pd\src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /YX /FD /c
# ADD CPP /nologo
/G6
/W3 /GR
-
/O2 /I "c:\programme\audio\pd\src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /YX /FD /c
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe
...
...
@@ -66,7 +66,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\sd"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GR /ZI /Od /I "c:\programme\audio\pd\src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /FR /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GR
-
/ZI /Od /I "c:\programme\audio\pd\src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe
...
...
@@ -89,7 +89,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\td"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GR /ZI /Od /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GR /ZI /Od /I "c:\programme\audio\pd\src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GR
-
/ZI /Od /I "c:\programme\audio\pd\src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe
...
...
@@ -112,7 +112,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\t"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GR /O2 /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GR /O2 /I "c:\programme\audio\pd\src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
# ADD CPP /nologo
/G6
/MT /W3 /GR
-
/O2 /I "c:\programme\audio\pd\src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe
...
...
readme.txt
View file @
37e20c9c
...
...
@@ -189,7 +189,8 @@ Restrictions in compatibility mode:
Porting to new compilers/platforms:
- enums must be int-sized
- compiler must support RTTI and bool type
- compiler must support bool type
- no need of C++ exceptions or RTTI
----------------------------------------------------------------------------
...
...
source/flatom.cpp
View file @
37e20c9c
...
...
@@ -11,7 +11,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
/*! \file flatom.cpp
\brief Definitions for handling the t_atom type and lists thereof.
*/
#include "flext.h"
flext_base
::
AtomList
::
AtomList
(
int
argc
,
const
t_atom
*
argv
)
:
...
...
source/flbase.h
View file @
37e20c9c
...
...
@@ -13,7 +13,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
\remark This is all derived from GEM by Mark Danks
*/
#ifndef __FLEXT_BASE_H
#define __FLEXT_BASE_H
...
...
@@ -115,6 +115,7 @@ class FLEXT_EXT flext_obj
t_canvas
*
thisCanvas
()
{
return
(
m_canvas
);
}
t_sigobj
*
thisHdr
()
{
return
&
x_obj
->
obj
;
}
const
t_sigobj
*
thisHdr
()
const
{
return
&
x_obj
->
obj
;
}
const
char
*
thisName
()
const
{
return
m_name
;
}
#ifdef PD
...
...
@@ -188,9 +189,11 @@ bool fl_chktilde(const char *name);
// These should be used in the header
// ----------------------------------------
//#define FLEXT_CLASSNAME(NEW_CLASS) __class__
#define FLEXT_REALHDR(NEW_CLASS, PARENT_CLASS) \
public: \
static t_class *__class__; \
typedef NEW_CLASS thisType; \
static void callb_free(flext_hdr *hdr) \
{ flext_obj *mydata = hdr->data; delete mydata; \
...
...
@@ -198,11 +201,15 @@ static void callb_free(flext_hdr *hdr) \
static void callb_setup(t_class *classPtr) \
{ PARENT_CLASS::callb_setup(classPtr); } \
protected: \
static NEW_CLASS *thisObject(void *c) { return (NEW_CLASS *)((flext_hdr *)c)->data; }
static inline NEW_CLASS *thisObject(void *c) { return (NEW_CLASS *)((flext_hdr *)c)->data; }
//static inline t_class *thisClass() { return __class__; }
#define FLEXT_REALHDR_S(NEW_CLASS, PARENT_CLASS,SETUPFUN) \
public: \
static t_class *__class__; \
typedef NEW_CLASS thisType; \
static void callb_free(flext_hdr *hdr) \
{ flext_obj *mydata = hdr->data; delete mydata; \
...
...
@@ -211,7 +218,9 @@ static void callb_setup(t_class *classPtr) \
{ PARENT_CLASS::callb_setup(classPtr); \
NEW_CLASS::SETUPFUN(classPtr); } \
protected: \
static NEW_CLASS *thisObject(void *c) { return (NEW_CLASS *)((flext_hdr *)c)->data; }
static inline NEW_CLASS *thisObject(void *c) { return (NEW_CLASS *)((flext_hdr *)c)->data; }
//static inline t_class *thisClass() { return __class__; }
// generate name of dsp/non-dsp setup function
...
...
@@ -391,10 +400,10 @@ return 0; \
// no args
// ----------------------------------------------------
#define REAL_INST(LIB,NAME,NEW_CLASS, DSP) \
static
t_class * NEW_CLASS
##
_class; \
t_class * NEW_CLASS
::_
_class
__ = NULL
; \
flext_hdr* class_ ## NEW_CLASS () \
{ \
flext_hdr *obj = new (newobject(NEW_CLASS
##
_class),(void *)NULL) flext_hdr; \
flext_hdr *obj = new (newobject(NEW_CLASS
::_
_class
__
),(void *)NULL) flext_hdr; \
flext_obj::m_holder = obj; \
flext_obj::m_holdname = fl_extract(NAME); \
obj->data = new NEW_CLASS; \
...
...
@@ -406,8 +415,8 @@ flext_hdr* class_ ## NEW_CLASS () \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS
##
_class = FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
##
_class), \
NEW_CLASS
::_
_class
__
= FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
::_
_class
__
), \
(t_newmethod)class_ ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(flext_hdr), CLNEW_OPTIONS, \
...
...
@@ -416,7 +425,7 @@ FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
const char *c = fl_extract(NAME,ix); if(!c) break; \
FLEXT_ADDALIAS(c,(t_newmethod)class_ ## NEW_CLASS); \
} \
NEW_CLASS::callb_setup(NEW_CLASS
##
_class); \
NEW_CLASS::callb_setup(NEW_CLASS
::_
_class
__
); \
}
#define REAL_NEWLIB(NAME,NEW_CLASS, DSP) \
...
...
@@ -434,6 +443,7 @@ flext_hdr* class_ ## NEW_CLASS () \
void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS::__class__ = flext_obj::lib_class; \
flext_obj::libfun_add(NAME,(t_method)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,A_NULL); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \
}
...
...
@@ -443,10 +453,10 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
// variable arg list
// ----------------------------------------------------
#define REAL_INST_V(LIB,NAME,NEW_CLASS, DSP) \
static
t_class * NEW_CLASS
##
_class; \
t_class * NEW_CLASS
::_
_class
__ = NULL
; \
flext_hdr* class_ ## NEW_CLASS (t_symbol *,int argc,t_atom *argv) \
{ \
flext_hdr *obj = new (newobject(NEW_CLASS
##
_class),(void *)NULL) flext_hdr; \
flext_hdr *obj = new (newobject(NEW_CLASS
::_
_class
__
),(void *)NULL) flext_hdr; \
flext_obj::m_holder = obj; \
flext_obj::m_holdname = fl_extract(NAME); \
obj->data = new NEW_CLASS(argc,argv); \
...
...
@@ -458,8 +468,8 @@ flext_hdr* class_ ## NEW_CLASS (t_symbol *,int argc,t_atom *argv) \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS
##
_class = FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
##
_class), \
NEW_CLASS
::_
_class
__
= FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
::_
_class
__
), \
(t_newmethod)class_ ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(flext_hdr), CLNEW_OPTIONS, \
...
...
@@ -469,7 +479,7 @@ FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
const char *c = fl_extract(NAME,ix); if(!c) break; \
FLEXT_ADDALIAS1(c,(t_newmethod)class_ ## NEW_CLASS,A_GIMME); \
} \
NEW_CLASS::callb_setup(NEW_CLASS
##
_class); \
NEW_CLASS::callb_setup(NEW_CLASS
::_
_class
__
); \
}
#define REAL_NEWLIB_V(NAME,NEW_CLASS, DSP) \
...
...
@@ -487,6 +497,7 @@ flext_hdr* class_ ## NEW_CLASS (t_symbol *,int argc,t_atom *argv) \
void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS::__class__ = flext_obj::lib_class; \
flext_obj::libfun_add(NAME,(t_method)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,A_GIMME,A_NULL); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \
}
...
...
@@ -496,10 +507,10 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
// one arg
// ----------------------------------------------------
#define REAL_INST_1(LIB,NAME,NEW_CLASS, DSP, TYPE1) \
static
t_class * NEW_CLASS
##
_class; \
t_class * NEW_CLASS
::_
_class
__ = NULL
; \
flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1) \
{ \
flext_hdr *obj = new (newobject(NEW_CLASS
##
_class),(void *)NULL) flext_hdr; \
flext_hdr *obj = new (newobject(NEW_CLASS
::_
_class
__
),(void *)NULL) flext_hdr; \
flext_obj::m_holder = obj; \
flext_obj::m_holdname = fl_extract(NAME); \
obj->data = new NEW_CLASS((TYPE1)arg1); \
...
...
@@ -511,8 +522,8 @@ flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1) \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS
##
_class = FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
##
_class), \
NEW_CLASS
::_
_class
__
= FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
::_
_class
__
), \
(t_newmethod)class_ ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(flext_hdr), CLNEW_OPTIONS, \
...
...
@@ -522,7 +533,7 @@ FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
const char *c = fl_extract(NAME,ix); if(!c) break; \
FLEXT_ADDALIAS1(c,(t_newmethod)class_ ## NEW_CLASS,FLEXTTP(TYPE1)); \
} \
NEW_CLASS::callb_setup(NEW_CLASS
##
_class); \
NEW_CLASS::callb_setup(NEW_CLASS
::_
_class
__
); \
}
#define REAL_NEWLIB_1(NAME,NEW_CLASS, DSP,TYPE1) \
...
...
@@ -540,6 +551,7 @@ flext_hdr* class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1) \
void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
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); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \
}
...
...
@@ -549,10 +561,10 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
// two args
// ----------------------------------------------------
#define REAL_INST_2(LIB,NAME,NEW_CLASS, DSP, TYPE1, TYPE2) \
static
t_class * NEW_CLASS
##
_class; \
t_class * NEW_CLASS
::_
_class
__ = NULL
; \
flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1, CALLBTP(TYPE2) arg2) \
{ \
flext_hdr *obj = new (newobject(NEW_CLASS
##
_class),(void *)NULL) flext_hdr; \
flext_hdr *obj = new (newobject(NEW_CLASS
::_
_class
__
),(void *)NULL) flext_hdr; \
flext_obj::m_holder = obj; \
flext_obj::m_holdname = fl_extract(NAME); \
obj->data = new NEW_CLASS((TYPE1)arg1, (TYPE2)arg2); \
...
...
@@ -564,8 +576,8 @@ flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1, CALLBTP(TYPE2) arg2) \
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS
##
_class = FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
##
_class), \
NEW_CLASS
::_
_class
__
= FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
::_
_class
__
), \
(t_newmethod)class_ ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(flext_hdr), CLNEW_OPTIONS, \
...
...
@@ -575,7 +587,7 @@ FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
const char *c = fl_extract(NAME,ix); if(!c) break; \
FLEXT_ADDALIAS2(c,(t_newmethod)class_ ## NEW_CLASS,FLEXTTP(TYPE1),FLEXTTP(TYPE2)); \
} \
NEW_CLASS::callb_setup(NEW_CLASS
##
_class); \
NEW_CLASS::callb_setup(NEW_CLASS
::_
_class
__
); \
}
#define REAL_NEWLIB_2(NAME,NEW_CLASS, DSP,TYPE1, TYPE2) \
...
...
@@ -593,6 +605,7 @@ flext_hdr* class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1,const flext_obj::
void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS::__class__ = flext_obj::lib_class; \
flext_obj::libfun_add(NAME,(t_method)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),FLEXTTP(TYPE2),A_NULL); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \
}
...
...
@@ -602,10 +615,10 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
// three args
// ----------------------------------------------------
#define REAL_INST_3(LIB,NAME,NEW_CLASS, DSP, TYPE1,TYPE2,TYPE3) \
static
t_class * NEW_CLASS
##
_class; \
t_class * NEW_CLASS
::_
_class
__ = NULL
; \
flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1,CALLBTP(TYPE2) arg2,CALLBTP(TYPE3) arg3) \
{ \
flext_hdr *obj = new (newobject(NEW_CLASS
##
_class),(void *)NULL) flext_hdr; \
flext_hdr *obj = new (newobject(NEW_CLASS
::_
_class
__
),(void *)NULL) flext_hdr; \
flext_obj::m_holder = obj; \
flext_obj::m_holdname = fl_extract(NAME); \
obj->data = new NEW_CLASS((TYPE1)arg1,(TYPE2)arg2,(TYPE3)arg3); \
...
...
@@ -617,8 +630,8 @@ flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1,CALLBTP(TYPE2) arg2,CALLBTP(
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS
##
_class = FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
##
_class), \
NEW_CLASS
::_
_class
__
= FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
::_
_class
__
), \
(t_newmethod)class_ ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(flext_hdr), CLNEW_OPTIONS, \
...
...
@@ -628,7 +641,7 @@ FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
const char *c = fl_extract(NAME,ix); if(!c) break; \
FLEXT_ADDALIAS3(c,(t_newmethod)class_ ## NEW_CLASS,FLEXTTP(TYPE1),FLEXTTP(TYPE2),FLEXTTP(TYPE3)); \
} \
NEW_CLASS::callb_setup(NEW_CLASS
##
_class); \
NEW_CLASS::callb_setup(NEW_CLASS
::_
_class
__
); \
}
#define REAL_NEWLIB_3(NAME,NEW_CLASS, DSP,TYPE1,TYPE2,TYPE3) \
...
...
@@ -646,6 +659,7 @@ flext_hdr* class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1,const flext_obj::
void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS::__class__ = flext_obj::lib_class; \
flext_obj::libfun_add(NAME,(t_method)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),FLEXTTP(TYPE2),FLEXTTP(TYPE3),A_NULL); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \
}
...
...
@@ -654,10 +668,10 @@ void FLEXT_STPF(NEW_CLASS,DSP)() \
// four args
// ----------------------------------------------------
#define REAL_INST_4(LIB,NAME,NEW_CLASS, DSP, TYPE1,TYPE2,TYPE3,TYPE4) \
static
t_class * NEW_CLASS
##
_class; \
t_class * NEW_CLASS
::_
_class
__ = NULL
; \
flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1,CALLBTP(TYPE2) arg2,CALLBTP(TYPE3) arg3,CALLBTP(TYPE4) arg4) \
{ \
flext_hdr *obj = new (newobject(NEW_CLASS
##
_class),(void *)NULL) flext_hdr; \
flext_hdr *obj = new (newobject(NEW_CLASS
::_
_class
__
),(void *)NULL) flext_hdr; \
flext_obj::m_holder = obj; \
flext_obj::m_holdname = fl_extract(NAME); \
obj->data = new NEW_CLASS((TYPE1)arg1,(TYPE2)arg2,(TYPE3)arg3,(TYPE4)arg4); \
...
...
@@ -669,8 +683,8 @@ flext_hdr* class_ ## NEW_CLASS (CALLBTP(TYPE1) arg1,CALLBTP(TYPE2) arg2,CALLBTP(
FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS
##
_class = FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
##
_class), \
NEW_CLASS
::_
_class
__
= FLEXT_NEWFN( \
FLEXT_CLREF(fl_extract(NAME),NEW_CLASS
::_
_class
__
), \
(t_newmethod)class_ ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(flext_hdr), CLNEW_OPTIONS, \
...
...
@@ -680,7 +694,7 @@ FLEXT_EXP(LIB) void FLEXT_STPF(NEW_CLASS,DSP)() \
const char *c = fl_extract(NAME,ix); if(!c) break; \
FLEXT_ADDALIAS4(c,(t_newmethod)class_ ## NEW_CLASS,FLEXTTP(TYPE1),FLEXTTP(TYPE2),FLEXTTP(TYPE3),FLEXTTP(TYPE4)); \
} \
NEW_CLASS::callb_setup(NEW_CLASS
##
_class); \
NEW_CLASS::callb_setup(NEW_CLASS
::_
_class
__
); \
}
#define REAL_NEWLIB_4(NAME,NEW_CLASS, DSP,TYPE1,TYPE2,TYPE3,TYPE4) \
...
...
@@ -698,6 +712,7 @@ flext_hdr* class_ ## NEW_CLASS (const flext_obj::lib_arg &arg1,const flext_obj::
void FLEXT_STPF(NEW_CLASS,DSP)() \
{ \
CHECK_TILDE(NAME,DSP); \
NEW_CLASS::__class__ = flext_obj::lib_class; \
flext_obj::libfun_add(NAME,(t_method)(class_ ## NEW_CLASS),&NEW_CLASS::callb_free,FLEXTTP(TYPE1),FLEXTTP(TYPE2),FLEXTTP(TYPE3),FLEXTTP(TYPE4),A_NULL); \
NEW_CLASS::callb_setup(flext_obj::lib_class); \
}
...
...
source/fldefs.h
View file @
37e20c9c
...
...
@@ -35,12 +35,13 @@ FLEXT_REALHDR(NEW_CLASS, PARENT_CLASS)
/*! \brief Flext class header with setup function
\param NEW_CLASS name of the current C++ class
\param PARENT_CLASS name of the base C++ class (e.g. flext_base or flext_dsp)
\param SETUPFUN setup function
\param SETUPFUN setup function
, of type "void (*setupfn)()"
The setup function is called after class creation. It corresponds to the
original
PD "class_new" or Max/MSP "
setup" function
s respectively
, apart from the
original
"object_
setup" function, apart from the
fact that all necessary class initializations have already been taken care by flext.
The setup function can e.g. be used for a message to the console upon first creation of an object.
The object's t_class* data can be accessed by the static function thisClass()
*/
#define FLEXT_HEADER_S(NEW_CLASS, PARENT_CLASS, SETUPFUN)\
\
...
...
source/flext.cpp
View file @
37e20c9c
...
...
@@ -464,7 +464,6 @@ bool flext_base::SetupInOut()
return
ok
;
}
void
flext_base
::
Setup
(
t_class
*
c
)
{
#ifdef PD
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment