From 2bc701fec065db8d399498a8c2f4f4145acf3369 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 15 Jul 2004 21:34:12 +0000 Subject: the work of this evening ... svn path=/trunk/externals/tb/; revision=1868 --- sc4pd/source/support.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'sc4pd/source/support.cpp') 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 +#include #include "SC_PlugIn.h" -#include #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--; } -- cgit v1.2.1