packages feed

idiii 0.1 → 0.1.1

raw patch · 4 files changed

+35/−30 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- ID3.Type.FrameInfo: UFID :: String -> String -> FrameInfo
+ ID3.Type.FrameInfo: UFID :: String -> [Word8] -> FrameInfo
- ID3.Type.FrameInfo: id :: FrameInfo -> String
+ ID3.Type.FrameInfo: id :: FrameInfo -> [Word8]

Files

idiii.cabal view
@@ -1,11 +1,11 @@ Name:                idiii-Version:             0.1+Version:             0.1.1 Synopsis:            Reading and writing of ID3v2 tags Description:         Reading and writing of ID3v2 tags Category:            Text, Sound License:             BSD3 License-file:        LICENSE-Author:              laughedelic+Author:              laughedelic, Chris Wagner Maintainer:          christopher.t.wagner@gmail.com Build-Depends:       base < 5, haskell98, bytestring, polyparse, text, data-accessor, utf8-string, containers, MissingH Build-Type:          Simple
src/ID3/Parser/NativeFrames.hs view
@@ -14,31 +14,6 @@ --frameInfo :: String -> TagParser (FrameName, FrameInfo)  ----- {-- TODO: 4.1.   Unique file identifier----  This frame's purpose is to be able to identify the audio file in a---  database, that may provide more information relevant to the content.---  Since standardisation of such a database is beyond this document, all---  UFID frames begin with an 'owner identifier' field. It is a null----  terminated string with a URL [URL] containing an email address, or a---  link to a location where an email address can be found, that belongs---  to the organisation responsible for this specific database---  implementation. Questions regarding the database should be sent to---  the indicated email address. The URL should not be used for the---  actual database queries. The string---  "http://www.id3.org/dummy/ufid.html" should be used for tests. The---  'Owner identifier' must be non-empty (more than just a termination).---  The 'Owner identifier' is then followed by the actual identifier,---  which may be up to 64 bytes. There may be more than one "UFID" frame---  in a tag, but only one with the same 'Owner identifier'.-- --  <Header for 'Unique file identifier', ID: "UFID">- --  Owner identifier        <text string> $00- --  Identifier              <up to 64 bytes binary data>----- --}--- ---- {--    4.2.   Text information frames  --  The text information frames are often the most important frames,@@ -81,6 +56,36 @@ urlInfo name = do     url <- parseString 0     return $ URL url+++---- {-- 4.1.   Unique file identifier++--  This frame's purpose is to be able to identify the audio file in a+--  database, that may provide more information relevant to the content.+--  Since standardisation of such a database is beyond this document, all+--  UFID frames begin with an 'owner identifier' field. It is a null-+--  terminated string with a URL [URL] containing an email address, or a+--  link to a location where an email address can be found, that belongs+--  to the organisation responsible for this specific database+--  implementation. Questions regarding the database should be sent to+--  the indicated email address. The URL should not be used for the+--  actual database queries. The string+--  "http://www.id3.org/dummy/ufid.html" should be used for tests. The+--  'Owner identifier' must be non-empty (more than just a termination).+--  The 'Owner identifier' is then followed by the actual identifier,+--  which may be up to 64 bytes. There may be more than one "UFID" frame+--  in a tag, but only one with the same 'Owner identifier'.++ --  <Header for 'Unique file identifier', ID: "UFID">+ --  Owner identifier        <text string> $00+ --  Identifier              <up to 64 bytes binary data>++frameInfo "UFID" = do+    ownerId <- parseString 0+    identifier <- many' anyWord8+    return $ UFID ownerId identifier++---- --}   ---- {--    4.2.1.   Identification frames
src/ID3/Type/Frame.hs view
@@ -287,7 +287,7 @@  initFrame id = updateSize $ initID3Frame [ frHeader.>frID ^= id, frInfo ^= inf ]     where inf = case id of-            "UFID" -> UFID "" ""+            "UFID" -> UFID "" []             "TXXX" -> TXXX 03 "" ""             "TCMP" -> TCMP False             ('T':_)-> Text 03 ""
src/ID3/Type/FrameInfo.hs view
@@ -7,7 +7,7 @@ import Data.Word                (Word8)  data FrameInfo = UFID { owner :: String-                      , id    :: String }+                      , id    :: [Word8] }                | Text { enc   :: Integer                       , text  :: String }                | TXXX { enc   :: Integer@@ -77,7 +77,7 @@  instance Parsed FrameInfo where     unparse inf = case inf of-               UFID owner id       -> (encode owner) ++ [0x00] ++ (encode id)+               UFID owner theid    -> (encode owner) ++ [0x00] ++ theid                Text enc text       -> (fromInteger enc) : (encode text)                TXXX enc descr text -> (fromInteger enc) : (encode descr) ++ [0x00] ++ (encode text)                URL  url            ->  encode url