diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-02-13 04:37:27 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-02-13 04:37:27 +0000 |
commit | 34ce52e8bec33c97e9413917f0f4b221fa0c6734 (patch) | |
tree | ac6dfc0c3a10012441d8b82c29d9fc129f0635d8 /externals/grill/flext/source/flstk.h | |
parent | 4aea9c983b78ba15fb4358175c0599f14969628d (diff) |
""
svn path=/trunk/; revision=395
Diffstat (limited to 'externals/grill/flext/source/flstk.h')
-rw-r--r-- | externals/grill/flext/source/flstk.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/externals/grill/flext/source/flstk.h b/externals/grill/flext/source/flstk.h index 11d8ec6b..d6bad079 100644 --- a/externals/grill/flext/source/flstk.h +++ b/externals/grill/flext/source/flstk.h @@ -38,11 +38,16 @@ protected: public: Input(const t_sample *b,int vecsz); - MY_FLOAT lastOut() const { return (MY_FLOAT)buf[index]; } - MY_FLOAT tick(); + inline MY_FLOAT lastOut() const { return (MY_FLOAT)buf[index]; } + + inline MY_FLOAT tick() { + if(++index >= vecsz) index = 0; + return lastOut(); + } + MY_FLOAT *tick(MY_FLOAT *vector,unsigned int vectorSize); - void SetBuf(const t_sample *b) { buf = b; } + inline void SetBuf(const t_sample *b) { buf = b; } private: const t_sample *buf; @@ -56,10 +61,14 @@ protected: public: Output(t_sample *b,int vecsz); - void tick(MY_FLOAT sample); + inline void tick(MY_FLOAT s) { + buf[index] = (t_sample)s; + if(++index >= vecsz) index = 0; + } + void tick(const MY_FLOAT *vector,unsigned int vectorSize); - void SetBuf(t_sample *b) { buf = b; } + inline void SetBuf(t_sample *b) { buf = b; } private: t_sample *buf; |