zoom-cache-0.8.1.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

Reading zoom-cache files and ByteStrings

enumCacheFile :: (Functor m, MonadIO m) => [IdentifyCodec] -> Enumeratee ByteString [Stream] 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 Stream elements.

wholeTrackSummary :: (Functor m, MonadIO m) => [IdentifyCodec] -> TrackNo -> Iteratee ByteString m (TrackSpec, ZoomSummary)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

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

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

enumStreamTrackNo :: (Functor m, MonadIO m) => CacheFile -> TrackNo -> Enumeratee ByteString [Stream] 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 enumStream. Using this function multiple times in parallel will duplicate some parsing.

Stream enumeratees

enumPackets :: (Functor m, MonadIO m) => Enumeratee [Stream] [Packet] m aSource

Filter just the raw data

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

Filter summaries at a particular summary level

enumSummaries :: (Functor m, MonadIO m) => Enumeratee [Stream] [ZoomSummary] m aSource

Filter summaries at all levels

enumCTP :: (Functor m, MonadIO m) => Enumeratee [Stream] [(CacheFile, TrackNo, Packet)] m aSource

Filter raw data

enumCTS :: (Functor m, MonadIO m) => Enumeratee [Stream] [(CacheFile, TrackNo, ZoomSummary)] m aSource

Filter summaries

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

Filter to a given list of track names

filterTracks :: (Functor m, MonadIO m) => [TrackNo] -> Enumeratee [Stream] [Stream] m aSource

Filter to a given list of track numbers