X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=EsounD.git;a=blobdiff_plain;f=Sound%2FEsounD.hs;h=ab808e754470a0113c5db11c1c2bb220ed045e34;hp=a088e9072c79e8fbac137a5250c1f1fb769d87ee;hb=HEAD;hpb=72018d56d3994c4f514f511d5d0c7970fbb1e79c diff --git a/Sound/EsounD.hs b/Sound/EsounD.hs index a088e90..ab808e7 100644 --- a/Sound/EsounD.hs +++ b/Sound/EsounD.hs @@ -1,75 +1,17 @@ -- | Type-safe bindings to EsounD with monadic regions. module Sound.EsounD - ( Frame - - , Channels - , Mono - , Stereo - - , Player - , openPlayer + ( module Sound.EsounD.Types + , module Sound.EsounD.Streams + , module Sound.EsounD.Player + , module Sound.EsounD.Recorder + , module Sound.EsounD.Monitor + , module Sound.EsounD.Filter ) where -import Bindings.EsounD -import Control.Monad.CatchIO -import Control.Monad.Trans.Region -import Data.Bits -import Data.Int -import Network -import Prelude.Unicode -import System.IO.SaferFileHandles - -class Frame fr where - frameFmt ∷ fr → C'esd_format_t - -instance Frame Int8 where - frameFmt _ = c'ESD_BITS8 - -instance Frame Int16 where - frameFmt _ = c'ESD_BITS16 - -class Channels ch where - channelFmt ∷ ch → C'esd_format_t - -data Mono -instance Channels Mono where - channelFmt _ = c'ESD_MONO - -data Stereo -instance Channels Stereo where - channelFmt _ = c'ESD_STEREO - - --- ^ An ESD handle for playing a stream. -data Player fr ch (r ∷ * → *) - = Player { - plRate ∷ Int - , plHandle ∷ RegionalFileHandle WriteMode r - } - -instance Dup (Player fr ch) where - dup pl - = do h' ← dup (plHandle pl) - return pl { plHandle = h' } - --- | Open an ESD handle for playing a stream. -openPlayer ∷ ∀ fr ch s pr. - ( Frame fr - , Channels ch - , MonadCatchIO pr - ) - ⇒ Int -- ^ sample rate for the stream. - → HostName -- ^ host to connect to. - → Maybe String -- ^ name used to identify this stream to - -- ESD (if any). - → RegionT s pr (Player fr ch (RegionT s pr)) -openPlayer rate host name - = do let fmt = frameFmt ((⊥) ∷ fr) .&. - channelFmt ((⊥) ∷ ch) .&. - c'ESD_STREAM .&. - c'ESD_PLAY - return Player { - plRate = rate - , plHandle = error "FIXME: not implemented" - } +import Sound.EsounD.Filter +import Sound.EsounD.Monitor +import Sound.EsounD.Player +import Sound.EsounD.Recorder +import Sound.EsounD.Streams +import Sound.EsounD.Types