aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flbuf.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-02-11 04:37:35 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-02-11 04:37:35 +0000
commit97926eb08cf74f277e522ffb8c7f985457822de3 (patch)
tree680b0e4c564057340a0b528ea6468d4e381a907d /externals/grill/flext/source/flbuf.cpp
parent06f62d1168209ca6b9e2c3c5264c96a0a4c7cc98 (diff)
""
svn path=/trunk/; revision=388
Diffstat (limited to 'externals/grill/flext/source/flbuf.cpp')
-rw-r--r--externals/grill/flext/source/flbuf.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/externals/grill/flext/source/flbuf.cpp b/externals/grill/flext/source/flbuf.cpp
index ebfe2abf..633f0d45 100644
--- a/externals/grill/flext/source/flbuf.cpp
+++ b/externals/grill/flext/source/flbuf.cpp
@@ -119,6 +119,24 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
return ret;
}
+bool flext::buffer::Valid() const
+{
+ if(sym) {
+#if FLEXT_SYS == FLEXT_SYS_PD
+ int frames1;
+ t_sample *data1;
+ return garray_getfloatarray(arr, &frames1, &data1) != 0;
+#elif FLEXT_SYS == FLEXT_SYS_MAX
+ const _buffer *p = (const _buffer *)sym->s_thing;
+ return p && p->b_valid;
+#else
+#error
+#endif
+ }
+ else return false;
+}
+
+
bool flext::buffer::Update()
{
if(!Ok()) return false;
@@ -172,7 +190,7 @@ void flext::buffer::Frames(int fr,bool keep)
// copy buffer data to tmp storage
tmp = new t_sample[sz];
if(tmp)
- BlockMoveData(data,tmp,sizeof(t_sample)*sz);
+ CopySamples(data,tmp,sz);
else
error("flext::buffer - not enough memory for keeping buffer~ contents");
}
@@ -190,7 +208,7 @@ void flext::buffer::Frames(int fr,bool keep)
if(tmp) {
// copy data back
- BlockMoveData(tmp,data,sizeof(t_sample)*sz);
+ CopySamples(tmp,data,sz);
delete[] tmp;
}
#else