-- | Type class for every metadata sub-blocks.
class (Binary α, Eq α, Show α, Typeable α) ⇒ Metadata α where
- -- | Get the metadata ID (mandatory).
+ -- | Get the metadata ID without odd-size bit nor large-block bit
+ -- (mandatory).
metaID ∷ α → Word8
-- | Get the size of metadata (optional).
metaSize ∷ α → Word32
-- | Dummy metadata to pad WavPack blocks.
data Dummy
= Dummy {
+ -- | Must be less than 2^25 bytes long due to the limitation
+ -- of WavPack specification.
dumSize ∷ Word32
}
deriving (Eq, Show, Typeable)
-- | Unknown but optional metadata found in the WavPack block.
data Unknown
= Unknown {
+ -- | The ID of this unknown metadata.
unkID ∷ Word8
+ -- | Raw data; must be less than 2^25 bytes long.
, unkData ∷ L.ByteString
}
deriving (Eq, Show, Typeable)