{-# LINE 1 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}
module Sound.ALSA.Sequencer.Marshal.Connect where
{-# LINE 2 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}


{-# LINE 4 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}

{-# LINE 5 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}

import qualified Sound.ALSA.Sequencer.Marshal.Address as Addr

import Foreign.Storable
          (Storable, sizeOf, alignment, peek, poke, pokeByteOff, peekByteOff, )


data T = Cons
   { source :: !Addr.T
   , dest   :: !Addr.T
   } deriving (Show,Eq,Ord)

instance Storable T where
  sizeOf _    = (4)
{-# LINE 19 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}
  alignment _ = (1)
{-# LINE 20 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}
  peek p      = do s <- (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 21 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}
                   d <- (\hsc_ptr -> peekByteOff hsc_ptr 2) p
{-# LINE 22 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}
                   return Cons { source = s, dest = d }
  poke p v    = (\hsc_ptr -> pokeByteOff hsc_ptr 0) p (source v)
{-# LINE 24 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}
             >> (\hsc_ptr -> pokeByteOff hsc_ptr 2)   p (dest v)
{-# LINE 25 "src/Sound/ALSA/Sequencer/Marshal/Connect.hsc" #-}