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

Portabilityunknown
Stabilityunstable
MaintainerConrad Parker <conrad@metadecks.org>

Data.ZoomCache.Types

Contents

Description

ZoomCache packet and summary types and interfaces

Synopsis

Classes

class ZoomReadable a whereSource

A codec instance must specify a SummaryData type, and implement all methods of this class.

Associated Types

data SummaryData a :: *Source

Summaries of a subsequence of values of type a. In the default instances for Int and Double, this is a record containing values such as the maximum, minimum and mean of the subsequence.

Methods

readRaw :: (Functor m, MonadIO m) => Iteratee [Word8] m aSource

An iteratee to read one value of type a from a stream of '[Word8]'.

readSummary :: (Functor m, MonadIO m) => Iteratee [Word8] m (SummaryData a)Source

An iteratee to read one value of type 'SummaryData a' from a stream of '[Word8]'.

prettyRaw :: a -> StringSource

Pretty printing, used for dumping values of type a.

prettySummaryData :: SummaryData a -> StringSource

Pretty printing for values of type 'SummaryData a'.

class ZoomWritable a whereSource

A codec instance must additionally specify a SummaryWork type

Associated Types

data SummaryWork a :: *Source

Intermediate calculations

Methods

fromRaw :: a -> BuilderSource

Serialize a value of type a

fromSummaryData :: SummaryData a -> BuilderSource

Serialize a 'SummaryData a'

initSummaryWork :: TimeStamp -> SummaryWork aSource

Generate a new 'SummaryWork a', given an initial timestamp.

updateSummaryData :: Int -> TimeStamp -> a -> SummaryWork a -> SummaryWork aSource

Update a SummaryData with the value of a occuring at the given TimeStamp.

toSummaryData :: Double -> SummaryWork a -> SummaryData aSource

Finalize a 'SummaryWork a', generating a 'SummaryData a'.

appendSummaryData :: Double -> SummaryData a -> Double -> SummaryData a -> SummaryData aSource

Append two SummaryData

data ZoomRaw Source

Constructors

forall a . ZoomReadable a => ZoomRaw [a] 

data ZoomSummary Source

Constructors

forall a . ZoomReadable a => ZoomSummary (Summary a) 

data ZoomWork Source

Constructors

forall a . (Typeable a, ZoomWritable a) => ZoomWork 

Fields

levels :: IntMap (Summary a -> Summary a)
 
currWork :: Maybe (SummaryWork a)
 

Types

data Summary a Source

A recorded block of summary data

summaryDuration :: Summary a -> Int64Source

The duration covered by a summary, in units of 1 / the track's datarate