]> gitweb @ CieloNegro.org - EsounD.git/blobdiff - Sound/EsounD/Player.hs
Give up using type families for stream muxing
[EsounD.git] / Sound / EsounD / Player.hs
index 7691672c24d5dd26a5a5139ef63f4560ba948a19..cfb4e31edb9b9f3f70d5c1dcf04f071860b90426 100644 (file)
@@ -5,7 +5,6 @@
   , MultiParamTypeClasses
   , UnicodeSyntax
   , ScopedTypeVariables
-  , TypeFamilies
   #-}
 -- | EsounD player streams.
 module Sound.EsounD.Player
@@ -44,9 +43,13 @@ instance Dup (Player fr ch) where
     dup pl = do ch' ← dup (plCloseH pl)
                 return pl { plCloseH = ch' }
 
-instance (Mux L.Vector fr ch, dvec ~ DemuxedVec L.Vector fr ch) ⇒ Writable (Player fr ch) dvec where
-      write pl dvec
-          = liftIO $ sanitizeIOError $ L.hPut (plHandle pl) (mux dvec)
+instance Frame fr ⇒ Writable (Player fr Mono) (L.Vector fr) where 
+    write pl v
+        = liftIO $ sanitizeIOError $ L.hPut (plHandle pl) v
+
+instance Frame fr ⇒ Writable (Player fr Stereo) (L.Vector fr, L.Vector fr) where
+    write pl (l, r)
+        = liftIO $ sanitizeIOError $ L.hPut (plHandle pl) (interleave l r)
 
 -- | Open an ESD handle for playing a stream.
 openPlayer ∷ ∀fr ch s pr.