-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell SDIF -- -- hsdif provides Sound.SDIF, a haskell module implementing a subset of -- Sound Description Interchange Format. @package hsdif @version 0.12 -- | SDIF related data types module Sound.SDIF.Type -- | Section of ByteString from ith to jth indices. section :: ByteString -> Int64 -> Int64 -> ByteString -- | Int based variant of section. section' :: ByteString -> Int -> Int -> ByteString -- | Data element type. type Type = Int -- | Is data element type standard. data_type_standard_p :: Type -> Bool -- | String describing indicated data element type. -- --
--   data_type_string 0x008 == "real number"
--   
data_type_string :: Type -> String -- | Size (in bytes) of data element type. -- --
--   data_type_size 0x008 == 8
--   
data_type_size :: Type -> Int -- | Universal type for element data. data Datum I8 :: Int -> Datum I16 :: Int -> Datum I32 :: Int -> Datum I64 :: Int64 -> Datum U32 :: Int -> Datum U64 :: Word64 -> Datum F32 :: Double -> Datum F64 :: Double -> Datum U8 :: Word8 -> Datum -- | Decoder for indicated data element type to Datum. data_type_decoder :: Type -> ByteString -> Datum -- | SDIF encoder for Datum. data_type_encoder :: Datum -> ByteString instance Eq Datum instance Show Datum -- | Byte level SDIF frame data structure. module Sound.SDIF.Byte.Matrix -- | Data integrity check for SDIF matix byte stream. is_matrix_b :: ByteString -> Bool -- | Matrix header size (constant). matrix_b_header_size :: Int -- | Extract matrix header byte stream. matrix_b_header :: ByteString -> ByteString -- | Extract matrix type string. matrix_b_type :: ByteString -> String -- | Extract matrix element data Type. matrix_b_data_type :: ByteString -> Type -- | Extract matrix row count. matrix_b_rows :: ByteString -> Int -- | Extract matrix column count. matrix_b_columns :: ByteString -> Int -- | Extract matrix element count (ie. rows by columns). matrix_b_elements :: ByteString -> Int -- | Calculate size of matrix data store (ie. elements by Type -- size). matrix_b_data_size :: ByteString -> Int -- | Variant of matrix_b_data_size taking into account required -- padding. matrix_b_storage_size :: ByteString -> Int -- | Extract matrix data from byte stream. matrix_b_to_matrix_v :: ByteString -> [Datum] -- | Byte level SDIF frame data structure. module Sound.SDIF.Byte.Frame -- | Data integrity check for SDIF frame data stream. is_frame_b :: ByteString -> Bool -- | Extract type string from SDIF frame byte stream. frame_b_type :: ByteString -> String -- | Extract size from SDIF frame byte stream. frame_b_size :: ByteString -> Int -- | Extract time stamp from SDIF frame byte stream. frame_b_time :: ByteString -> Double -- | Extract identifier from SDIF frame byte stream. frame_b_id :: ByteString -> Int -- | Extract matrix count from SDIF frame byte stream. frame_b_matrices :: ByteString -> Int -- | Extract frame data segment from SDIF frame byte stream. frame_b_data :: ByteString -> ByteString -- | Extract frame matrix (start,end) indices from SDIF frame byte -- stream. frame_b_matrix_i :: ByteString -> [(Int, Int)] -- | SDIF matrix functions. module Sound.SDIF.Matrix -- | SDIF matrix data store. data Matrix Matrix :: ByteString -> String -> Int -> Int -> Int -> Int -> Int -> Int -> [Datum] -> Matrix matrix_b :: Matrix -> ByteString matrix_type :: Matrix -> String matrix_data_type :: Matrix -> Int matrix_rows :: Matrix -> Int matrix_columns :: Matrix -> Int matrix_elements :: Matrix -> Int matrix_data_size :: Matrix -> Int matrix_storage_size :: Matrix -> Int matrix_v :: Matrix -> [Datum] -- | Decode Matrix. decode_matrix :: ByteString -> Matrix -- | Section of list from ith to jth indices. -- --
--   list_section [1..9] 4 6 == [5,6]
--   
list_section :: [a] -> Int -> Int -> [a] -- | Extract nth row of Matrix. matrix_row :: Matrix -> Int -> [Datum] -- | Extract nth column of Matrix. matrix_column :: Matrix -> Int -> [Datum] instance Eq Matrix instance Show Matrix -- | SDIF frame functions module Sound.SDIF.Frame -- | SDIF frame data store data Frame Frame :: ByteString -> String -> Int -> Double -> Int -> Int -> [(Int, Int)] -> [Matrix] -> Frame frame_b :: Frame -> ByteString frame_type :: Frame -> String frame_size :: Frame -> Int frame_time :: Frame -> Double frame_id :: Frame -> Int frame_matrices :: Frame -> Int frame_matrix_i :: Frame -> [(Int, Int)] frame_matrix_c :: Frame -> [Matrix] -- | Decode SDIF Frame. decode_frame :: ByteString -> Frame -- | Extract nth matrix of Frame. frame_matrix_b :: Frame -> Int -> ByteString -- | Extract and decode nth matrix of Frame. frame_matrix :: Frame -> Int -> Matrix instance Eq Frame instance Show Frame -- | Byte level SDIF data structure. module Sound.SDIF.Byte.SDIF -- | Check signature of SDIF byte stream. is_sdif_b :: ByteString -> Bool -- | Count number of frames at SDIF byte stream. sdif_b_frames :: ByteString -> Int -- | Extract start and end indices for n frames at SDIF byte stream. sdif_b_frame_i :: ByteString -> Int -> [(Int, Int)] -- | SDIF (Sound Description Interchange Format) module Sound.SDIF -- | SDIF data store. data SDIF SDIF :: ByteString -> Int -> [(Int, Int)] -> [Frame] -> SDIF sdif_b :: SDIF -> ByteString sdif_frames :: SDIF -> Int sdif_frame_i :: SDIF -> [(Int, Int)] sdif_frame_c :: SDIF -> [Frame] -- | Decode SDIF data stream. -- --
--   b <- B.readFile "/home/rohan/sw/hsdif/Help/crotale.sdif"
--   sdif_frames (decode_sdif b) == 2
--   
decode_sdif :: ByteString -> SDIF -- | Read and decode SDIF from named file. -- --
--   s <- sdif_read_file "/home/rohan/sw/hsdif/Help/crotale.sdif"
--   sdif_frame_i s == [(0,16),(16,856)]
--   
sdif_read_file :: FilePath -> IO SDIF -- | Extract nth frame data from SDIF. sdif_frame_b :: SDIF -> Int -> ByteString -- | Extract and decode nth frame from SDIF. -- --
--   frame_type (sdif_frame s 0) == "SDIF"
--   
sdif_frame :: SDIF -> Int -> Frame -- | Extract and decode jth matrix from ith frame from -- SDIF. -- --
--   matrix_type (sdif_matrix s 1 0) == "1RES"
--   
sdif_matrix :: SDIF -> Int -> Int -> Matrix -- | Run matrix_v on result of sdif_matrix. -- --
--   length (sdif_matrix_v s 1 0) == 200
--   
sdif_matrix_v :: SDIF -> Int -> Int -> [Datum] instance Eq SDIF instance Show SDIF