+instance Show SubBlock where
+ show (SubBlock a) = show a
+
+-- | 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)
+
+instance Metadata Dummy where
+ metaID _ = 0x00
+ metaSize = dumSize
+
+instance Binary Dummy where
+ put = putLazyByteString ∘ flip L.replicate 0x00 ∘ fromIntegral ∘ dumSize
+ get = fmap (Dummy ∘ fromIntegral) remaining
+
+-- | RIFF header for .wav files (before audio)
+data RIFFHeader
+ = RIFFHeader {
+ riffHeader ∷ L.ByteString
+ }
+ deriving (Eq, Show, Typeable)
+
+instance Metadata RIFFHeader where
+ metaID _ = 0x21
+
+instance Binary RIFFHeader where
+ put = putLazyByteString ∘ riffHeader
+ get = fmap RIFFHeader getRemainingLazyByteString
+
+-- | RIFF trailer for .wav files (after audio)
+data RIFFTrailer
+ = RIFFTrailer {
+ riffTrailer ∷ L.ByteString
+ }
+ deriving (Eq, Show, Typeable)
+
+instance Metadata RIFFTrailer where
+ metaID _ = 0x22
+
+instance Binary RIFFTrailer where
+ put = putLazyByteString ∘ riffTrailer
+ get = fmap RIFFTrailer getRemainingLazyByteString
+
+-- | Unknown but optional metadata found in the WavPack block.
+data Unknown
+ = Unknown {
+ -- | The ID of this unknown metadata without odd-size bit nor
+ -- large-block bit.
+ unkID ∷ Word8
+ -- | Raw data; must be less than 2^25 bytes long.
+ , unkData ∷ L.ByteString
+ }
+ deriving (Eq, Show, Typeable)
+
+instance Metadata Unknown where
+ metaID = unkID
+
+instance Binary Unknown where
+ put = putLazyByteString ∘ unkData
+ get = (⊥)