Portability | unknown |
---|---|
Stability | unstable |
Maintainer | Conrad Parker <conrad@metadecks.org> |
Writing of ZoomCache files.
- class ZoomWrite t where
- writeData :: (Typeable a, ZoomWrite a, ZoomWritable a) => TrackNo -> a -> ZoomW ()
- writeDataVBR :: (Typeable a, ZoomWrite a, ZoomWritable a) => TrackNo -> (SampleOffset, a) -> ZoomW ()
- writeDataTS :: (Typeable a, ZoomWrite a, ZoomWritable a) => TrackNo -> (TimeStamp, a) -> ZoomW ()
- type ZoomW = StateT ZoomWHandle IO
- withFileWrite :: TrackMap -> Bool -> ZoomW () -> FilePath -> IO ()
- flush :: ZoomW ()
- data ZoomWHandle
- openWrite :: TrackMap -> Bool -> FilePath -> IO ZoomWHandle
- closeWrite :: ZoomWHandle -> IO ()
- watermark :: TrackNo -> ZoomW (Maybe Int)
- setWatermark :: TrackNo -> Int -> ZoomW ()
- mkTrackSpec :: ZoomReadable a => a -> Bool -> Bool -> SampleRateType -> Rational -> ByteString -> TrackSpec
- oneTrack :: ZoomReadable a => a -> Bool -> Bool -> SampleRateType -> Rational -> ByteString -> TrackMap
The ZoomWrite class
The ZoomWrite class provides write
, a method to write a
Haskell value to an open ZoomCache file.
Instance helpers
writeDataVBR :: (Typeable a, ZoomWrite a, ZoomWritable a) => TrackNo -> (SampleOffset, a) -> ZoomW ()Source
writeDataTS :: (Typeable a, ZoomWrite a, ZoomWritable a) => TrackNo -> (TimeStamp, a) -> ZoomW ()Source
The ZoomW monad
type ZoomW = StateT ZoomWHandle IOSource
A StateT IO monad for writing a ZoomCache file
:: TrackMap | |
-> Bool | Whether or not to write raw data packets. If False, only summary blocks are written. |
-> ZoomW () | |
-> FilePath | |
-> IO () |
Run a ZoomW ()
action on a given file handle, using the specified
TrackMap
specification
Force a flush of ZoomCache summary blocks to disk. It is not usually necessary to call this function as summary blocks are transparently written at regular intervals.
ZoomWHandle IO functions
data ZoomWHandle Source
:: TrackMap | |
-> Bool | Whether or not to write raw data packets. If False, only summary blocks are written. |
-> FilePath | |
-> IO ZoomWHandle |
Open a new ZoomCache file for writing, using a specified TrackMap
.
closeWrite :: ZoomWHandle -> IO ()Source
Watermarks
watermark :: TrackNo -> ZoomW (Maybe Int)Source
Query the maximum number of data points to buffer for a given track before forcing a flush of all buffered data and summaries.
setWatermark :: TrackNo -> Int -> ZoomW ()Source
Set the maximum number of data points to buffer for a given track before forcing a flush of all buffered data and summaries.
TrackSpec helpers
mkTrackSpec :: ZoomReadable a => a -> Bool -> Bool -> SampleRateType -> Rational -> ByteString -> TrackSpecSource
oneTrack :: ZoomReadable a => a -> Bool -> Bool -> SampleRateType -> Rational -> ByteString -> TrackMapSource
Create a track map for a stream of a given type, as track no. 1