aboutsummaryrefslogtreecommitdiff
path: root/sc4pd/source/support.cpp
diff options
context:
space:
mode:
authorTim Blechmann <timblech@users.sourceforge.net>2004-07-15 21:34:12 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:11:55 +0200
commit2bc701fec065db8d399498a8c2f4f4145acf3369 (patch)
tree51dd381b5766a209bcfd91fc115d90c452a3073f /sc4pd/source/support.cpp
parent9ecfff90135ec05498f9f55a39cd386c855a8571 (diff)
the work of this evening ...
svn path=/trunk/externals/tb/; revision=1868
Diffstat (limited to 'sc4pd/source/support.cpp')
-rw-r--r--sc4pd/source/support.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/sc4pd/source/support.cpp b/sc4pd/source/support.cpp
index 2e06e9e..8d80bbe 100644
--- a/sc4pd/source/support.cpp
+++ b/sc4pd/source/support.cpp
@@ -35,15 +35,14 @@
*/
#include <flext.h>
+#include <flsupport.h>
#include "SC_PlugIn.h"
-#include <sys/time.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 406)
#error You need at least FLEXT version 0.4.6
#endif
-
bool sc_add (flext::AtomList a)
{
for (int i = 0; i!=a.Count();++i)
@@ -96,7 +95,16 @@ bool sc_ar(flext::AtomList a)
int32 timeseed()
{
static int32 count = 0;
- struct timeval tv;
- gettimeofday(&tv, 0);
- return (int32)tv.tv_sec ^ (int32)tv.tv_usec ^ count--;
+
+ double time = flext::GetOSTime();
+
+ double sec = trunc(time);
+ double usec = (time-sec)*1e6;
+
+ time_t tsec = sec;
+ suseconds_t tusec =usec; /* not exacty the way, it's calculated
+ in SuperCollider, but it's only
+ the seed */
+
+ return (int32)tsec ^ (int32)tusec ^ count--;
}