module Sound.MED.Raw.NotationInfo where

import Sound.MED.Basic.Amiga

data NotationInfo = NotationInfo
  { n_of_sharps :: UBYTE
  , flags       :: UBYTE
  , trksel      :: [ WORD ]
  , trkshow     :: [ UBYTE ]
  , trkghost    :: [ UBYTE ]
  , notetr      :: [ BYTE ]
  , pad         :: UBYTE
  }
  deriving (Show)

peek :: MEM -> PTR -> IO NotationInfo
peek m p = do
  n_of_sharps' <- peekUBYTE m (p+0)
  flags'       <- peekUBYTE m (p+1)
  trksel'      <- mapM (peekWORD  m) $ pointerRange (p+ 2) 2 5
  trkshow'     <- mapM (peekUBYTE m) $ pointerRange (p+22) 1 16
  trkghost'    <- mapM (peekUBYTE m) $ pointerRange (p+38) 1 16
  notetr'      <- mapM (peekBYTE  m) $ pointerRange (p+54) 1 63
  pad'         <- peekUBYTE m (p+117)
  return $ NotationInfo
    n_of_sharps' flags' trksel' trkshow' trkghost' notetr' pad'