Commit fd7d8c75 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@412 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent e75ced4c
......@@ -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 /G6 /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "NOPTHREAD" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /YX"flext.h" /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 /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "NOPTHREAD" /FR /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /FR /YX"flext.h" /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 /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /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 /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /FR /YX"flext.h" /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 /G6 /MT /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\packs\sndobj\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /YX"flext.h" /FD /c
# ADD BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe
......@@ -212,6 +212,10 @@ SOURCE=.\source\flout.cpp
# End Source File
# Begin Source File
SOURCE=.\source\flprefix.h
# End Source File
# Begin Source File
SOURCE=.\source\flsndobj.cpp
# End Source File
# Begin Source File
......
......@@ -100,7 +100,9 @@ Version history:
- added flext::GetType(t_atom &), flext::ZeroMem
- put the clock_delay for the message queue inside the thread-locked area
- BACKWARDS-INCOMPATIBLE CHANGE: flext_base::m_methodmain and flext_base::m_method_ have got
const modifiers.... these virtual methods are used rarely (for example in py/pyext)
const modifiers.... these virtual methods are used rarely (except for example in py/pyext)
- now MUCH cleaner platform identification... FLEXT_SYS,FLEXT_OS,FLEXT_CPU definitions
- also FLEXT_DEBUG for debug build
0.4.0:
- the use of the const keyword is enforced (e.g. the preferred type for symbols is now "const t_symbol *")
......
......@@ -14,6 +14,13 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h"
t_atom *flext::CopyList(int argc,const t_atom *argv)
{
int i;
t_atom *dst = new t_atom[argc];
for(i = 0; i < argc; ++i) CopyAtom(dst+i,argv+i);
return dst;
}
flext::AtomList::AtomList(int argc,const t_atom *argv):
cnt(0),lst(NULL)
......
......@@ -30,19 +30,19 @@ void flext::PrintAtom(const t_atom &a,char *buf)
case A_NULL:
break;
case A_FLOAT:
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
if(a.a_w.w_float == (int)a.a_w.w_float)
STD::sprintf(buf,"%i",(int)GetFloat(a));
else
#endif
STD::sprintf(buf,"%f",GetFloat(a));
break;
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX
case A_LONG:
STD::sprintf(buf,"%i",GetInt(a));
break;
#endif
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
case A_POINTER:
STD::sprintf(buf,"%x",GetPointer(a));
break;
......@@ -50,7 +50,7 @@ void flext::PrintAtom(const t_atom &a,char *buf)
case A_SYMBOL:
strcpy(buf,GetString(a));
break;
#ifdef _DEBUG
#ifdef FLEXT_DEBUG
default:
ERRINTERNAL();
#endif
......@@ -76,7 +76,7 @@ bool flext::ScanAtom(t_atom &a,const char *buf)
switch(s) {
case 0: // integer
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX
SetInt(a,atol(tmp));
break;
#endif
......
......@@ -15,7 +15,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h"
#include <string.h>
#ifdef MAXMSP
#ifdef __MWERKS__
#define STD std
#else
#define STD
......
......@@ -14,7 +14,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
\remark This is all derived from GEM by Mark Danks
*/
#include "flbase.h"
#include "flext.h"
#include "flinternal.h"
#include <string.h>
......@@ -41,9 +41,9 @@ flext_obj :: flext_obj()
, procattr(m_holdattr)
, init_ok(true)
{
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
m_canvas = canvas_getcurrent();
#elif defined(MAXMSP)
#elif FLEXT_SYS == FLEXT_SYS_MAX
m_canvas = (t_patcher *)gensym("#P")->s_thing;
x_obj->curinlet = 0;
#endif
......@@ -58,7 +58,7 @@ flext_obj :: ~flext_obj() {}
void flext_obj::DefineHelp(t_class *c,const char *ref,const char *dir,bool addtilde)
{
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
char tmp[256];
if(dir) {
strcpy(tmp,dir);
......@@ -70,7 +70,7 @@ void flext_obj::DefineHelp(t_class *c,const char *ref,const char *dir,bool addti
strcpy(tmp,ref);
::class_sethelpsymbol(c,gensym(const_cast<char *>(tmp)));
#else
// no solution for MaxMSP yet
// no solution for Max/MSP yet
#endif
}
......
......@@ -44,13 +44,13 @@ struct FLEXT_EXT flext_hdr
*/
t_sigobj obj;
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
//! PD only: float signal holder for pd
float defsig;
#endif
#if defined(MAXMSP)
//! MaxMSP only: current inlet used by proxy objects
#if FLEXT_SYS == FLEXT_SYS_MAX
//! Max/MSP only: current inlet used by proxy objects
long curinlet;
#endif
......@@ -142,10 +142,10 @@ class flext_obj:
//! Get the class name (as a symbol)
const t_symbol *thisNameSym() const { return m_name; }
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
//! Get the class pointer
t_class *thisClass() { return (t_class *)((t_object *)(x_obj))->te_g.g_pd; }
#elif defined(MAXMSP)
#elif FLEXT_SYS == FLEXT_SYS_MAX
//! Get the class pointer
t_class *thisClass() { return (t_class *)(((t_tinyobject *)x_obj)->t_messlist-1); }
#endif
......@@ -159,7 +159,7 @@ class flext_obj:
*/
/*! Overloaded new memory allocation method
\warning MaxMSP (or MacOS) allows only 16K in overdrive mode!
\warning Max/MSP (or MacOS) allows only 16K in overdrive mode!
*/
void *operator new(size_t bytes);
//! Overloaded delete method
......@@ -337,10 +337,12 @@ cl##_tilde_setup()
// specify that to define the library itself
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
#define REAL_LIB_SETUP(NAME,SETUPFUN) extern "C" FLEXT_EXT void NAME##_setup() { flext_obj::lib_init(#NAME,SETUPFUN,FLEXT_ATTRIBUTES); }
#else // MAXMSP
#elif FLEXT_SYS == FLEXT_SYS_MAX
#define REAL_LIB_SETUP(NAME,SETUPFUN) extern "C" FLEXT_EXT int main() { flext_obj::lib_init(#NAME,SETUPFUN,FLEXT_ATTRIBUTES); return 0; }
#else
#error
#endif
......@@ -351,11 +353,14 @@ cl##_tilde_setup()
#define FLEXT_EXP_1
#define FLEXT_EXP(LIB) FLEXT_EXP_##LIB
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
#define FLEXT_OBJ_SETUP_0(NEW_CLASS,DSP)
#else // MAXMSP
#elif FLEXT_SYS == FLEXT_SYS_MAX
#define FLEXT_OBJ_SETUP_0(NEW_CLASS,DSP) extern "C" FLEXT_EXT int main() { FLEXT_STPF(NEW_CLASS,DSP)(); return 0; }
#else
#error
#endif
#define FLEXT_OBJ_SETUP_1(NEW_CLASS,DSP)
#define FLEXT_OBJ_SETUP(NEW_CLASS,DSP,LIB) FLEXT_OBJ_SETUP_##LIB(NEW_CLASS,DSP)
......@@ -374,12 +379,14 @@ cl##_tilde_setup()
#define FLEXTTYPE_t_float A_FLOAT
#define CALLBTYPE_t_float t_float
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
#define FLEXTTYPE_int A_FLOAT
#define CALLBTYPE_int float
#else
#elif FLEXT_SYS == FLEXT_SYS_MAX
#define FLEXTTYPE_int A_INT
#define CALLBTYPE_int int
#else
#error
#endif
#define FLEXTTYPE_t_symptr A_SYMBOL
......
......@@ -14,11 +14,11 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h"
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX
#include "flmspbuffer.h" // include inofficial buffer.h
#endif
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
#define DIRTY_INTERVAL 0 // buffer dirty check in msec
#endif
......@@ -28,7 +28,7 @@ flext::buffer::buffer(const t_symbol *bn,bool delayed):
sym(NULL),data(NULL),
chns(0),frames(0)
{
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
arr = NULL;
interval = DIRTY_INTERVAL;
isdirty = false;
......@@ -41,7 +41,7 @@ flext::buffer::buffer(const t_symbol *bn,bool delayed):
flext::buffer::~buffer()
{
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
clock_free(tick);
#endif
}
......@@ -64,7 +64,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(valid) ret = -1;
}
else if(!nameonly) {
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
int frames1;
t_sample *data1;
......@@ -88,7 +88,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(data != data1) { data = data1; if(!ret) ret = 1; }
chns = 1;
}
#elif defined(MAXMSP)
#elif FLEXT_SYS == FLEXT_SYS_MAX
if(sym->s_thing) {
const _buffer *p = (const _buffer *)sym->s_thing;
......@@ -97,7 +97,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(valid) ret = -1;
}
else {
#ifdef DEBUG
#ifdef FLEXT_DEBUG
post("%s: buffer object '%s' - valid:%i samples:%i channels:%i frames:%i",thisName(),bufname->s_name,p->b_valid,p->b_frames,p->b_nchans,p->b_frames);
#endif
if(data != p->b_samples) { data = p->b_samples; if(!ret) ret = 1; }
......@@ -109,6 +109,8 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
error("buffer: symbol '%s' not defined", sym->s_name);
if(valid) ret = -1;
}
#else
#error
#endif
}
......@@ -119,7 +121,7 @@ bool flext::buffer::Update()
{
if(!Ok()) return false;
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
int frames1;
t_sample *data1;
if(!garray_getfloatarray(arr, &frames1, &data1)) {
......@@ -135,7 +137,7 @@ bool flext::buffer::Update()
}
else
return false;
#else // MAXMSP
#elif FLEXT_SYS == FLEXT_SYS_MAX
if(!sym->s_thing)
return false;
else {
......@@ -149,15 +151,17 @@ bool flext::buffer::Update()
else
return false;
}
#else
#error
#endif
}
void flext::buffer::Frames(int fr,bool keep)
{
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
::garray_resize(arr,(float)fr);
Update();
#else
#elif FLEXT_SYS == FLEXT_SYS_MAX
t_sample *tmp = NULL;
int sz = frames;
if(fr < sz) sz = fr;
......@@ -187,11 +191,13 @@ void flext::buffer::Frames(int fr,bool keep)
BlockMoveData(tmp,data,sizeof(t_sample)*sz);
delete[] tmp;
}
#else
#error
#endif
}
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
void flext::buffer::SetRefrIntv(float intv)
{
interval = intv;
......@@ -200,15 +206,17 @@ void flext::buffer::SetRefrIntv(float intv)
ticking = false;
}
}
#else
#elif FLEXT_SYS == FLEXT_SYS_MAX
void flext::buffer::SetRefrIntv(float) {}
#else
#error
#endif
void flext::buffer::Dirty(bool force)
{
if(sym) {
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
if((!ticking) && (interval || force)) {
ticking = true;
cb_tick(this); // immediately redraw
......@@ -217,7 +225,7 @@ void flext::buffer::Dirty(bool force)
if(force) clock_delay(tick,0);
isdirty = true;
}
#elif defined(MAXMSP)
#elif FLEXT_SYS == FLEXT_SYS_MAX
if(sym->s_thing) {
_buffer *p = (_buffer *)sym->s_thing;
......@@ -231,15 +239,17 @@ void flext::buffer::Dirty(bool force)
else {
error("buffer: symbol '%s' not defined",sym->s_name);
}
#else
#error
#endif
}
}
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
void flext::buffer::cb_tick(buffer *b)
{
if(b->arr) garray_redraw(b->arr);
#ifdef _DEBUG
#ifdef FLEXT_DEBUG
else error("buffer: array is NULL");
#endif
......
......@@ -79,7 +79,7 @@ public:
//! called on patcher load (not on mere object creation!)
virtual void m_loadbang() {}
//! quickhelp for inlets/outlets (gets called in MaxMSP only)
//! quickhelp for inlets/outlets (gets called in Max/MSP only)
virtual void m_assist(long /*msg*/,long /*arg*/,char * /*s*/) {}
/*! \brief Called for every incoming message.
......@@ -325,10 +325,12 @@ public:
void AddMethod(int inlet,bool (*m)(flext_base *,float &)) { AddMethod(inlet,"float",(methfun)m,a_float,a_null); } // single float
void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(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(inlet,"list",(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(inlet,"float",(methfun)m,a_int,a_null); } // single float
#else
#elif FLEXT_SYS == FLEXT_SYS_MAX
void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(inlet,"int",(methfun)m,a_int,a_null); } // single float
#else
#error
#endif
void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(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(inlet,"list",(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats
......@@ -341,7 +343,7 @@ public:
void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(inlet,tag,(methfun)m,a_float,a_null); } // method+float
void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(inlet,tag,(methfun)m,a_int,a_null); } // method+int
//! Set MaxMSP style of distributing list elements over (message) inlets
//! Set Max/MSP style of distributing list elements over (message) inlets
void SetDist(bool d = true) { distmsgs = d; }
//! @} FLEXT_C_ADDMETHOD
......@@ -353,7 +355,7 @@ public:
@{
*/
#ifdef PD
#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; }
//! Unbind object from a symbol
......@@ -616,9 +618,9 @@ private:
float ft;
int it;
t_symbol *st;
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
t_gpointer *pt;
#endif
#endif
void *vt;
};
......@@ -665,7 +667,7 @@ private:
class qmsg;
qmsg *qhead,*qtail;
t_qelem *qclk;
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX
t_clock *yclk;
static void YTick(flext_base *th);
#endif
......@@ -673,11 +675,11 @@ private:
static void QTick(flext_base *th);
void Queue(qmsg *m);
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
// proxy object (for additional inlets) stuff
struct px_object;
friend struct px_object;
#elif defined(MAXMSP)
#elif FLEXT_SYS == FLEXT_SYS_MAX
typedef object px_object;
static void cb_px_float(t_class *c,float f);
static void cb_px_int(t_class *c,int v);
......@@ -692,6 +694,8 @@ private:
static void cb_px_in7(t_class *c,int v);
static void cb_px_in8(t_class *c,int v);
static void cb_px_in9(t_class *c,int v);
#else
#error
#endif
static void cb_px_anything(t_class *c,const t_symbol *s,int argc,t_atom *argv);
......@@ -712,7 +716,7 @@ private:
static void cb_help(t_class *c);
static void cb_loadbang(t_class *c);
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX
static void cb_assist(t_class *c,void *b,long msg,long arg,char *s);
#endif
};
......
......@@ -22,31 +22,31 @@ WARRANTIES, see the file, "license.txt," in this distribution.
void flext_dsp::Setup(t_class *c)
{
#ifdef PD
// CLASS_MAINSIGNALIN(c,flext_hdr,defsig);
#elif defined(MAXMSP)
#if FLEXT_SYS == FLEXT_SYS_MAX
// dsp_initclass();
dsp_initboxclass();
#endif
add_dsp(c,cb_dsp);
#ifndef MAXMSP
add_method1(c,cb_enable,"enable",A_FLINT);
#if FLEXT_SYS != FLEXT_SYS_MAX
add_method1(c,cb_enable,"enable",A_FLOAT);
#endif
}
flext_dsp::flext_dsp():
#ifndef MAXMSP
#if FLEXT_SYS != FLEXT_SYS_MAX
dspon(true),
#endif
srate(sys_getsr()), // should we set it?
blksz(sys_getblksize()),
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
chnsin(sys_get_inchannels()),
chnsout(sys_get_outchannels()),
#else // MAXMSP
#elif FLEXT_SYS == FLEXT_SYS_MAX
chnsin(sys_getch()),
chnsout(sys_getch()),
#else
#error
#endif
invecs(NULL),outvecs(NULL)
{}
......@@ -62,7 +62,7 @@ flext_dsp::~flext_dsp()
t_int *flext_dsp::dspmeth(t_int *w)
{
flext_dsp *obj = (flext_dsp *)w[1];
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX
if(!obj->thisHdr()->z_disabled)
#else
if(obj->dspon)
......@@ -89,11 +89,13 @@ void flext_dsp::cb_dsp(t_class *c,t_signal **sp)
obj->srate = sp[0]->s_sr;
obj->blksz = sp[0]->s_n; // is this guaranteed to be the same as sys_getblksize() ?
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
obj->chnsin = sys_get_inchannels();
obj->chnsout = sys_get_outchannels();
#else // MAXMSP
#elif FLEXT_SYS == FLEXT_SYS_MAX
obj->chnsin = obj->chnsout = sys_getch();
#else
#error
#endif
// store in and out signal vectors
......@@ -113,8 +115,8 @@ void flext_dsp::cb_dsp(t_class *c,t_signal **sp)
dsp_add((t_dspmethod)dspmeth,2,obj,sp[0]->s_n);
}
#ifndef MAXMSP
void flext_dsp::cb_enable(t_class *c,t_flint on) { thisObject(c)->m_enable(on != 0); }
#if FLEXT_SYS != FLEXT_SYS_MAX
void flext_dsp::cb_enable(t_class *c,t_float on) { thisObject(c)->m_enable(on != 0); }
void flext_dsp::m_enable(bool en) { dspon = en; }
#endif
......
......@@ -83,9 +83,9 @@ public:
*/
virtual void m_signal(int n,t_sample *const *insigs,t_sample *const *outsigs);
#ifndef MAXMSP
#if FLEXT_SYS != FLEXT_SYS_MAX
/*! \brief called with "enable" message: pauses/resumes dsp
\note PD only - implicitely defined in MaxMSP
\note PD only - implicitely defined in Max/MSP
*/
virtual void m_enable(bool on);
#endif
......@@ -132,8 +132,8 @@ private:
// callback functions
static void cb_dsp(t_class *c,t_signal **s);
#ifndef MAXMSP
static void cb_enable(t_class *c,t_flint on);
#if FLEXT_SYS != FLEXT_SYS_MAX
static void cb_enable(t_class *c,t_float on);
bool dspon;
#endif
......
......@@ -20,7 +20,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
// === proxy class for flext_base ============================
#ifdef PD
#if FLEXT_SYS == FLEXT_SYS_PD
static t_class *px_class;
......@@ -54,7 +54,7 @@ void flext_base::cb_px_ft ## IX(t_class *c,float v) { \
#define ADD_IN_FT(IX) \
add_method1(c,cb_px_ft ## IX,"ft" #IX,A_FLOAT)
#elif defined(MAXMSP)
#elif FLEXT_SYS == FLEXT_SYS_MAX
void flext_base::cb_px_anything(t_class *c,const t_symbol *s,int argc,t_atom *argv)
{
......@@ -97,7 +97,9 @@ void flext_base::cb_px_ft ## IX(t_class *c,float v) { long &ci = ((flext_hdr *)t
add_method1(c,cb_px_in ## IX,"in" #IX,A_INT); \
add_method1(c,cb_px_ft ## IX,"ft" #IX,A_FLOAT)
#endif // MAXMSP
#else
#error // Other system
#endif
DEF_IN_FT(1)
......@@ -135,7 +137,7 @@ flext_base::flext_base():
#endif
qhead = qtail = NULL;
qclk = (t_qelem *)(qelem_new(this,(t_method)QTick));
#ifdef MAXMSP
#if FLEXT_SYS == FLEXT_SYS_MAX