hCsound 0.2.2 → 0.2.3
raw patch · 2 files changed
+10/−11 lines, 2 files
Files
- hCsound.cabal +1/−2
- src/Sound/Csound/Interface.chs +9/−9
hCsound.cabal view
@@ -1,5 +1,5 @@ Name: hCsound-Version: 0.2.2+Version: 0.2.3 Cabal-Version: >= 1.2 Description: Haskell interface to Csound API. License: LGPL@@ -28,7 +28,6 @@ Hs-Source-Dirs: src src/Sound src/Sound/Csound- ghc-options: -O2 build-depends: base, haskell98, mtl build-tools: c2hs other-modules: C2HS
src/Sound/Csound/Interface.chs view
@@ -236,12 +236,11 @@ -- |Peek from a Ptr CFloat to a CsndFloat peekCsndFlt :: Ptr CCsndFlt -> IO CsndFlt-peekCsndFlt a = peek a >>= \x -> return $ cFloatConv x+peekCsndFlt = liftM cFloatConv . peek --- |Marshal a Ptr (Ptr CFloat) to a Ptr (CsndFlt).--- This is very likely broken.-peekCsndOutAry :: Ptr (Ptr CCsndFlt) -> IO (Ptr CsndFlt)-peekCsndOutAry ptrPtr = peek ptrPtr >>= \ptr -> return $ castPtr ptr+-- |Marshal a Ptr (Ptr CCsndFlt) to a Ptr (CCsndFlt).+peekCsndOutAry :: Ptr (Ptr CCsndFlt) -> IO (Ptr CCsndFlt)+peekCsndOutAry ptrPtr = peek ptrPtr -- |Variation on PVSDAT used in the pvs bus interface. -- The two parameters sliding and nb are only present@@ -1011,14 +1010,15 @@ (arrayLen, ptr) <- liftIO $ csoundGetTable' csptr tableNum --Adding 1 to the length to account for the guard point. case arrayLen of- Just val -> liftIO $ peekArray (val+1) ptr+ Just val -> liftIO . liftM (map cFloatConv) $+ peekArray (val+1) ptr Nothing -> throwError $ "Table " ++ show tableNum ++ " not found." {#fun unsafe csoundGetTable as csoundGetTable' { id `CsoundPtr',- alloca- `Ptr CsndFlt' peekCsndOutAry*,+ alloca- `Ptr CCsndFlt' peekCsndOutAry*, `Int' } -> `Maybe Int' maybeCInt#} @@ -1318,7 +1318,7 @@ csoundGetChannelPtr :: CsoundPtr -> String -> CsoundChannelDirectionalType ->- CsoundMonad (Ptr CsndFlt)+ CsoundMonad (Ptr CCsndFlt) csoundGetChannelPtr csPtr name chantype = do res <- liftIO $ csoundGetChannelPtr' csPtr name chantype case res of@@ -1329,7 +1329,7 @@ {#fun unsafe csoundGetChannelPtr as csoundGetChannelPtr' { id `CsoundPtr',- alloca- `Ptr CsndFlt' peekCsndOutAry*,+ alloca- `Ptr CCsndFlt' peekCsndOutAry*, `String', csoundChannelDirectionalTypeToCInt `CsoundChannelDirectionalType'