]> gitweb @ CieloNegro.org - wavpack.git/commitdiff
haddock comments
authorPHO <pho@cielonegro.org>
Mon, 3 Jan 2011 03:32:28 +0000 (12:32 +0900)
committerPHO <pho@cielonegro.org>
Mon, 3 Jan 2011 03:32:28 +0000 (12:32 +0900)
Codec/Audio/WavPack/Types.hs

index 2e1446a8e67afa992151d8d0209d485345f950d5..5ef259890e0f26b3710391a35801344e369cb27c 100644 (file)
@@ -1,6 +1,7 @@
 {-# LANGUAGE
     UnicodeSyntax
   #-}
 {-# LANGUAGE
     UnicodeSyntax
   #-}
+-- | Data types for WavPack codec.
 module Codec.Audio.WavPack.Types
     ( BlockHeader(..)
     )
 module Codec.Audio.WavPack.Types
     ( BlockHeader(..)
     )
@@ -9,16 +10,28 @@ import Data.Binary
 import Data.Binary.Get
 import Data.Binary.Put
 
 import Data.Binary.Get
 import Data.Binary.Put
 
+-- | The preamble to every block in both the .wv and .wvc files.
 data BlockHeader
     = BlockHeader {
 data BlockHeader
     = BlockHeader {
+      -- | size of entire block (minus 8, of course)
         bhSize         ∷ !Word32
         bhSize         ∷ !Word32
+      -- | 0x402 to 0x410 are currently valid for decode
       , bhVersion      ∷ !Word16
       , bhVersion      ∷ !Word16
+      -- | track number (0 if not used, like now)
       , bhTrackNo      ∷ !Word8
       , bhTrackNo      ∷ !Word8
+      -- | track sub-index (0 if not used, like now)
       , bhIndexNo      ∷ !Word8
       , bhIndexNo      ∷ !Word8
+      -- | total samples for entire file, but this is only valid if
+      -- 'bhBlockIndex' == 0 and a value of -1 indicates unknown length
       , bhTotalSamples ∷ !Word32
       , bhTotalSamples ∷ !Word32
+      -- | index of first sample in block relative to beginning of
+      -- file (normally this would start at 0 for the first block)
       , bhBlockIndex   ∷ !Word32
       , bhBlockIndex   ∷ !Word32
+      -- | number of samples in this block (0 = no audio)
       , bhBlockSamples ∷ !Word32
       , bhBlockSamples ∷ !Word32
+      -- | various flags for id and decoding
       , bhFlags        ∷ !Word32
       , bhFlags        ∷ !Word32
+      -- | crc for actual decoded data
       , bhCRC          ∷ !Word32
       }
     deriving (Show, Eq)
       , bhCRC          ∷ !Word32
       }
     deriving (Show, Eq)
@@ -60,22 +73,3 @@ instance Binary BlockHeader where
                             , bhFlags        = flags
                             , bhCRC          = crc
                             }
                             , bhFlags        = flags
                             , bhCRC          = crc
                             }
-
-{-
-typedef struct {
-    char ckID [4];              // "wvpk"
-    uint32_t ckSize;            // size of entire block (minus 8, of course)
-    uint16_t version;           // 0x402 to 0x410 are currently valid for decode
-    uchar track_no;             // track number (0 if not used, like now)
-    uchar index_no;             // track sub-index (0 if not used, like now)
-    uint32_t total_samples;     // total samples for entire file, but this is
-                                // only valid if block_index == 0 and a value of
-                                // -1 indicates unknown length
-    uint32_t block_index;       // index of first sample in block relative to
-                                // beginning of file (normally this would start
-                                // at 0 for the first block)
-    uint32_t block_samples;     // number of samples in this block (0 = no audio)
-    uint32_t flags;             // various flags for id and decoding
-    uint32_t crc;               // crc for actual decoded data
-} WavpackHeader;
--}