diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-19 04:36:44 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-19 04:36:44 +0000 |
commit | 6a2cccf403ac6045d987eb771b5ac904a33b122a (patch) | |
tree | 7a53ad5250738c0258c59995a4312685fbcf6689 /externals/grill/flext | |
parent | 6b266723cb82ec38bfc0a1681bddf42e0eac8096 (diff) |
""
svn path=/trunk/; revision=482
Diffstat (limited to 'externals/grill/flext')
-rw-r--r-- | externals/grill/flext/readme.txt | 4 | ||||
-rw-r--r-- | externals/grill/flext/source/flbuf.cpp | 10 | ||||
-rw-r--r-- | externals/grill/flext/source/fldefs.h | 2 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 18 |
4 files changed, 26 insertions, 8 deletions
diff --git a/externals/grill/flext/readme.txt b/externals/grill/flext/readme.txt index 8389cac7..bc043c33 100644 --- a/externals/grill/flext/readme.txt +++ b/externals/grill/flext/readme.txt @@ -120,6 +120,7 @@ Version history: - added functions for SIMD support - fixed race condition when using LaunchThread in a setup function (now waiting for thread helper to initialize) - added flext::Forward function to send messages to bound symbols +- added "zero" flag to flext::buffer resize operation 0.4.2: - started port for jMax @@ -331,8 +332,7 @@ TODO list: general: - documentation - add log messages for debugging version -- feed assist function with in/outlet description -- MaxMSP: how to call separate help files for objects in a library? +- MaxMSP: how to call separate help files for objects in a library? -> object mappings (in OSX) - use PD's t_float type for floating point values (and what about t_int?) bugs: diff --git a/externals/grill/flext/source/flbuf.cpp b/externals/grill/flext/source/flbuf.cpp index 633f0d45..f7672b75 100644 --- a/externals/grill/flext/source/flbuf.cpp +++ b/externals/grill/flext/source/flbuf.cpp @@ -176,20 +176,21 @@ bool flext::buffer::Update() #endif } -void flext::buffer::Frames(int fr,bool keep) +void flext::buffer::Frames(int fr,bool keep,bool zero) { #if FLEXT_SYS == FLEXT_SYS_PD + // is this function guaranteed to keep memory and set rest to zero? ::garray_resize(arr,(float)fr); Update(); #elif FLEXT_SYS == FLEXT_SYS_MAX t_sample *tmp = NULL; - int sz = frames; + int sz = frames; if(fr < sz) sz = fr; if(keep) { // copy buffer data to tmp storage tmp = new t_sample[sz]; - if(tmp) + if(tmp) CopySamples(data,tmp,sz); else error("flext::buffer - not enough memory for keeping buffer~ contents"); @@ -210,7 +211,10 @@ void flext::buffer::Frames(int fr,bool keep) // copy data back CopySamples(tmp,data,sz); delete[] tmp; + if(zero && sz < fr) ZeroSamples(data+sz,fr-sz); } + else + if(zero) ZeroSamples(data,fr); #else #error #endif diff --git a/externals/grill/flext/source/fldefs.h b/externals/grill/flext/source/fldefs.h index 7ba0f1b2..da6d995c 100644 --- a/externals/grill/flext/source/fldefs.h +++ b/externals/grill/flext/source/fldefs.h @@ -67,6 +67,8 @@ FLEXT_REALHDR_S(NEW_CLASS, PARENT_CLASS, SETUPFUN) // ==================================================================================== /*! \defgroup FLEXT_D_INSTANCE Class instantiation + \note The name of your class is of importance! It must be the same as the external + \note (excluded an eventual ~ (tilde)) */ diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index b76437cc..c9235d95 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -129,22 +129,34 @@ public: //! Get frame count int Frames() const { return frames; } //! Set frame count - void Frames(int fr,bool keep = false); + void Frames(int fr,bool keep = false,bool zero = true); //! Graphic auto refresh interval void SetRefrIntv(float intv); protected: + //! buffer name const t_symbol *sym; + //! array holding audio data t_sample *data; - int chns,frames; + //! number of audio channels + int chns; + //! number of frames (multiplied by chns for the number of samples) + int frames; #if FLEXT_SYS == FLEXT_SYS_PD + //! pointer to the PD array structure t_garray *arr; + //! update interval float interval; - bool isdirty,ticking; + //! flag signaling that the data has been changed + bool isdirty; + //! flag showing that the update clock is active + bool ticking; + //! update clock t_clock *tick; private: + //! update clock callback static void cb_tick(buffer *b); #endif }; |