diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2006-09-20 14:24:10 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2006-09-20 14:24:10 +0000 |
commit | b1224f91730af6a729f7e7a428eb660a6d734926 (patch) | |
tree | c49a430ed4700743c2851556a10d8685df748b2d /externals/grill/flext/source/flsupport.h | |
parent | b6d992055164079e3943dd0e75d8734214a9b280 (diff) |
enabled templates for flext classes, inlined timer functions, some more ToOut/Sys methods
fixed help name definition
added flfeatures.h for compile-time version-specific feature detection
changed eol-style
adapted for pd-devel 0.39
minimal fix for timers
cosmetic changes to calm the compiler
changes for Mac/Intel
svn path=/trunk/; revision=5979
Diffstat (limited to 'externals/grill/flext/source/flsupport.h')
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index dcc0acc2..f26437df 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -1124,16 +1124,37 @@ public: \remark Since this clock can be synchronized to an external clock (or e.g. the audio card) \remark it may differ from the clock of the operating system */ + /*! \brief Get time since real-time system startup. \note This is not the time of the operating system but of the real-time system. - \note It depends on the time source the system is synchronized to. + \note It may depend on the time source the system is synchronized to (e.g. audio sample rate). */ - static double GetTime(); + static double GetTime() + { + #if FLEXT_SYS == FLEXT_SYS_PD + return clock_gettimesince(0)*0.001; + #elif FLEXT_SYS == FLEXT_SYS_MAX + double tm; + clock_getftime(&tm); + return tm*0.001; + #else + #error Not implemented + #endif + } /*! \brief Get time granularity of the GetTime function. \note This can be zero if not determined. */ - static double GetTimeGrain(); + static double GetTimeGrain() + { + #if FLEXT_SYS == FLEXT_SYS_PD + return 0; + #elif FLEXT_SYS == FLEXT_SYS_MAX + return 0.001; + #else + #error Not implemented + #endif + } /*! \brief Get operating system time since flext startup. */ |