hosc-0.9: Haskell Open Sound Control



Temporal representations and clock operations (read current time and pause thread).



data Time Source

Time is represented in either UTC or NTP form.


UTCr Double 
NTPr Double 
NTPi Integer 


Eq Time 
Ord Time

Times can be ordered, avoid coercion if not required.

Show Time 

as_ntpi :: Time -> IntegerSource

Coerce to NTPi form.

as_utcr :: Time -> DoubleSource

Coerce to UTCr form.

ntpr_ntpi :: Double -> IntegerSource

Convert a real-valued NTP timestamp to an NTP timestamp.

ntpi_ntpr :: Integer -> DoubleSource

Convert an NTP timestamp to a real-valued NTP timestamp.

utcr_ntpi :: Double -> IntegerSource

Convert UTC timestamp to NTP timestamp.

ntpr_utcr :: Double -> DoubleSource

Convert NTP timestamp to UTC timestamp.

ntpi_utcr :: Integer -> DoubleSource

Convert NTP timestamp to UTC timestamp.

utc_base :: UTCTimeSource

The time at 1970-01-01:00:00:00.

utcr :: IO DoubleSource

Read current UTCr timestamp.

ntpi :: IO IntegerSource

Read current NTP timestamp.

pauseThread :: Double -> IO ()Source

Pause current thread for the indicated duration, given in seconds.

pauseThreadUntil :: Double -> IO ()Source

Pause current thread until the given utcr time.

immediately :: TimeSource

Execute the bundle immediately.