netclock 0.5 → 0.6
raw patch · 2 files changed
+13/−11 lines, 2 filesdep +bytestringdep ~hoscPVP ok
version bump matches the API change (PVP)
Dependencies added: bytestring
Dependency ranges changed: hosc
API changes (from Hackage documentation)
- Network.Netclock.Client: toFloat :: Datum -> Double
+ Network.Netclock.Client: toFloat :: Datum -> Float
Files
- Network/Netclock/Client.hs +11/−9
- netclock.cabal +2/−2
Network/Netclock/Client.hs view
@@ -1,7 +1,8 @@ module Network.Netclock.Client where import Sound.OSC.FD-import Sound.OpenSoundControl+import Sound.OSC.Core+import Sound.OSC.Type import Control.Concurrent (threadDelay, forkIO) import Control.Concurrent.MVar import Data.List@@ -9,6 +10,7 @@ import qualified Network.Socket as N import Data.Function import Control.Monad+import qualified Data.ByteString.Char8 as C data BpsChange = BpsChange {changeBps :: Double, changeTime :: Double, @@ -116,24 +118,24 @@ register :: String -> String -> String -> Int -> IO (UDP) register username clientIp serverIp localPort = do sc <- openUDP serverIp scport- let m = Message "/clock/register" [String username, - String clientIp,- Int localPort,- Int 1+ let m = message "/clock/register" [string username,+ string clientIp,+ int32 localPort,+ int32 1 ] sendOSC sc m return sc toFloat (Float f) = f-toFloat (Int f) = fromIntegral f+toFloat (Int32 f) = fromIntegral f readChange :: UDP -> IO (BpsChange) readChange localServer = do bundle <- recvBundle localServer let (Bundle t message) = bundle- let (Message _ (absBeat:bps:_)) = head message- absBeatF = toFloat absBeat- bpsF = toFloat bps+ let (Message _ (absBeat:bps:_)) = Data.List.head message+ absBeatF = fromJust $ d_get absBeat+ bpsF = fromJust $ d_get bps return BpsChange {changeBps = bpsF, changeTime = t, changeBeat = absBeatF
netclock.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.5+Version: 0.6 -- A short (one-line) description of the package. Synopsis: Netclock protocol@@ -51,7 +51,7 @@ Exposed-modules: Network.Netclock.Client -- Packages needed in order to build this package.- Build-depends: base < 5, network, hosc >= 0.7+ Build-depends: base < 5, network, hosc >= 0.7, bytestring -- Modules not exported by this package. -- Other-modules: