module Sound.MED.Raw.PlaySeq where

import Sound.MED.Basic.Amiga

data PlaySeq = PlaySeq
  { name       :: [ UBYTE ]
  , reserved0  :: ULONG
  , reserved1  :: ULONG
  , len        :: UWORD
  , seq        :: [ UWORD ]
  }
  deriving (Show)

peek :: MEM -> PTR -> IO PlaySeq
peek m p = do
  name'      <- mapM (peekUBYTE m) $ pointerRange p 1 32
  reserved0' <- peekULONG m (p+32)
  reserved1' <- peekULONG m (p+36)
  len'       <- peekUWORD m (p+40)
  seq'       <- mapM (peekUWORD m) $ pointerRangeGen (p+42) 2 len'
  return $ PlaySeq
    name' reserved0' reserved1' len' seq'