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 ...@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "pd-msvc\s" # PROP Intermediate_Dir "pd-msvc\s"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # 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 BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG" # ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
...@@ -66,7 +66,7 @@ LIB32=link.exe -lib ...@@ -66,7 +66,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\sd" # PROP Intermediate_Dir "pd-msvc\sd"
# PROP Target_Dir "" # 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 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 BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG" # ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
...@@ -89,7 +89,7 @@ LIB32=link.exe -lib ...@@ -89,7 +89,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\td" # PROP Intermediate_Dir "pd-msvc\td"
# PROP Target_Dir "" # 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 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 BASE RSC /l 0xc07 /d "_DEBUG"
# ADD RSC /l 0xc07 /d "_DEBUG" # ADD RSC /l 0xc07 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
...@@ -112,7 +112,7 @@ LIB32=link.exe -lib ...@@ -112,7 +112,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "pd-msvc\t" # PROP Intermediate_Dir "pd-msvc\t"
# PROP Target_Dir "" # 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 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 BASE RSC /l 0xc07 /d "NDEBUG"
# ADD RSC /l 0xc07 /d "NDEBUG" # ADD RSC /l 0xc07 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
...@@ -212,6 +212,10 @@ SOURCE=.\source\flout.cpp ...@@ -212,6 +212,10 @@ SOURCE=.\source\flout.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\source\flprefix.h
# End Source File
# Begin Source File
SOURCE=.\source\flsndobj.cpp SOURCE=.\source\flsndobj.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -100,7 +100,9 @@ Version history: ...@@ -100,7 +100,9 @@ Version history:
- added flext::GetType(t_atom &), flext::ZeroMem - added flext::GetType(t_atom &), flext::ZeroMem
- put the clock_delay for the message queue inside the thread-locked area - 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 - 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: 0.4.0:
- the use of the const keyword is enforced (e.g. the preferred type for symbols is now "const t_symbol *") - 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. ...@@ -14,6 +14,13 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h" #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): flext::AtomList::AtomList(int argc,const t_atom *argv):
cnt(0),lst(NULL) cnt(0),lst(NULL)
......
...@@ -30,19 +30,19 @@ void flext::PrintAtom(const t_atom &a,char *buf) ...@@ -30,19 +30,19 @@ void flext::PrintAtom(const t_atom &a,char *buf)
case A_NULL: case A_NULL:
break; break;
case A_FLOAT: case A_FLOAT:
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
if(a.a_w.w_float == (int)a.a_w.w_float) if(a.a_w.w_float == (int)a.a_w.w_float)
STD::sprintf(buf,"%i",(int)GetFloat(a)); STD::sprintf(buf,"%i",(int)GetFloat(a));
else else
#endif #endif
STD::sprintf(buf,"%f",GetFloat(a)); STD::sprintf(buf,"%f",GetFloat(a));
break; break;
#ifdef MAXMSP #if FLEXT_SYS == FLEXT_SYS_MAX
case A_LONG: case A_LONG:
STD::sprintf(buf,"%i",GetInt(a)); STD::sprintf(buf,"%i",GetInt(a));
break; break;
#endif #endif
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
case A_POINTER: case A_POINTER:
STD::sprintf(buf,"%x",GetPointer(a)); STD::sprintf(buf,"%x",GetPointer(a));
break; break;
...@@ -50,7 +50,7 @@ void flext::PrintAtom(const t_atom &a,char *buf) ...@@ -50,7 +50,7 @@ void flext::PrintAtom(const t_atom &a,char *buf)
case A_SYMBOL: case A_SYMBOL:
strcpy(buf,GetString(a)); strcpy(buf,GetString(a));
break; break;
#ifdef _DEBUG #ifdef FLEXT_DEBUG
default: default:
ERRINTERNAL(); ERRINTERNAL();
#endif #endif
...@@ -76,7 +76,7 @@ bool flext::ScanAtom(t_atom &a,const char *buf) ...@@ -76,7 +76,7 @@ bool flext::ScanAtom(t_atom &a,const char *buf)
switch(s) { switch(s) {
case 0: // integer case 0: // integer
#ifdef MAXMSP #if FLEXT_SYS == FLEXT_SYS_MAX
SetInt(a,atol(tmp)); SetInt(a,atol(tmp));
break; break;
#endif #endif
......
...@@ -15,7 +15,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -15,7 +15,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h" #include "flext.h"
#include <string.h> #include <string.h>
#ifdef MAXMSP #ifdef __MWERKS__
#define STD std #define STD std
#else #else
#define STD #define STD
......
...@@ -14,7 +14,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -14,7 +14,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
\remark This is all derived from GEM by Mark Danks \remark This is all derived from GEM by Mark Danks
*/ */
#include "flbase.h" #include "flext.h"
#include "flinternal.h" #include "flinternal.h"
#include <string.h> #include <string.h>
...@@ -41,9 +41,9 @@ flext_obj :: flext_obj() ...@@ -41,9 +41,9 @@ flext_obj :: flext_obj()
, procattr(m_holdattr) , procattr(m_holdattr)
, init_ok(true) , init_ok(true)
{ {
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
m_canvas = canvas_getcurrent(); m_canvas = canvas_getcurrent();
#elif defined(MAXMSP) #elif FLEXT_SYS == FLEXT_SYS_MAX
m_canvas = (t_patcher *)gensym("#P")->s_thing; m_canvas = (t_patcher *)gensym("#P")->s_thing;
x_obj->curinlet = 0; x_obj->curinlet = 0;
#endif #endif
...@@ -58,7 +58,7 @@ flext_obj :: ~flext_obj() {} ...@@ -58,7 +58,7 @@ flext_obj :: ~flext_obj() {}
void flext_obj::DefineHelp(t_class *c,const char *ref,const char *dir,bool addtilde) 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]; char tmp[256];
if(dir) { if(dir) {
strcpy(tmp,dir); strcpy(tmp,dir);
...@@ -70,7 +70,7 @@ void flext_obj::DefineHelp(t_class *c,const char *ref,const char *dir,bool addti ...@@ -70,7 +70,7 @@ void flext_obj::DefineHelp(t_class *c,const char *ref,const char *dir,bool addti
strcpy(tmp,ref); strcpy(tmp,ref);
::class_sethelpsymbol(c,gensym(const_cast<char *>(tmp))); ::class_sethelpsymbol(c,gensym(const_cast<char *>(tmp)));
#else #else
// no solution for MaxMSP yet // no solution for Max/MSP yet
#endif #endif
} }
......
...@@ -44,13 +44,13 @@ struct FLEXT_EXT flext_hdr ...@@ -44,13 +44,13 @@ struct FLEXT_EXT flext_hdr
*/ */
t_sigobj obj; t_sigobj obj;
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
//! PD only: float signal holder for pd //! PD only: float signal holder for pd
float defsig; float defsig;
#endif #endif
#if defined(MAXMSP) #if FLEXT_SYS == FLEXT_SYS_MAX
//! MaxMSP only: current inlet used by proxy objects //! Max/MSP only: current inlet used by proxy objects
long curinlet; long curinlet;
#endif #endif
...@@ -142,10 +142,10 @@ class flext_obj: ...@@ -142,10 +142,10 @@ class flext_obj:
//! Get the class name (as a symbol) //! Get the class name (as a symbol)
const t_symbol *thisNameSym() const { return m_name; } const t_symbol *thisNameSym() const { return m_name; }
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
//! Get the class pointer //! Get the class pointer
t_class *thisClass() { return (t_class *)((t_object *)(x_obj))->te_g.g_pd; } 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 //! Get the class pointer
t_class *thisClass() { return (t_class *)(((t_tinyobject *)x_obj)->t_messlist-1); } t_class *thisClass() { return (t_class *)(((t_tinyobject *)x_obj)->t_messlist-1); }
#endif #endif
...@@ -159,7 +159,7 @@ class flext_obj: ...@@ -159,7 +159,7 @@ class flext_obj:
*/ */
/*! Overloaded new memory allocation method /*! 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); void *operator new(size_t bytes);
//! Overloaded delete method //! Overloaded delete method
...@@ -337,10 +337,12 @@ cl##_tilde_setup() ...@@ -337,10 +337,12 @@ cl##_tilde_setup()
// specify that to define the library itself // 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); } #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; } #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 #endif
...@@ -351,11 +353,14 @@ cl##_tilde_setup() ...@@ -351,11 +353,14 @@ cl##_tilde_setup()
#define FLEXT_EXP_1 #define FLEXT_EXP_1
#define FLEXT_EXP(LIB) FLEXT_EXP_##LIB #define FLEXT_EXP(LIB) FLEXT_EXP_##LIB
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
#define FLEXT_OBJ_SETUP_0(NEW_CLASS,DSP) #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; } #define FLEXT_OBJ_SETUP_0(NEW_CLASS,DSP) extern "C" FLEXT_EXT int main() { FLEXT_STPF(NEW_CLASS,DSP)(); return 0; }
#else
#error
#endif #endif
#define FLEXT_OBJ_SETUP_1(NEW_CLASS,DSP) #define FLEXT_OBJ_SETUP_1(NEW_CLASS,DSP)
#define FLEXT_OBJ_SETUP(NEW_CLASS,DSP,LIB) FLEXT_OBJ_SETUP_##LIB(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() ...@@ -374,12 +379,14 @@ cl##_tilde_setup()
#define FLEXTTYPE_t_float A_FLOAT #define FLEXTTYPE_t_float A_FLOAT
#define CALLBTYPE_t_float t_float #define CALLBTYPE_t_float t_float
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
#define FLEXTTYPE_int A_FLOAT #define FLEXTTYPE_int A_FLOAT
#define CALLBTYPE_int float #define CALLBTYPE_int float
#else #elif FLEXT_SYS == FLEXT_SYS_MAX
#define FLEXTTYPE_int A_INT #define FLEXTTYPE_int A_INT
#define CALLBTYPE_int int #define CALLBTYPE_int int
#else
#error
#endif #endif
#define FLEXTTYPE_t_symptr A_SYMBOL #define FLEXTTYPE_t_symptr A_SYMBOL
......
...@@ -14,11 +14,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. ...@@ -14,11 +14,11 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h" #include "flext.h"
#ifdef MAXMSP #if FLEXT_SYS == FLEXT_SYS_MAX
#include "flmspbuffer.h" // include inofficial buffer.h #include "flmspbuffer.h" // include inofficial buffer.h
#endif #endif
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
#define DIRTY_INTERVAL 0 // buffer dirty check in msec #define DIRTY_INTERVAL 0 // buffer dirty check in msec
#endif #endif
...@@ -28,7 +28,7 @@ flext::buffer::buffer(const t_symbol *bn,bool delayed): ...@@ -28,7 +28,7 @@ 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)
{ {
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
arr = NULL; arr = NULL;
interval = DIRTY_INTERVAL; interval = DIRTY_INTERVAL;
isdirty = false; isdirty = false;
...@@ -41,7 +41,7 @@ flext::buffer::buffer(const t_symbol *bn,bool delayed): ...@@ -41,7 +41,7 @@ flext::buffer::buffer(const t_symbol *bn,bool delayed):
flext::buffer::~buffer() flext::buffer::~buffer()
{ {
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
clock_free(tick); clock_free(tick);
#endif #endif
} }
...@@ -64,7 +64,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly) ...@@ -64,7 +64,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(valid) ret = -1; if(valid) ret = -1;
} }
else if(!nameonly) { else if(!nameonly) {
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
int frames1; int frames1;
t_sample *data1; t_sample *data1;
...@@ -88,7 +88,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly) ...@@ -88,7 +88,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(data != data1) { data = data1; if(!ret) ret = 1; } if(data != data1) { data = data1; if(!ret) ret = 1; }
chns = 1; chns = 1;
} }
#elif defined(MAXMSP) #elif FLEXT_SYS == FLEXT_SYS_MAX
if(sym->s_thing) { if(sym->s_thing) {
const _buffer *p = (const _buffer *)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) ...@@ -97,7 +97,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(valid) ret = -1; if(valid) ret = -1;
} }
else { 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); 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 #endif
if(data != p->b_samples) { data = p->b_samples; if(!ret) ret = 1; } 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) ...@@ -109,6 +109,8 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
error("buffer: symbol '%s' not defined", sym->s_name); error("buffer: symbol '%s' not defined", sym->s_name);
if(valid) ret = -1; if(valid) ret = -1;
} }
#else
#error
#endif #endif
} }
...@@ -119,7 +121,7 @@ bool flext::buffer::Update() ...@@ -119,7 +121,7 @@ bool flext::buffer::Update()
{ {
if(!Ok()) return false; if(!Ok()) return false;
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
int frames1; int frames1;
t_sample *data1; t_sample *data1;
if(!garray_getfloatarray(arr, &frames1, &data1)) { if(!garray_getfloatarray(arr, &frames1, &data1)) {
...@@ -135,7 +137,7 @@ bool flext::buffer::Update() ...@@ -135,7 +137,7 @@ bool flext::buffer::Update()
} }
else else
return false; return false;
#else // MAXMSP #elif FLEXT_SYS == FLEXT_SYS_MAX
if(!sym->s_thing) if(!sym->s_thing)
return false; return false;
else { else {
...@@ -149,15 +151,17 @@ bool flext::buffer::Update() ...@@ -149,15 +151,17 @@ bool flext::buffer::Update()
else else
return false; return false;
} }
#else
#error
#endif #endif
} }
void flext::buffer::Frames(int fr,bool keep) void flext::buffer::Frames(int fr,bool keep)
{ {
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
::garray_resize(arr,(float)fr); ::garray_resize(arr,(float)fr);
Update(); Update();
#else #elif FLEXT_SYS == FLEXT_SYS_MAX
t_sample *tmp = NULL; t_sample *tmp = NULL;
int sz = frames; int sz = frames;
if(fr < sz) sz = fr; if(fr < sz) sz = fr;
...@@ -187,11 +191,13 @@ void flext::buffer::Frames(int fr,bool keep) ...@@ -187,11 +191,13 @@ void flext::buffer::Frames(int fr,bool keep)
BlockMoveData(tmp,data,sizeof(t_sample)*sz); BlockMoveData(tmp,data,sizeof(t_sample)*sz);
delete[] tmp; delete[] tmp;
} }
#else
#error
#endif #endif
} }
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
void flext::buffer::SetRefrIntv(float intv) void flext::buffer::SetRefrIntv(float intv)
{ {
interval = intv; interval = intv;
...@@ -200,15 +206,17 @@ void flext::buffer::SetRefrIntv(float intv) ...@@ -200,15 +206,17 @@ void flext::buffer::SetRefrIntv(float intv)
ticking = false; ticking = false;
} }
} }
#else #elif FLEXT_SYS == FLEXT_SYS_MAX
void flext::buffer::SetRefrIntv(float) {} void flext::buffer::SetRefrIntv(float) {}
#else
#error
#endif #endif
void flext::buffer::Dirty(bool force) void flext::buffer::Dirty(bool force)
{ {
if(sym) { if(sym) {
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
if((!ticking) && (interval || force)) { if((!ticking) && (interval || force)) {
ticking = true; ticking = true;
cb_tick(this); // immediately redraw cb_tick(this); // immediately redraw
...@@ -217,7 +225,7 @@ void flext::buffer::Dirty(bool force) ...@@ -217,7 +225,7 @@ void flext::buffer::Dirty(bool force)
if(force) clock_delay(tick,0); if(force) clock_delay(tick,0);
isdirty = true; isdirty = true;
} }
#elif defined(MAXMSP) #elif FLEXT_SYS == FLEXT_SYS_MAX
if(sym->s_thing) { if(sym->s_thing) {
_buffer *p = (_buffer *)sym->s_thing; _buffer *p = (_buffer *)sym->s_thing;
...@@ -231,15 +239,17 @@ void flext::buffer::Dirty(bool force) ...@@ -231,15 +239,17 @@ void flext::buffer::Dirty(bool force)
else { else {
error("buffer: symbol '%s' not defined",sym->s_name); error("buffer: symbol '%s' not defined",sym->s_name);
} }
#else
#error
#endif #endif
} }
} }
#ifdef PD #if FLEXT_SYS == FLEXT_SYS_PD
void flext::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 FLEXT_DEBUG
else error("buffer: array is NULL"); else error("buffer: array is NULL");
#endif #endif
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
//! called on patcher load (not on mere object creation!) //! called on patcher load (not on mere object creation!)
virtual void m_loadbang() {} 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*/) {} virtual void m_assist(long /*msg*/,long /*arg*/,char * /*s*/) {}
/*! \brief Called for every incoming message. /*! \brief Called for every incoming message.
...@@ -325,10 +325,12 @@ public: ...@@ -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 &)) { 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 &)) { 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 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 void AddMethod(int inlet