-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Harmonix (Guitar Hero, Rock Band) DTA/DTB metadata library -- @package dtab @version 1.0.0.1 -- | 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] module Data.DTA.Serialize unserialize :: FromChunks a => DTA -> Either String a serialize :: ToChunks a => a -> DTA -- | Values which are stored as one or many chunks. Scalar types become one -- chunk, while lists and record types can make more. class ToChunks a toChunks :: ToChunks a => a -> [Chunk] -- | Values which can be read from one or many chunks. class FromChunks a fromChunks :: FromChunks a => [Chunk] -> Either String a -- | A key-value structure which is stored as a sequence of (tag -- rest...) chunks. newtype Dict a Dict :: Map ByteString a -> Dict a fromDict :: Dict a -> Map ByteString a getDict :: [Chunk] -> Either String (Dict [Chunk]) makeDict :: Dict [Chunk] -> [Chunk] dictLookup :: ByteString -> Dict v -> Either String v -- | A value which is DTA-stored as a parenthesized subtree around the -- normal representation. newtype InParens a InParens :: a -> InParens a fromInParens :: InParens a -> a -- | An integer 0 or 1. -- | An integer 0 or 1, or keyword TRUE or FALSE. -- | A String, not a Key. -- | A String, not a Key. -- | Stored as two chunks. Each subtype should be a single chunk. -- | Stored as two chunks. Each subtype should be a single chunk. -- | Represents Nothing with an empty chunk list. -- | Represents Nothing with an empty chunk list. -- | Each value is stored as one chunk in the list. -- | Each value is stored as one chunk in the list. -- | Stored as a Key, unlike the ByteString instance which -- is a String. newtype Keyword Keyword :: ByteString -> Keyword fromKeyword :: Keyword -> ByteString -- | Uses whichever toChunks is applicable. Does not tag which type -- is used. -- | First tries to read the Left type, then Right if that -- fails. instance Eq a => Eq (Dict a) instance Ord a => Ord (Dict a) instance Show a => Show (Dict a) instance Read a => Read (Dict a) instance Functor Dict instance Foldable Dict instance Traversable Dict instance Eq a => Eq (InParens a) instance Ord a => Ord (InParens a) instance Show a => Show (InParens a) instance Read a => Read (InParens a) instance Eq Keyword instance Ord Keyword instance Show Keyword instance Read Keyword instance (FromChunks a, FromChunks b) => FromChunks (Either a b) instance (ToChunks a, ToChunks b) => ToChunks (Either a b) instance FromChunks Keyword instance ToChunks Keyword instance FromChunks a => FromChunks [a] instance ToChunks a => ToChunks [a] instance FromChunks a => FromChunks (Maybe a) instance ToChunks a => ToChunks (Maybe a) instance (FromChunks a, FromChunks b) => FromChunks (a, b) instance (ToChunks a, ToChunks b) => ToChunks (a, b) instance FromChunks ByteString instance ToChunks ByteString instance FromChunks Float instance ToChunks Float instance FromChunks Integer instance ToChunks Integer instance FromChunks Bool instance ToChunks Bool instance FromChunks a => FromChunks (InParens a) instance ToChunks a => ToChunks (InParens a) instance FromChunks a => FromChunks (Dict a) instance ToChunks a => ToChunks (Dict a) instance FromChunks Chunk instance ToChunks Chunk instance FromChunks DTA instance ToChunks DTA -- | 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 Key :: 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 lFromDTB :: ByteString -> DTA hFromDTB :: 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 module Data.DTA.Serialize.Magma data RBProj RBProj :: Project -> RBProj project :: RBProj -> Project data Project Project :: ByteString -> Integer -> Metadata -> Gamedata -> Languages -> ByteString -> Midi -> DryVox -> AlbumArt -> Tracks -> Project toolVersion :: Project -> ByteString projectVersion :: Project -> Integer metadata :: Project -> Metadata gamedata :: Project -> Gamedata languages :: Project -> Languages destinationFile :: Project -> ByteString midi :: Project -> Midi dryVox :: Project -> DryVox albumArt :: Project -> AlbumArt tracks :: Project -> Tracks data AlbumArt AlbumArt :: ByteString -> AlbumArt albumArtFile :: AlbumArt -> ByteString data Languages Languages :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Languages english :: Languages -> Bool french :: Languages -> Bool italian :: Languages -> Bool spanish :: Languages -> Bool german :: Languages -> Bool japanese :: Languages -> Bool data Gamedata Gamedata :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> Gender -> Percussion -> Integer -> Float -> Gamedata previewStartMs :: Gamedata -> Integer -- | 1 is no dots, 7 is devils. rankGuitar :: Gamedata -> Integer rankBass :: Gamedata -> Integer rankDrum :: Gamedata -> Integer rankVocals :: Gamedata -> Integer rankKeys :: Gamedata -> Integer rankProKeys :: Gamedata -> Integer rankBand :: Gamedata -> Integer -- | Normal = 2300. Fast = 2000. vocalScrollSpeed :: Gamedata -> Integer -- | Slow (under 100bpm) = 16. Medium (100-160bpm) = 32. Fast (over 160bpm) -- = 64. animTempo :: Gamedata -> Integer vocalGender :: Gamedata -> Gender vocalPercussion :: Gamedata -> Percussion vocalParts :: Gamedata -> Integer guidePitchVolume :: Gamedata -> Float data Gender Male :: Gender Female :: Gender data Percussion Tambourine :: Percussion Cowbell :: Percussion Handclap :: Percussion data Metadata Metadata :: ByteString -> ByteString -> Keyword -> Keyword -> Integer -> ByteString -> ByteString -> ByteString -> Keyword -> Integer -> Integer -> Bool -> Metadata songName :: Metadata -> ByteString artistName :: Metadata -> ByteString genre :: Metadata -> Keyword subGenre :: Metadata -> Keyword yearReleased :: Metadata -> Integer albumName :: Metadata -> ByteString author :: Metadata -> ByteString releaseLabel :: Metadata -> ByteString country :: Metadata -> Keyword price :: Metadata -> Integer trackNumber :: Metadata -> Integer hasAlbum :: Metadata -> Bool data Midi Midi :: ByteString -> Either AutogenTheme ByteString -> Midi midiFile :: Midi -> ByteString autogenTheme :: Midi -> Either AutogenTheme ByteString data AutogenTheme DefaultTheme :: AutogenTheme AggressiveMetal :: AutogenTheme ArenaRock :: AutogenTheme DarkHeavyRock :: AutogenTheme DustyVintage :: AutogenTheme EdgyProgRock :: AutogenTheme FeelGoodPopRock :: AutogenTheme GaragePunkRock :: AutogenTheme PsychJamRock :: AutogenTheme SlowJam :: AutogenTheme SynthPop :: AutogenTheme data DryVox DryVox :: DryVoxPart -> DryVoxPart -> DryVoxPart -> Float -> DryVox part0 :: DryVox -> DryVoxPart part1 :: DryVox -> DryVoxPart part2 :: DryVox -> DryVoxPart tuningOffsetCents :: DryVox -> Float data DryVoxPart DryVoxPart :: ByteString -> Bool -> DryVoxPart dryVoxFile :: DryVoxPart -> ByteString dryVoxEnabled :: DryVoxPart -> Bool data Tracks Tracks :: DrumLayout -> AudioFile -> AudioFile -> AudioFile -> AudioFile -> AudioFile -> AudioFile -> AudioFile -> AudioFile -> Tracks drumLayout :: Tracks -> DrumLayout drumKit :: Tracks -> AudioFile drumKick :: Tracks -> AudioFile drumSnare :: Tracks -> AudioFile bass :: Tracks -> AudioFile guitar :: Tracks -> AudioFile vocals :: Tracks -> AudioFile keys :: Tracks -> AudioFile backing :: Tracks -> AudioFile data DrumLayout Kit :: DrumLayout KitSnare :: DrumLayout KitKick :: DrumLayout KitKickSnare :: DrumLayout data AudioFile AudioFile :: Bool -> Integer -> [Float] -> [Float] -> ByteString -> AudioFile audioEnabled :: AudioFile -> Bool channels :: AudioFile -> Integer pan :: AudioFile -> [Float] vol :: AudioFile -> [Float] audioFile :: AudioFile -> ByteString instance Eq AlbumArt instance Ord AlbumArt instance Read AlbumArt instance Show AlbumArt instance Eq Languages instance Ord Languages instance Read Languages instance Show Languages instance Eq Gender instance Ord Gender instance Read Gender instance Show Gender instance Enum Gender instance Bounded Gender instance Eq Percussion instance Ord Percussion instance Read Percussion instance Show Percussion instance Enum Percussion instance Bounded Percussion instance Eq Gamedata instance Ord Gamedata instance Read Gamedata instance Show Gamedata instance Eq Metadata instance Ord Metadata instance Read Metadata instance Show Metadata instance Eq AutogenTheme instance Ord AutogenTheme instance Read AutogenTheme instance Show AutogenTheme instance Enum AutogenTheme instance Bounded AutogenTheme instance Eq Midi instance Ord Midi instance Read Midi instance Show Midi instance Eq DryVoxPart instance Ord DryVoxPart instance Read DryVoxPart instance Show DryVoxPart instance Eq DryVox instance Ord DryVox instance Read DryVox instance Show DryVox instance Eq DrumLayout instance Ord DrumLayout instance Read DrumLayout instance Show DrumLayout instance Enum DrumLayout instance Bounded DrumLayout instance Eq AudioFile instance Ord AudioFile instance Read AudioFile instance Show AudioFile instance Eq Tracks instance Ord Tracks instance Read Tracks instance Show Tracks instance Eq Project instance Ord Project instance Read Project instance Show Project instance Eq RBProj instance Ord RBProj instance Read RBProj instance Show RBProj instance FromChunks AudioFile instance ToChunks AudioFile instance FromChunks DrumLayout instance ToChunks DrumLayout instance FromChunks Tracks instance ToChunks Tracks instance FromChunks DryVoxPart instance ToChunks DryVoxPart instance FromChunks DryVox instance ToChunks DryVox instance FromChunks AutogenTheme instance ToChunks AutogenTheme instance FromChunks Midi instance ToChunks Midi instance FromChunks Metadata instance ToChunks Metadata instance FromChunks Percussion instance ToChunks Percussion instance FromChunks Gender instance ToChunks Gender instance FromChunks Gamedata instance ToChunks Gamedata instance FromChunks Languages instance ToChunks Languages instance FromChunks AlbumArt instance ToChunks AlbumArt instance FromChunks Project instance ToChunks Project instance FromChunks RBProj instance ToChunks RBProj module Data.DTA.Serialize.RB3 type Path = Either ByteString Keyword data SongPackage SongPackage :: ByteString -> ByteString -> Bool -> Either Integer Keyword -> Song -> Maybe (Path) -> Maybe (Path) -> Either AnimTempo Integer -> Maybe (Path) -> Integer -> (Integer, Integer) -> Integer -> Dict Integer -> Maybe (InParens [Keyword]) -> Integer -> Integer -> Keyword -> Integer -> Keyword -> Maybe (Keyword) -> Gender -> Maybe (Integer) -> Integer -> Maybe (Bool) -> Maybe (ByteString) -> Maybe (Integer) -> Maybe (Pitch) -> Maybe (Tonality) -> Maybe (Float) -> Maybe (InParens [Integer]) -> Maybe (InParens [Integer]) -> Maybe (Float) -> Maybe (Keyword) -> SongPackage name :: SongPackage -> ByteString artist :: SongPackage -> ByteString master :: SongPackage -> Bool songId :: SongPackage -> Either Integer Keyword song :: SongPackage -> Song bank :: SongPackage -> Maybe (Path) drumBank :: SongPackage -> Maybe (Path) animTempo :: SongPackage -> Either AnimTempo Integer bandFailCue :: SongPackage -> Maybe (Path) songScrollSpeed :: SongPackage -> Integer preview :: SongPackage -> (Integer, Integer) songLength :: SongPackage -> Integer rank :: SongPackage -> Dict Integer solo :: SongPackage -> Maybe (InParens [Keyword]) format :: SongPackage -> Integer version :: SongPackage -> Integer gameOrigin :: SongPackage -> Keyword rating :: SongPackage -> Integer genre :: SongPackage -> Keyword subGenre :: SongPackage -> Maybe (Keyword) vocalGender :: SongPackage -> Gender shortVersion :: SongPackage -> Maybe (Integer) yearReleased :: SongPackage -> Integer albumArt :: SongPackage -> Maybe (Bool) albumName :: SongPackage -> Maybe (ByteString) albumTrackNumber :: SongPackage -> Maybe (Integer) vocalTonicNote :: SongPackage -> Maybe (Pitch) songTonality :: SongPackage -> Maybe (Tonality) tuningOffsetCents :: SongPackage -> Maybe (Float) realGuitarTuning :: SongPackage -> Maybe (InParens [Integer]) realBassTuning :: SongPackage -> Maybe (InParens [Integer]) guidePitchVolume :: SongPackage -> Maybe (Float) encoding :: SongPackage -> Maybe (Keyword) data Pitch C :: Pitch CSharp :: Pitch D :: Pitch DSharp :: Pitch E :: Pitch F :: Pitch FSharp :: Pitch G :: Pitch GSharp :: Pitch A :: Pitch ASharp :: Pitch B :: Pitch data Tonality Major :: Tonality Minor :: Tonality data AnimTempo KTempoSlow :: AnimTempo KTempoMedium :: AnimTempo KTempoFast :: AnimTempo data Song Song :: ByteString -> Maybe (InParens [Integer]) -> InParens (Dict (Either Integer (InParens [Integer]))) -> Integer -> InParens [Float] -> InParens [Float] -> InParens [Integer] -> DrumSounds -> DrumSounds -> Song songName :: Song -> ByteString tracksCount :: Song -> Maybe (InParens [Integer]) tracks :: Song -> InParens (Dict (Either Integer (InParens [Integer]))) vocalParts :: Song -> Integer pans :: Song -> InParens [Float] vols :: Song -> InParens [Float] cores :: Song -> InParens [Integer] drumSolo :: Song -> DrumSounds drumFreestyle :: Song -> DrumSounds data DrumSounds DrumSounds :: InParens [Keyword] -> DrumSounds seqs :: DrumSounds -> InParens [Keyword] instance Eq Pitch instance Ord Pitch instance Read Pitch instance Show Pitch instance Enum Pitch instance Bounded Pitch instance Eq Tonality instance Ord Tonality instance Read Tonality instance Show Tonality instance Enum Tonality instance Bounded Tonality instance Eq AnimTempo instance Ord AnimTempo instance Read AnimTempo instance Show AnimTempo instance Enum AnimTempo instance Bounded AnimTempo instance Eq DrumSounds instance Ord DrumSounds instance Read DrumSounds instance Show DrumSounds instance Eq Song instance Ord Song instance Read Song instance Show Song instance Eq SongPackage instance Ord SongPackage instance Read SongPackage instance Show SongPackage instance FromChunks DrumSounds instance ToChunks DrumSounds instance FromChunks Song instance ToChunks Song instance FromChunks AnimTempo instance ToChunks AnimTempo instance FromChunks Tonality instance ToChunks Tonality instance FromChunks Pitch instance ToChunks Pitch instance FromChunks SongPackage instance ToChunks SongPackage