Skip to content

Commit

Permalink
Import Control.Monad.Trans.State qualified
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kersten committed May 3, 2012
1 parent c71eab4 commit 460e219
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sound/SC3/Server/Internal.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Control.Concurrent.MVar
import Control.Exception (bracket) import Control.Exception (bracket)
import Control.Monad import Control.Monad
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.State (execStateT, get, put) import qualified Control.Monad.Trans.State as State
import qualified Data.ByteString as BS import qualified Data.ByteString as BS
import qualified Data.ByteString.Internal as BS import qualified Data.ByteString.Internal as BS
import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy as BL
Expand Down Expand Up @@ -111,7 +111,7 @@ closeIT t = do


withWorldOptions :: (Ptr C'WorldOptions -> IO a) -> ServerOptions -> RTOptions -> IO a withWorldOptions :: (Ptr C'WorldOptions -> IO a) -> ServerOptions -> RTOptions -> IO a
withWorldOptions f so ro = do withWorldOptions f so ro = do
(fs, cs) <- flip execStateT ([], []) $ do (fs, cs) <- flip State.execStateT ([], []) $ do
-- c'WorldOptions'mPassword :: CString -- c'WorldOptions'mPassword :: CString
setOpt (\x -> x { c'WorldOptions'mNumBuffers = int (numberOfSampleBuffers so) }) setOpt (\x -> x { c'WorldOptions'mNumBuffers = int (numberOfSampleBuffers so) })
setOpt (\x -> x { c'WorldOptions'mMaxLogins = int (maxNumberOfLogins ro) }) setOpt (\x -> x { c'WorldOptions'mMaxLogins = int (maxNumberOfLogins ro) })
Expand Down Expand Up @@ -166,12 +166,12 @@ withWorldOptions f so ro = do
path :: [String] -> String path :: [String] -> String
path = L.intercalate ":" path = L.intercalate ":"
setOpt f = do setOpt f = do
(fs, cs) <- get (fs, cs) <- State.get
put (f:fs, cs) State.put (f:fs, cs)
setOptS f s = do setOptS f s = do
ptr <- liftIO (newCString s) ptr <- liftIO (newCString s)
(fs, cs) <- get (fs, cs) <- State.get
put (flip f ptr:fs, ptr:cs) State.put (flip f ptr:fs, ptr:cs)


instance OSC.Transport InternalTransport where instance OSC.Transport InternalTransport where
send = sendIT send = sendIT
Expand Down

0 comments on commit 460e219

Please sign in to comment.