-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Harmonix (Guitar Hero, Rock Band) DTA/DTB metadata library
--
-- Read/write/encryption functions for the DTA/DTB metadata format used
-- by Harmonix Music Systems in their games, including the Guitar Hero,
-- Rock Band, and Karaoke Revolution series. Provides both a library and
-- executable.
@package dtab
@version 1.2
-- | The encryption scheme used for DTB files found on game discs.
module Data.DTA.Crypt
-- | The lazy infinite list of crypt bytes for old-style encryption.
oldCrypt :: Crypt
-- | The lazy infinite list of crypt bytes for new-style encryption.
newCrypt :: Crypt
-- | Take the first four bytes of the string as the key, and decrypt the
-- rest of the file.
decrypt :: Crypt -> ByteString -> ByteString
-- | Encrypt a string with a key, and append the key to the encrypted
-- string.
encrypt :: Crypt -> Key -> ByteString -> ByteString
-- | Decrypt an encrypted DTB file using the given crypt method.
decryptFile :: Crypt -> FilePath -> FilePath -> IO ()
-- | Encrypt an unencrypted DTB file using the given crypt method and key.
encryptFile :: Crypt -> Key -> FilePath -> FilePath -> IO ()
-- | Decrypt an encrypted DTB file across two handles.
decryptHandle :: Crypt -> Handle -> Handle -> IO ()
-- | Encrypt an unencrypted DTB files across two handles.
encryptHandle :: Crypt -> Key -> Handle -> Handle -> IO ()
-- | An encryption/decryption key.
type Key = Word32
-- | Using a key to generate an infinite stream of crypt bytes.
type Crypt = Key -> [Word8]
-- | All functions that take a Handle or FilePath do their
-- reading/writing strictly.
module Data.DTA
-- | A top-level file.
data DTA
DTA :: Word8 -> Tree -> DTA
[byteZero] :: DTA -> Word8
[topTree] :: DTA -> Tree
-- | A list of chunks, for either the top-level tree or a subtree.
data Tree
Tree :: Word32 -> [Chunk] -> Tree
[nodeID] :: Tree -> Word32
[treeChunks] :: Tree -> [Chunk]
-- | A data value, which may be a subtree. The constructors are ordered by
-- their chunk identification tag in the binary format.
data Chunk
Int :: Int32 -> Chunk
Float :: Float -> Chunk
Var :: ByteString -> Chunk
Sym :: ByteString -> Chunk
Unhandled :: Chunk
IfDef :: ByteString -> Chunk
Else :: Chunk
EndIf :: Chunk
Parens :: Tree -> Chunk
Braces :: Tree -> Chunk
String :: ByteString -> Chunk
Brackets :: Tree -> Chunk
Define :: ByteString -> Chunk
Include :: ByteString -> Chunk
Merge :: ByteString -> Chunk
IfNDef :: ByteString -> Chunk
Autorun :: Chunk
Undef :: ByteString -> Chunk
lFromDTB :: ByteString -> DTA
hFromDTB :: Handle -> IO DTA
hFromDTBv2 :: Handle -> IO DTA
fromDTB :: FilePath -> IO DTA
lToDTB :: DTA -> ByteString
hToDTB :: Handle -> DTA -> IO ()
toDTB :: FilePath -> DTA -> IO ()
sFromDTA :: String -> DTA
hFromDTA :: Handle -> IO DTA
fromDTA :: FilePath -> IO DTA
sToDTA :: DTA -> String
hToDTA :: Handle -> DTA -> IO ()
toDTA :: FilePath -> DTA -> IO ()
-- | Assign new sequential node IDs to each tree in a DTA, starting with
-- the top-level tree.
renumberFrom :: Word32 -> DTA -> DTA