Commit 82a5a046 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@34 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 1f1d5b3f
......@@ -63,8 +63,8 @@ LIB32=link.exe -lib
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# 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 /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /YX /FD /GZ /c
# 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 /GX /ZI /Od /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /YX /FD /GZ /c
# ADD BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe
......@@ -82,31 +82,31 @@ LIB32=link.exe -lib
# Name "flext - Win32 Debug"
# Begin Source File
SOURCE=.\_cpp.cpp
SOURCE=.\flbase.cpp
# End Source File
# Begin Source File
SOURCE=.\_cpp.h
SOURCE=.\flbase.h
# End Source File
# Begin Source File
SOURCE=.\_cppext.cpp
SOURCE=.\flbuf.cpp
# End Source File
# Begin Source File
SOURCE=.\_cppext.h
SOURCE=.\flcwmax.h
# End Source File
# Begin Source File
SOURCE=.\buffer.cpp
SOURCE=.\flext.cpp
# End Source File
# Begin Source File
SOURCE=".\cw-max.h"
SOURCE=.\flext.h
# End Source File
# Begin Source File
SOURCE=.\flext.h
SOURCE=.\flstdc.h
# End Source File
# End Target
# End Project
flext - Compatibility library for Max/MSP and pd (pure data) externals
the files:
The package should at least compile (and is tested) with the following compilers:
- pd - Windows:
o Borland C++ 5.5 (free): ok - makefile is no real make but works
o Microsoft Visual C++ 6: no makefile yet
- pd - linux:
o GCC: no makefile yet
- Max/MSP - MacOS:
o Metrowerks CodeWarrior V6: works just perfectly
Package files:
- readme.txt: this one
- gpl.txt,license.txt: GPL license stuff
- flext.h: Basic definitions in classic C - Common vocabulary for the different platforms
- _cpp.h,_cpp.cpp: GEM-like C++ interface
- _cppext.h,_cppext.cpp: actual base classes for message (ext_obj) and dsp (dsp_obj) processing
- _cppext.h,_cppext.cpp: actual base classes for message (flext_base) and dsp (flext_dsp) processing
- buffer.cpp: buffer object handling for base classes
- cw-max.h: trivial prefix header file for Max/MSP CodeWarrior projects
Please excuse the bad (aka non-existent) documentation
TODO list:
- Documentation
- cleaner makefiles
- better function names
- abstraction for creating lists
......@@ -10,21 +10,21 @@ WARRANTIES, see the file, "license.txt," in this distribution.
// This is all borrowed from GEM by Mark Danks
#include "_cpp.h"
#include "flbase.h"
EXT_EXTERN void *operator new(size_t, void *location, void *) {return(location);}
FLEXT_EXT void *operator new(size_t, void *location, void *) {return(location);}
t_sigobj *CPPExtern::m_holder;
t_sigobj *flext_obj::m_holder;
/////////////////////////////////////////////////////////
//
// CPPExtern
// flext_obj
//
/////////////////////////////////////////////////////////
// Constructor
//
/////////////////////////////////////////////////////////
CPPExtern :: CPPExtern()
flext_obj :: flext_obj()
: x_obj(m_holder)
{
#ifdef PD
......@@ -38,5 +38,5 @@ CPPExtern :: CPPExtern()
// Destructor
//
/////////////////////////////////////////////////////////
CPPExtern :: ~CPPExtern()
flext_obj :: ~flext_obj()
{ }
......@@ -11,10 +11,10 @@ WARRANTIES, see the file, "license.txt," in this distribution.
// This is all borrowed from GEM by Mark Danks
#ifndef _FLEXT_CPP_H
#define _FLEXT_CPP_H
#ifndef _FLBASE_H
#define _FLBASE_H
#include <flext.h>
#include <flstdc.h>
#ifdef __GNUC__
#include <typeinfo>
......@@ -22,7 +22,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <typeinfo.h>
#endif
class CPPExtern;
class flext_obj;
/*-----------------------------------------------------------------
-------------------------------------------------------------------
......@@ -35,11 +35,11 @@ DESCRIPTION
This is in a separate struct to assure that when PD uses the
class, the t_object is the very first thing. If it were the
first thing in CPPExtern, then there could be problems with
first thing in flext_obj, then there could be problems with
the vtable.
-----------------------------------------------------------------*/
struct EXT_EXTERN Obj_header
struct FLEXT_EXT Obj_header
{
//////////
// The obligatory object header
......@@ -50,13 +50,13 @@ struct EXT_EXTERN Obj_header
//////////
// Our data structure
CPPExtern *data;
flext_obj *data;
};
/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
CPPExtern
flext_obj
The base class for all externs written in C++
......@@ -70,26 +70,26 @@ DESCRIPTION
The define
CPPEXTERN_HEADER(NEW_CLASS, PARENT_CLASS)
FLEXT_HEADER(NEW_CLASS, PARENT_CLASS)
should be somewhere in your header file.
One of the defines like
CPPEXTERN_NEW(NEW_CLASS)
CPPEXTERN_NEW_WITH_TWO_ARGS(NEW_CLASS, t_floatarg, A_FLOAT, t_floatarg, A_FLOAT)
FLEXT_NEW(NEW_CLASS)
FLEXT_NEW_WITH_TWO_ARGS(NEW_CLASS, t_floatarg, A_FLOAT, t_floatarg, A_FLOAT)
should be the first thing in your implementation file.
NEW_CLASS is the name of your class and PARENT_CLASS is the
parent of your class.
-----------------------------------------------------------------*/
class EXT_EXTERN CPPExtern
class FLEXT_EXT flext_obj
{
public:
//////////
// Constructor
CPPExtern();
flext_obj();
//////////
// The object header
......@@ -97,7 +97,7 @@ class EXT_EXTERN CPPExtern
//////////
// Destructor
virtual ~CPPExtern() = 0;
virtual ~flext_obj() = 0;
//////////
// Get the object's canvas
......@@ -107,6 +107,10 @@ class EXT_EXTERN CPPExtern
// This is a holder - don't touch it
static t_sigobj *m_holder;
//////////
// the class name (as used in a patch)
const char *m_name;
protected:
//////////
......@@ -131,29 +135,29 @@ class EXT_EXTERN CPPExtern
};
// This has a dummy arg so that NT won't complain
EXT_EXTERN void *operator new(size_t, void *location, void *dummy);
FLEXT_EXT void *operator new(size_t, void *location, void *dummy);
////////////////////////////////////////
// This should be used in the header
////////////////////////////////////////
#ifdef PD
#define CPPEXTERN_GETCLASS(obj) ((t_class *)((t_object *)(obj))->te_g.g_pd)
#define FLEXT_GETCLASS(obj) ((t_class *)((t_object *)(obj))->te_g.g_pd)
#elif defined(MAXMSP)
#define CPPEXTERN_GETCLASS(obj) ((t_class *)(((t_tinyobject *)obj)->t_messlist-1))
#define FLEXT_GETCLASS(obj) ((t_class *)(((t_tinyobject *)obj)->t_messlist-1))
#endif
#define CPPEXTERN_HEADER(NEW_CLASS, PARENT_CLASS) \
#define FLEXT_HEADER(NEW_CLASS, PARENT_CLASS) \
public: \
const char *thisName() const { return typeid(*this).name(); /*#return NEW_CLASS;*/ } \
const char *thisName() const { return m_name; /*#return NEW_CLASS;*/ } \
static void callb_free(void *data) \
{ CPPExtern *mydata = ((Obj_header *)data)->data; delete mydata; \
{ flext_obj *mydata = ((Obj_header *)data)->data; delete mydata; \
((Obj_header *)data)->Obj_header::~Obj_header(); } \
static void callb_setup(t_class *classPtr) \
{ PARENT_CLASS::callb_setup(classPtr); \
NEW_CLASS::cb_setup(classPtr); } \
private: \
inline t_class *thisClass() { return CPPEXTERN_GETCLASS(x_obj); } \
inline t_class *thisClass() { return FLEXT_GETCLASS(x_obj); } \
static NEW_CLASS *thisObject(V *c) { return (NEW_CLASS *)((Obj_header *)c)->data; } \
static void cb_setup(t_class *classPtr);
......@@ -165,37 +169,37 @@ static void cb_setup(t_class *classPtr);
//
// NO ARGUMENTS
/////////////////////////////////////////////////
#define CPPEXTERN_NEW(NAME,NEW_CLASS) \
#define FLEXT_NEW(NAME,NEW_CLASS) \
REAL_NEW(NAME,NEW_CLASS, _setup, _class)
//
// ONE ARGUMENT
/////////////////////////////////////////////////
#define CPPEXTERN_NEW_WITH_ONE_ARG(NAME,NEW_CLASS, TYPE, PD_TYPE) \
#define FLEXT_NEW_WITH_ONE_ARG(NAME,NEW_CLASS, TYPE, PD_TYPE) \
REAL_NEW_WITH_ARG(NAME,NEW_CLASS, _setup, _class, TYPE, PD_TYPE)
//
// GIMME ARGUMENT
/////////////////////////////////////////////////
#define CPPEXTERN_NEW_WITH_GIMME(NAME,NEW_CLASS) \
#define FLEXT_NEW_WITH_GIMME(NAME,NEW_CLASS) \
REAL_NEW_WITH_GIMME(NAME,NEW_CLASS, _setup, _class)
//
// TWO ARGUMENTS
/////////////////////////////////////////////////
#define CPPEXTERN_NEW_WITH_TWO_ARGS(NAME,NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO) \
#define FLEXT_NEW_WITH_TWO_ARGS(NAME,NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO) \
REAL_NEW_WITH_ARG_ARG(NAME,NEW_CLASS, _setup, _class, TYPE, PD_TYPE, TTWO, PD_TWO)
//
// THREE ARGUMENTS
/////////////////////////////////////////////////
#define CPPEXTERN_NEW_WITH_THREE_ARGS(NAME,NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE) \
#define FLEXT_NEW_WITH_THREE_ARGS(NAME,NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE) \
REAL_NEW_WITH_ARG_ARG_ARG(NAME,NEW_CLASS, _setup, _class, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE)
//
// FOUR ARGUMENTS
/////////////////////////////////////////////////
#define CPPEXTERN_NEW_WITH_FOUR_ARGS(NAME,NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR) \
#define FLEXT_NEW_WITH_FOUR_ARGS(NAME,NEW_CLASS, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR) \
REAL_NEW_WITH_ARG_ARG_ARG_ARG(NAME,NEW_CLASS, _setup, _class, TYPE, PD_TYPE, TTWO, PD_TWO, TTHREE, PD_THREE, TFOUR, PD_FOUR)
////////////////////////////////////////
......@@ -203,11 +207,11 @@ static void cb_setup(t_class *classPtr);
////////////////////////////////////////
#ifdef PD
#define CPPEXTERN_NEWFN ::class_new
#define CPPEXTERN_CLREF(NAME,CLASS) gensym(NAME)
#define FLEXT_NEWFN ::class_new
#define FLEXT_CLREF(NAME,CLASS) gensym(NAME)
#elif defined(MAXMSP)
#define CPPEXTERN_NEWFN NULL; ::setup
#define CPPEXTERN_CLREF(NAME,CLASS) (t_messlist **)&(CLASS)
#define FLEXT_NEWFN NULL; ::setup
#define FLEXT_CLREF(NAME,CLASS) (t_messlist **)&(CLASS)
#endif
///////////////////////////////////////////////////////////////////////////////
......@@ -225,16 +229,17 @@ static t_class * NEW_CLASS ## EXTERN_NAME; \
void * EXTERN_NAME ## NEW_CLASS () \
{ \
Obj_header *obj = new (newobject(NEW_CLASS ## EXTERN_NAME),(void *)NULL) Obj_header; \
CPPExtern::m_holder = &obj->pd_obj; \
flext_obj::m_name = NAME; \
flext_obj::m_holder = &obj->pd_obj; \
obj->data = new NEW_CLASS; \
CPPExtern::m_holder = NULL; \
flext_obj::m_holder = NULL; \
return(obj); \
} \
extern "C" { \
void NEW_CLASS ## SETUP_FUNCTION() \
{ \
NEW_CLASS ## EXTERN_NAME = CPPEXTERN_NEWFN( \
CPPEXTERN_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
NEW_CLASS ## EXTERN_NAME = FLEXT_NEWFN( \
FLEXT_CLREF(NEW_CLASS::m_name,NEW_CLASS ## EXTERN_NAME), \
(t_newmethod)EXTERN_NAME ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(Obj_header), 0, \
......@@ -251,16 +256,16 @@ static t_class * NEW_CLASS ## EXTERN_NAME; \
void * EXTERN_NAME ## NEW_CLASS (VAR_TYPE arg) \
{ \
Obj_header *obj = new (newobject(NEW_CLASS ## EXTERN_NAME),(void *)NULL) Obj_header; \
CPPExtern::m_holder = &obj->pd_obj; \
flext_obj::m_holder = &obj->pd_obj; \
obj->data = new NEW_CLASS(arg); \
CPPExtern::m_holder = NULL; \
flext_obj::m_holder = NULL; \
return(obj); \
} \
extern "C" { \
void NEW_CLASS ## SETUP_FUNCTION() \
{ \
NEW_CLASS ## EXTERN_NAME = CPPEXTERN_NEWFN( \
CPPEXTERN_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
NEW_CLASS ## EXTERN_NAME = FLEXT_NEWFN( \
FLEXT_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
(t_newmethod)EXTERN_NAME ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(Obj_header), 0, \
......@@ -278,16 +283,16 @@ static t_class * NEW_CLASS ## EXTERN_NAME; \
void * EXTERN_NAME ## NEW_CLASS (t_symbol *, int argc, t_atom *argv) \
{ \
Obj_header *obj = new (newobject(NEW_CLASS ## EXTERN_NAME),(void *)NULL) Obj_header; \
CPPExtern::m_holder = &obj->pd_obj; \
flext_obj::m_holder = &obj->pd_obj; \
obj->data = new NEW_CLASS(argc, argv); \
CPPExtern::m_holder = NULL; \
flext_obj::m_holder = NULL; \
return(obj); \
} \
extern "C" { \
void NEW_CLASS ## SETUP_FUNCTION() \
{ \
NEW_CLASS ## EXTERN_NAME = CPPEXTERN_NEWFN( \
CPPEXTERN_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
NEW_CLASS ## EXTERN_NAME = FLEXT_NEWFN( \
FLEXT_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
(t_newmethod)EXTERN_NAME ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(Obj_header), 0, \
......@@ -305,16 +310,16 @@ static t_class * NEW_CLASS ## EXTERN_NAME; \
void * EXTERN_NAME ## NEW_CLASS (ONE_VAR_TYPE arg, TWO_VAR_TYPE argtwo) \
{ \
Obj_header *obj = new (newobject(NEW_CLASS ## EXTERN_NAME),(void *)NULL) Obj_header; \
CPPExtern::m_holder = &obj->pd_obj; \
flext_obj::m_holder = &obj->pd_obj; \
obj->data = new NEW_CLASS(arg, argtwo); \
CPPExtern::m_holder = NULL; \
flext_obj::m_holder = NULL; \
return(obj); \
} \
extern "C" { \
void NEW_CLASS ## SETUP_FUNCTION() \
{ \
NEW_CLASS ## EXTERN_NAME = CPPEXTERN_NEWFN( \
CPPEXTERN_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
NEW_CLASS ## EXTERN_NAME = FLEXT_NEWFN( \
FLEXT_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
(t_newmethod)EXTERN_NAME ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(Obj_header), 0, \
......@@ -332,16 +337,16 @@ static t_class * NEW_CLASS ## EXTERN_NAME; \
void * EXTERN_NAME ## NEW_CLASS (ONE_VAR_TYPE arg, TWO_VAR_TYPE argtwo, THREE_VAR_TYPE argthree) \
{ \
Obj_header *obj = new (newobject(NEW_CLASS ## EXTERN_NAME),(void *)NULL) Obj_header; \
CPPExtern::m_holder = &obj->pd_obj; \
flext_obj::m_holder = &obj->pd_obj; \
obj->data = new NEW_CLASS(arg, argtwo, argthree); \
CPPExtern::m_holder = NULL; \
flext_obj::m_holder = NULL; \
return(obj); \
} \
extern "C" { \
void NEW_CLASS ## SETUP_FUNCTION() \
{ \
NEW_CLASS ## EXTERN_NAME = CPPEXTERN_NEWFN( \
CPPEXTERN_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
NEW_CLASS ## EXTERN_NAME = FLEXT_NEWFN( \
FLEXT_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
(t_newmethod)EXTERN_NAME ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(Obj_header), 0, \
......@@ -359,16 +364,16 @@ static t_class * NEW_CLASS ## EXTERN_NAME; \
void * EXTERN_NAME ## NEW_CLASS (ONE_VAR_TYPE arg, TWO_VAR_TYPE argtwo, THREE_VAR_TYPE argthree, FOUR_VAR_TYPE argfour) \
{ \
Obj_header *obj = new (newobject(NEW_CLASS ## EXTERN_NAME),(void *)NULL) Obj_header; \
CPPExtern::m_holder = &obj->pd_obj; \
flext_obj::m_holder = &obj->pd_obj; \
obj->data = new NEW_CLASS(arg, argtwo, argthree, argfour); \
CPPExtern::m_holder = NULL; \
flext_obj::m_holder = NULL; \
return(obj); \
} \
extern "C" { \
void NEW_CLASS ## SETUP_FUNCTION() \
{ \
NEW_CLASS ## EXTERN_NAME = CPPEXTERN_NEWFN( \
CPPEXTERN_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
NEW_CLASS ## EXTERN_NAME = FLEXT_NEWFN( \
FLEXT_CLREF(NAME,NEW_CLASS ## EXTERN_NAME), \
(t_newmethod)EXTERN_NAME ## NEW_CLASS, \
(t_method)&NEW_CLASS::callb_free, \
sizeof(Obj_header), 0, \
......
......@@ -8,13 +8,13 @@ WARRANTIES, see the file, "license.txt," in this distribution.
*/
#include <_cppext.h>
#include <flext.h>
#ifdef PD
#define DIRTY_INTERVAL 0 // buffer dirty check in msec
#endif
ext_obj::buffer::buffer(t_symbol *bn):
flext_base::buffer::buffer(t_symbol *bn):
sym(NULL),data(NULL),
chns(0),frames(0)
{
......@@ -28,14 +28,14 @@ ext_obj::buffer::buffer(t_symbol *bn):
if(bn) Set(bn);
}
ext_obj::buffer::~buffer()
flext_base::buffer::~buffer()
{
#ifdef PD
clock_free(tick);
#endif
}
I ext_obj::buffer::Set(t_symbol *s)
I flext_base::buffer::Set(t_symbol *s)
{
I ret = 0;
......@@ -102,7 +102,7 @@ I ext_obj::buffer::Set(t_symbol *s)
return ret;
}
V ext_obj::buffer::Dirty(BL force)
V flext_base::buffer::Dirty(BL force)
{
if(sym) {
#ifdef PD
......@@ -131,7 +131,7 @@ V ext_obj::buffer::Dirty(BL force)
}
#ifdef PD
V ext_obj::buffer::cb_tick(buffer *b)
V flext_base::buffer::cb_tick(buffer *b)
{
t_garray *a = (t_garray *)pd_findbyclass(b->sym, garray_class);
if (a) garray_redraw(a);
......
......@@ -8,25 +8,25 @@ WARRANTIES, see the file, "license.txt," in this distribution.
*/
#include <_cppext.h>
#include <flext.h>
// -- ext_obj --------------------------
// -- flext_base --------------------------
ext_obj::ext_obj():
flext_base::flext_base():
inlist(NULL),outlist(NULL),
out(NULL),outcnt(0)
{}
ext_obj::~ext_obj()
flext_base::~flext_base()
{
if(inlist) delete inlist;
if(outlist) delete outlist;
if(out) delete[] out;
}
ext_obj::xlet::~xlet() { if(nxt) delete nxt; }
flext_base::xlet::~xlet() { if(nxt) delete nxt; }
V ext_obj::AddXlet(xlet::type tp,I mult,xlet *&root)
V flext_base::AddXlet(xlet::type tp,I mult,xlet *&root)
{
if(!root && mult) { root = new xlet(tp); --mult; }
if(mult) {
......@@ -36,7 +36,7 @@ V ext_obj::AddXlet(xlet::type tp,I mult,xlet *&root)
}
}
BL ext_obj::SetupInOut()
BL flext_base::SetupInOut()
{
BL ok = true;
......@@ -173,7 +173,7 @@ BL ext_obj::SetupInOut()
V ext_obj::cb_setup(t_class *c)
V flext_base::cb_setup(t_class *c)
{
add_method0(c,cb_help,"help");
......@@ -183,22 +183,22 @@ V ext_obj::cb_setup(t_class *c)
#endif
}
V ext_obj::cb_help(V *c) { thisObject(c)->m_help(); }
V flext_base::cb_help(V *c) { thisObject(c)->m_help(); }
#ifdef MAXMSP
V ext_obj::cb_loadbang(V *c) { thisObject(c)->m_loadbang(); }
V ext_obj::cb_assist(V *c,V *b,L msg,L arg,C *s) { thisObject(c)->m_assist(msg,arg,s); }
V flext_base::cb_loadbang(V *c) { thisObject(c)->m_loadbang(); }
V flext_base::cb_assist(V *c,V *b,L msg,L arg,C *s) { thisObject(c)->m_assist(msg,arg,s); }
#endif
V ext_obj::m_help()
V flext_base::m_help()
{
// This should better be overloaded
post("Loaded object '%s' - compiled on %s %s",thisName(),__DATE__,__TIME__);
}
// -- dsp_obj --------------------------
// -- flext_dsp --------------------------
V dsp_obj::cb_setup(t_class *c)
V flext_dsp::cb_setup(t_class *c)
{
enable_signal(c);
......@@ -206,10 +206,10 @@ V dsp_obj::cb_setup(t_class *c)
add_method1(c,cb_enable,"enable",A_FLINT);
}
dsp_obj::dsp_obj(): enable(true) {}
flext_dsp::flext_dsp(): enable(true) {}
V dsp_obj::cb_dsp(V *c,t_signal **s) { thisObject(c)->m_dsp(s); }
V dsp_obj::cb_enable(V *c,FI on) { thisObject(c)->m_enable(on != 0); }
V flext_dsp::cb_dsp(V *c,t_signal **s) { thisObject(c)->m_dsp(s); }
V flext_dsp::cb_enable(V *c,FI on) { thisObject(c)->m_enable(on != 0); }
V dsp_obj::m_enable(BL en) { enable = en; }
V flext_dsp::m_enable(BL en) { enable = en; }
......@@ -8,22 +8,22 @@ WARRANTIES, see the file, "license.txt," in this distribution.
*/
#ifndef _FLEXT_CPPEXT_H
#define _FLEXT_CPPEXT_H
#ifndef __FLEXT_H
#define __FLEXT_H
#include <_cpp.h>
#include <flbase.h>
// ----------------------------
class ext_obj:
public CPPExtern
class flext_base:
public flext_obj
{
CPPEXTERN_HEADER(ext_obj,CPPExtern)
FLEXT_HEADER(flext_base,flext_obj)
public:
ext_obj();
virtual ~ext_obj();
flext_base();
virtual ~flext_base();
virtual V m_help();
......@@ -126,13 +126,13 @@ private:
// ----------------------------
class dsp_obj:
public ext_obj
class flext_dsp:
public flext_base
{
CPPEXTERN_HEADER(dsp_obj,ext_obj)
FLEXT_HEADER(flext_dsp,flext_base)
public:
dsp_obj();
flext_dsp();
virtual V m_dsp(t_signal **s) = 0;
virtual V m_enable(BL on);
......
......@@ -13,8 +13,8 @@ this file contains a few definitions to unite a few of the notions that
once drifted apart in Max and PD. It is not elegant but helps.
*/
#ifndef __FLEXT_H
#define __FLEXT_H
#ifndef __FLSTDC_H
#define __FLSTDC_H
#define F float
#define D double
......@@ -158,9 +158,9 @@ typedef _outlet t_outlet;
#if defined(NT)
#define EXT_EXTERN __declspec(dllexport)
#define FLEXT_EXT __declspec(dllexport)
#else // other OS's