zoom-cache-1.1.0.0: A streamable, seekable, zoomable cache file format

Portabilityunknown
Stabilityunstable
MaintainerConrad Parker <conrad@metadecks.org>

Data.Iteratee.ZoomCache

Contents

Description

Iteratee reading of ZoomCache files.

A typical usage, using the iteratee iter to process the level 3 summaries from the track called "rainfall":

  I.fileDriverRandom (enumCacheFile standardIdentifiers .
      I.joinI . filterTracksByName ["rainfall"] .
      I.joinI . enumSummaryLevel 3 $ iter) filename

Similarly, using the iteratee rawIter to process the raw data from the track called "rainfall":

  I.fileDriverRandom (enumCacheFile standardIdentifiers .
      I.joinI . filterTracksByName ["rainfall"] .
      I.joinI . enumPackets $ rawIter) filename

Synopsis

Types

data Block Source

Constructors

Block 

Instances

Reading zoom-cache files and ByteStrings

enumCacheFile :: (Functor m, MonadIO m) => [IdentifyCodec] -> Enumeratee ByteString [Block] m aSource

An enumeratee of a zoom-cache file, from the global header onwards. The global and track headers will be transparently read, and the CacheFile visible in the Block elements.

wholeTrackSummary :: (Functor m, MonadIO m) => TrackNo -> Iteratee [Block] m (TrackSpec, ZoomSummary)Source

Read the summary of an entire track.

wholeTrackSummaryUTC :: (Functor m, MonadIO m) => TrackNo -> Iteratee [Block] m (TrackSpec, Maybe ZoomSummaryUTC)Source

Read the summary of an entire track.

iterHeaders :: (Functor m, Monad m) => [IdentifyCodec] -> Iteratee ByteString m CacheFileSource

Parse only the global and track headers of a zoom-cache file, returning a CacheFile

enumBlock :: (Functor m, MonadIO m) => CacheFile -> Enumeratee ByteString [Block] m aSource

An iteratee of zoom-cache data, after global and track headers have been read, or if the CacheFile has been acquired elsewhere.

enumBlockIncomplete :: (Functor m, MonadIO m) => CacheFile -> Enumeratee ByteString [Block] m aSource

A version of enumBlock which won't fail with an EofException if the last bit is incomplete (perhaps still being written to).

enumBlockTrackNo :: (Functor m, MonadIO m) => CacheFile -> TrackNo -> Enumeratee ByteString [Block] m aSource

An enumeratee of zoom-cache data, after global and track headers have been read, or if the CacheFile has been acquired elsewhere. This version skips parsing of all tracks other than the specified TrackNo.

This function should only be used in applications where only one track is used from a file; if you need to process multiple tracks independently then give each an iteratee filtered by filterTracks or filterTracksByName, and run these in parallel on the output of enumCacheFile or enumBlock. Using this function multiple times in parallel will duplicate some parsing.

Seeking

Stream enumeratees

enumPackets :: (Functor m, Monad m) => Enumeratee [Block] [Packet] m aSource

Filter just the raw data

enumPacketsUTC :: (Functor m, Monad m) => Enumeratee [Block] [PacketUTC] m aSource

Filter just the raw data, timestamped by UTC

enumSummaryLevel :: (Functor m, Monad m) => Int -> Enumeratee [Block] [ZoomSummary] m aSource

Filter summaries at a particular summary level

enumSummaries :: (Functor m, Monad m) => Enumeratee [Block] [ZoomSummary] m aSource

Filter summaries at all levels

enumSummaryUTCLevel :: (Functor m, Monad m) => Int -> Enumeratee [Block] [ZoomSummaryUTC] m aSource

Filter summaries at a particular summary level

enumSummariesUTC :: (Functor m, Monad m) => Enumeratee [Block] [ZoomSummaryUTC] m aSource

Filter summaries at all levels

filterTracksByName :: (Functor m, Monad m) => CacheFile -> [ByteString] -> Enumeratee [Block] [Block] m aSource

Filter to a given list of track names

filterTracks :: (Functor m, Monad m) => [TrackNo] -> Enumeratee [Block] [Block] m aSource

Filter to a given list of track numbers

Low-level access to SampleOffsets

enumPacketSOs :: (Functor m, Monad m) => Enumeratee [Block] [PacketSO] m aSource

Filter just the raw data

enumSummarySOLevel :: (Functor m, Monad m) => Int -> Enumeratee [Block] [ZoomSummarySO] m aSource

Filter summaries at a particular summary level

enumSummarySOs :: (Functor m, Monad m) => Enumeratee [Block] [ZoomSummarySO] m aSource

Filter summaries at all levels

enumCTPSO :: (Functor m, Monad m) => Enumeratee [Block] [(CacheFile, TrackNo, PacketSO)] m aSource

Filter raw data

enumCTSO :: (Functor m, Monad m) => Enumeratee [Block] [(CacheFile, TrackNo, ZoomSummarySO)] m aSource

Filter summaries