diff options
Diffstat (limited to 'externals/grill/flext/source')
-rw-r--r-- | externals/grill/flext/source/flbase.cpp | 1 | ||||
-rw-r--r-- | externals/grill/flext/source/flbuf.cpp | 5 | ||||
-rw-r--r-- | externals/grill/flext/source/fldsp.h | 6 | ||||
-rw-r--r-- | externals/grill/flext/source/flext.cpp | 2 | ||||
-rwxr-xr-x | externals/grill/flext/source/flmsg.cpp | 3 | ||||
-rw-r--r-- | externals/grill/flext/source/flsndobj.cpp | 13 | ||||
-rw-r--r-- | externals/grill/flext/source/flsndobj.h | 6 | ||||
-rw-r--r-- | externals/grill/flext/source/flstk.cpp | 13 | ||||
-rw-r--r-- | externals/grill/flext/source/flstk.h | 4 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 9 |
10 files changed, 40 insertions, 22 deletions
diff --git a/externals/grill/flext/source/flbase.cpp b/externals/grill/flext/source/flbase.cpp index 63017d47..c3d94d83 100644 --- a/externals/grill/flext/source/flbase.cpp +++ b/externals/grill/flext/source/flbase.cpp @@ -25,6 +25,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #pragma warning (push) #pragma warning (disable:4091) #endif +// for canvas_realizedollar (should be noon-critical) #include <g_canvas.h> #ifdef _MSC_VER #pragma warning (pop) diff --git a/externals/grill/flext/source/flbuf.cpp b/externals/grill/flext/source/flbuf.cpp index 529d32d0..a807c20b 100644 --- a/externals/grill/flext/source/flbuf.cpp +++ b/externals/grill/flext/source/flbuf.cpp @@ -326,11 +326,10 @@ void flext::buffer::ClearDirty() bool flext::buffer::IsDirty() const { - FLEXT_ASSERT(sym); + if(!sym) return false; #if FLEXT_SYS == FLEXT_SYS_PD - FLEXT_ASSERT(arr); #ifdef _FLEXT_HAVE_PD_GARRAYUPDATETIME - return isdirty || garray_updatetime(arr) > cleantime; + return arr && (isdirty || garray_updatetime(arr) > cleantime); #else // Don't know.... (no method in PD judging whether buffer has been changed from outside flext...) return true; diff --git a/externals/grill/flext/source/fldsp.h b/externals/grill/flext/source/fldsp.h index d9dbb1fe..19b4b3cb 100644 --- a/externals/grill/flext/source/fldsp.h +++ b/externals/grill/flext/source/fldsp.h @@ -54,9 +54,15 @@ public: //! returns array of input vectors (CntInSig() vectors) t_sample *const *InSig() const { return invecs; } + //! returns input vector + t_sample *InSig(int i) const { return invecs[i]; } + //! returns array of output vectors (CntOutSig() vectors) t_sample *const *OutSig() const { return outvecs; } + //! returns output vector + t_sample *OutSig(int i) const { return outvecs[i]; } + //! typedef describing a signal vector #if FLEXT_SYS == FLEXT_SYS_JMAX typedef fts_symbol_t t_signalvec; diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp index d37df1f0..70184bef 100644 --- a/externals/grill/flext/source/flext.cpp +++ b/externals/grill/flext/source/flext.cpp @@ -175,7 +175,7 @@ void flext_base::CbClick() {} #if FLEXT_SYS == FLEXT_SYS_PD void flext_base::cb_click(t_gobj *c,t_floatarg xpos,t_floatarg ypos,t_floatarg shift,t_floatarg ctrl,t_floatarg alt) { - if(alt) thisObject(c)->CbClick(); + if(shift) thisObject(c)->CbClick(); } #endif diff --git a/externals/grill/flext/source/flmsg.cpp b/externals/grill/flext/source/flmsg.cpp index 1ab4b4a7..640c90cd 100755 --- a/externals/grill/flext/source/flmsg.cpp +++ b/externals/grill/flext/source/flmsg.cpp @@ -253,12 +253,15 @@ bool flext_base::CbMethodHandler(int inlet,const t_symbol *s,int argc,const t_at } catch(std::exception &x) { error("%s - Exception while processing method: %s",thisName(),x.what()); + ret = false; } catch(const char *txt) { error("%s - Exception while processing method: %s",thisName(),txt); + ret = false; } catch(...) { error("%s - Unknown exception while processing method",thisName()); + ret = false; } end: diff --git a/externals/grill/flext/source/flsndobj.cpp b/externals/grill/flext/source/flsndobj.cpp index 830a7b46..b884ce73 100644 --- a/externals/grill/flext/source/flsndobj.cpp +++ b/externals/grill/flext/source/flsndobj.cpp @@ -50,7 +50,7 @@ void flext_sndobj::ClearObjs() } } -void flext_sndobj::m_dsp(int n,t_sample *const *in,t_sample *const *out) +bool flext_sndobj::CbDsp() { // called on every rebuild of the dsp chain @@ -68,13 +68,13 @@ void flext_sndobj::m_dsp(int n,t_sample *const *in,t_sample *const *out) inobj = new Inlet *[inobjs]; tmpobj = new SndObj *[inobjs]; for(i = 0; i < inobjs; ++i) { - inobj[i] = new Inlet(in[i],blsz,smprt); + inobj[i] = new Inlet(InSig(i),blsz,smprt); tmpobj[i] = new SndObj(NULL,blsz,smprt); } } if(outobjs) { outobj = new Outlet *[outobjs]; - for(i = 0; i < outobjs; ++i) outobj[i] = new Outlet(out[i],blsz,smprt); + for(i = 0; i < outobjs; ++i) outobj[i] = new Outlet(OutSig(i),blsz,smprt); } if(!NewObjs()) ClearObjs(); @@ -82,12 +82,13 @@ void flext_sndobj::m_dsp(int n,t_sample *const *in,t_sample *const *out) else { // assign changed input/output vectors - for(i = 0; i < inobjs; ++i) inobj[i]->SetBuf(in[i]); - for(i = 0; i < outobjs; ++i) outobj[i]->SetBuf(out[i]); + for(i = 0; i < inobjs; ++i) inobj[i]->SetBuf(InSig(i)); + for(i = 0; i < outobjs; ++i) outobj[i]->SetBuf(OutSig(i)); } + return true; } -void flext_sndobj::m_signal(int n,t_sample *const *in,t_sample *const *out) +void flext_sndobj::CbSignal() { for(int i = 0; i < inobjs; ++i) *tmpobj[i] << *inobj[i]; ProcessObjs(); diff --git a/externals/grill/flext/source/flsndobj.h b/externals/grill/flext/source/flsndobj.h index 9cff9461..dee6c9de 100644 --- a/externals/grill/flext/source/flsndobj.h +++ b/externals/grill/flext/source/flsndobj.h @@ -41,9 +41,6 @@ protected: virtual bool Init(); virtual void Exit(); - virtual void m_dsp(int n,t_sample *const *in,t_sample *const *out); - virtual void m_signal(int n,t_sample *const *in,t_sample *const *out); - private: //! SndObj for reading from inlet buffer class Inlet: @@ -75,6 +72,9 @@ private: t_sample *buf; }; + virtual bool CbDsp(); + virtual void CbSignal(); + void ClearObjs(); int inobjs,outobjs; diff --git a/externals/grill/flext/source/flstk.cpp b/externals/grill/flext/source/flstk.cpp index b3a6204c..f3161565 100644 --- a/externals/grill/flext/source/flstk.cpp +++ b/externals/grill/flext/source/flstk.cpp @@ -45,7 +45,7 @@ void flext_stk::ClearObjs() } } -void flext_stk::m_dsp(int n,t_sample *const *in,t_sample *const *out) +bool flext_stk::CbDsp() { // called on every rebuild of the dsp chain @@ -64,12 +64,12 @@ void flext_stk::m_dsp(int n,t_sample *const *in,t_sample *const *out) if(inobjs) { inobj = new Input *[inobjs]; for(i = 0; i < inobjs; ++i) - inobj[i] = new Input(in[i],blsz); + inobj[i] = new Input(InSig(i),blsz); } if(outobjs) { outobj = new Output *[outobjs]; for(i = 0; i < outobjs; ++i) - outobj[i] = new Output(out[i],blsz); + outobj[i] = new Output(OutSig(i),blsz); } if(!NewObjs()) ClearObjs(); @@ -77,12 +77,13 @@ void flext_stk::m_dsp(int n,t_sample *const *in,t_sample *const *out) else { // assign changed input/output vectors - for(i = 0; i < inobjs; ++i) inobj[i]->SetBuf(in[i]); - for(i = 0; i < outobjs; ++i) outobj[i]->SetBuf(out[i]); + for(i = 0; i < inobjs; ++i) inobj[i]->SetBuf(InSig(i)); + for(i = 0; i < outobjs; ++i) outobj[i]->SetBuf(OutSig(i)); } + return true; } -void flext_stk::m_signal(int n,t_sample *const *in,t_sample *const *out) +void flext_stk::CbSignal() { if(inobjs || outobjs) ProcessObjs(blsz); } diff --git a/externals/grill/flext/source/flstk.h b/externals/grill/flext/source/flstk.h index 7f15edd9..4a9b7ece 100644 --- a/externals/grill/flext/source/flstk.h +++ b/externals/grill/flext/source/flstk.h @@ -79,8 +79,8 @@ protected: Output &Outlet(int ix) { return *outobj[ix]; } private: - virtual void m_dsp(int n,t_sample *const *in,t_sample *const *out); - virtual void m_signal(int n,t_sample *const *in,t_sample *const *out); + virtual bool CbDsp(); + virtual void CbSignal(); void ClearObjs(); diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index b6bb4eaa..25622b07 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -200,7 +200,14 @@ public: /*! \brief Check if the buffer is valid for use \note This must be true to use any of the other functions except set */ - bool Ok() const { return sym && data; } + bool Ok() const + { + return sym +#if FLEXT_SYS == FLEXT_SYS_PD + && arr +#endif + && data; + } /*! \brief Check if buffer content is valid (not in state of content change) \note buffer must be Ok() |