diff options
author | Robin Gareus <robin@gareus.org> | 2016-07-07 15:36:13 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-07-07 15:37:11 +0200 |
commit | ef1e20f6a281f4e6a030b92382c2e3dc5809fe3c (patch) | |
tree | 1a5edad1a3d1df29d8ba1d9d571bd024d45ba3bc /libs/ardour/ardour/dsp_filter.h | |
parent | 44a3f042a7a878af45ae893e0361d6a8be315da4 (diff) |
some more lua-bindings
* allow C memory allocation with lua-lifetime
* expose some ChanMapping methods
Diffstat (limited to 'libs/ardour/ardour/dsp_filter.h')
-rw-r--r-- | libs/ardour/ardour/dsp_filter.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/ardour/ardour/dsp_filter.h b/libs/ardour/ardour/dsp_filter.h index 6220dddf5a..50fe1ff704 100644 --- a/libs/ardour/ardour/dsp_filter.h +++ b/libs/ardour/ardour/dsp_filter.h @@ -48,12 +48,13 @@ namespace ARDOUR { namespace DSP { */ class DspShm { public: - DspShm () + DspShm (size_t s = 0) : _data (0) , _size (0) { assert (sizeof(float) == sizeof (int32_t)); assert (sizeof(float) == sizeof (int)); + allocate (s); } ~DspShm () { @@ -65,6 +66,7 @@ namespace ARDOUR { namespace DSP { * @param s size, total number of float or integer elements to store. */ void allocate (size_t s) { + if (s == _size) { return; } _data = realloc (_data, sizeof(float) * s); if (_data) { _size = s; } } |