diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-08-30 10:54:36 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-08-30 10:54:36 +0000 |
commit | f129e8b48e44d5e3258ed14d517447e9d1391a6d (patch) | |
tree | 1ed0d1151718060cf00a7794558eb79d7cb210be /externals/grill/flext | |
parent | 5323bd2c4efc3796c35e25fc5111aad7dead65f6 (diff) |
don't use explicit so that STL can be used
small fixes for tutorial examples
added typed flext::NewAligned
svn path=/trunk/; revision=3463
Diffstat (limited to 'externals/grill/flext')
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 3 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/sndobj1/main.cpp | 4 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/stk1/main.cpp | 1 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/stk2/main.cpp | 4 |
4 files changed, 7 insertions, 5 deletions
diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index b1ec43cd..b6bb4eaa 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -76,6 +76,9 @@ public: //! Get an aligned memory block static void *NewAligned(size_t bytes,int bitalign = 128); + // same with templated type + template<typename T> + static T *NewAligned(size_t times,int bitalign = 128) { return static_cast<T *>(NewAligned(times*sizeof(T),bitalign)); } //! Free an aligned memory block static void FreeAligned(void *blk); //! Test for alignment diff --git a/externals/grill/flext/tutorial/sndobj1/main.cpp b/externals/grill/flext/tutorial/sndobj1/main.cpp index 2a339ee6..e4f3f347 100644 --- a/externals/grill/flext/tutorial/sndobj1/main.cpp +++ b/externals/grill/flext/tutorial/sndobj1/main.cpp @@ -44,7 +44,7 @@ public: float sh1,sh2; private: - static void Setup(t_class *c); + static void Setup(t_classid c); FLEXT_ATTRVAR_F(sh1) FLEXT_ATTRVAR_F(sh2) @@ -61,7 +61,7 @@ sndobj1::sndobj1(): AddOutSignal(2); // audio outs } -void sndobj1::Setup(t_class *c) +void sndobj1::Setup(t_classid c) { FLEXT_CADDATTR_VAR1(c,"shL",sh1); FLEXT_CADDATTR_VAR1(c,"shR",sh2); diff --git a/externals/grill/flext/tutorial/stk1/main.cpp b/externals/grill/flext/tutorial/stk1/main.cpp index 4f7c7e6a..564ad1a4 100644 --- a/externals/grill/flext/tutorial/stk1/main.cpp +++ b/externals/grill/flext/tutorial/stk1/main.cpp @@ -44,7 +44,6 @@ protected: private: Noise *inst; - static void Setup(t_class *c); }; FLEXT_NEW_DSP("stk1~",stk1) diff --git a/externals/grill/flext/tutorial/stk2/main.cpp b/externals/grill/flext/tutorial/stk2/main.cpp index b356d020..8189f32a 100644 --- a/externals/grill/flext/tutorial/stk2/main.cpp +++ b/externals/grill/flext/tutorial/stk2/main.cpp @@ -48,7 +48,7 @@ public: MY_FLOAT *vec; private: - static void Setup(t_class *c); + static void Setup(t_classid c); FLEXT_CALLBACK_F(m_sh1) FLEXT_CALLBACK_F(m_sh2) @@ -65,7 +65,7 @@ stk2::stk2() inst[0] = inst[1] = NULL; } -void stk2::Setup(t_class *c) +void stk2::Setup(t_classid c) { FLEXT_CADDMETHOD_F(c,0,"shL",m_sh1); FLEXT_CADDMETHOD_F(c,0,"shR",m_sh2); |