aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flutil.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/flutil.cpp
parent06f62d1168209ca6b9e2c3c5264c96a0a4c7cc98 (diff)
""
svn path=/trunk/; revision=388
Diffstat (limited to 'externals/grill/flext/source/flutil.cpp')
-rw-r--r--externals/grill/flext/source/flutil.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/externals/grill/flext/source/flutil.cpp b/externals/grill/flext/source/flutil.cpp
index 1b1d929a..9be38cf1 100644
--- a/externals/grill/flext/source/flutil.cpp
+++ b/externals/grill/flext/source/flutil.cpp
@@ -17,9 +17,9 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#if FLEXT_OS == FLEXT_OS_WIN
#include <windows.h>
-#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || defined(__GNUC__)
+#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || FLEXT_OSAPI == FLEXT_OSAPI_MAC_OSX
#include <unistd.h>
-#elif FLEXT_OS == FLEXT_OS_MACOS
+#elif FLEXT_OS == FLEXT_OS_MAC
#include <Timer.h>
#include <Threads.h>
#endif
@@ -34,13 +34,41 @@ void flext::ZeroMem(void *dst,int bytes)
memset(dst,0,bytes);
}
+void flext::CopySamples(t_sample *dst,const t_sample *src,int cnt)
+{
+ int n = cnt>>3;
+ cnt -= n<<3;
+ while(n--) {
+ dst[0] = src[0]; dst[1] = src[1];
+ dst[2] = src[2]; dst[3] = src[3];
+ dst[4] = src[4]; dst[5] = src[5];
+ dst[6] = src[6]; dst[7] = src[7];
+ src += 8,dst += 8;
+ }
+
+ while(cnt--) *(dst++) = *(src++);
+}
+
+void flext::SetSamples(t_sample *dst,int cnt,t_sample s)
+{
+ int n = cnt>>3;
+ cnt -= n<<3;
+ while(n--) {
+ dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = dst[5] = dst[6] = dst[7] = s;
+ dst += 8;
+ }
+
+ while(cnt--) *(dst++) = s;
+}
+
+
void flext::Sleep(double s)
{
#if FLEXT_OS == FLEXT_OS_WIN
::Sleep((long)(s*1000.));
-#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || defined(__GNUC__)
+#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || FLEXT_OSAPI == FLEXT_OSAPI_MAC_OSX
usleep((long)(s*1000000.));
-#elif FLEXT_OS == FLEXT_OS_MACOS
+#elif FLEXT_OS == FLEXT_OS_MAC
// that's just for OS9!
UnsignedWide tick;
Microseconds(&tick);