{-# LINE 1 "src/Sound/ALSA/Sequencer/Marshal/Client.hsc" #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Sound.ALSA.Sequencer.Marshal.Client where
import qualified Sound.ALSA.Sequencer.Utility as U
import qualified Foreign.C.Types as C
import qualified Data.Word as Word
import Foreign.Storable (Storable, )
newtype T =
Cons Word.Word8
{-# LINE 38 "src/Sound/ALSA/Sequencer/Marshal/Client.hsc" #-}
deriving (Eq, Ord, Storable)
instance Show T where
showsPrec prec (Cons x) =
U.showsRecord prec "Client" [U.showsField x]
system :: T
system = Cons 0
subscribers :: T
subscribers = Cons 254
broadcast :: T
broadcast = Cons 255
unknown :: T
unknown = Cons 253
{-# LINE 51 "src/Sound/ALSA/Sequencer/Marshal/Client.hsc" #-}
exp :: T -> C.CInt
exp (Cons c) = fromIntegral c
imp :: C.CInt -> T
imp p = Cons (fromIntegral p)
data Type = User | Kernel
impType :: C.CInt -> Type
impType x =
if x == 1
{-# LINE 66 "src/Sound/ALSA/Sequencer/Marshal/Client.hsc" #-}
then User
else Kernel