Safe Haskell | None |
---|---|
Language | Haskell2010 |
Media with a content stored in a Vector
- type CanBeSample i = (Typeable i, Eq i, NFData i, Storable i)
- class HasMediaBuffer s t where
- type MediaBufferFrom s
- type MediaBufferTo t
- type HasMediaBuffer' s = (HasMediaBuffer s s, MediaBufferFrom s ~ MediaBufferTo s)
- type HasMediaBufferL s t a b = (HasMediaBuffer s t, MediaBufferFrom s ~ a, MediaBufferTo t ~ b)
- type HasMediaBufferL' s a = (HasMediaBuffer s s, MediaBufferFrom s ~ a, MediaBufferTo s ~ a)
- mediaBuffer' :: HasMediaBuffer' s => Lens' s (MediaBufferFrom s)
- newtype MediaBuffer t = MkMediaBuffer (Vector t)
- mediaBufferVector :: Iso (MediaBuffer s) (MediaBuffer t) (Vector s) (Vector t)
- mediaBufferLength :: CanBeSample t => MediaBuffer t -> Int
- mediaBufferFromList :: CanBeSample s => [s] -> MediaBuffer s
- mediaBufferToList :: CanBeSample s => MediaBuffer s -> [s]
- mediaBufferFromByteString :: CanBeSample a => ByteString -> MediaBuffer a
- mediaBufferToByteString :: CanBeSample a => MediaBuffer a -> ByteString
- createMediaBuffer :: CanBeSample t => (forall s. ST s (MVector s t)) -> MediaBuffer t
- modifyMediaBuffer :: CanBeSample a => (forall s. MVector s a -> ST s ()) -> MediaBuffer a -> MediaBuffer a
- unsafeModifyMediaBuffer :: CanBeSample a => (forall s. MVector s a -> ST s r) -> MediaBuffer a -> (r, MediaBuffer a)
Documentation
type CanBeSample i = (Typeable i, Eq i, NFData i, Storable i) Source #
Always recurring contraints on Sample
types.
class HasMediaBuffer s t where Source #
Types containing a MediaBuffer
type MediaBufferFrom s Source #
The media buffer type contained in s
type MediaBufferTo t Source #
The type that results from changing the media buffer type in s
to b
mediaBuffer :: Lens s t (MediaBufferFrom s) (MediaBufferTo t) Source #
A lens for converting the media buffer
(CanBeSample (Pcm ca a), CanBeSample (Pcm cb b)) => HasMediaBuffer (Audio r ca (Raw * a)) (Audio r' cb (Raw * b)) Source # | |
type HasMediaBuffer' s = (HasMediaBuffer s s, MediaBufferFrom s ~ MediaBufferTo s) Source #
Like HasMediaBuffer
but with s ~ t
and MediaBufferFrom s ~ MediaBufferTo t
type HasMediaBufferL s t a b = (HasMediaBuffer s t, MediaBufferFrom s ~ a, MediaBufferTo t ~ b) Source #
Like HasMediaBuffer
but with the typical lens type parameters s t a b
type HasMediaBufferL' s a = (HasMediaBuffer s s, MediaBufferFrom s ~ a, MediaBufferTo s ~ a) Source #
Like HasMediaBufferL
but with the typical **simple** lens type parameters s a
mediaBuffer' :: HasMediaBuffer' s => Lens' s (MediaBufferFrom s) Source #
Like mediaBuffer
but with s ~ t
and MediaBufferFrom s ~ MediaBufferTo t
newtype MediaBuffer t Source #
A buffer for media data. This is just a newtype wrapper around Vector
.
MkMediaBuffer (Vector t) |
CanBeSample s => IsList (MediaBuffer s) Source # | |
(Eq t, Storable t) => Eq (MediaBuffer t) Source # | |
(Show a, CanBeSample a) => Show (MediaBuffer a) Source # | |
Generic (MediaBuffer t) Source # | |
Storable t => Monoid (MediaBuffer t) Source # | |
CanBeSample sampleType => Default (MediaBuffer sampleType) Source # | |
NFData (MediaBuffer t) Source # | |
(Storable a, Storable b) => Each (MediaBuffer a) (MediaBuffer b) a b Source # | Traversal instance |
type Rep (MediaBuffer t) Source # | |
type Item (MediaBuffer s) Source # | |
mediaBufferVector :: Iso (MediaBuffer s) (MediaBuffer t) (Vector s) (Vector t) Source #
MediaBuffer
to Vector
isomorphism
mediaBufferLength :: CanBeSample t => MediaBuffer t -> Int Source #
Return the number of BufferElement
s in the MediaBuffer
buffer.
mediaBufferFromList :: CanBeSample s => [s] -> MediaBuffer s Source #
Create a MediaBuffer
from a list in O(n).
mediaBufferToList :: CanBeSample s => MediaBuffer s -> [s] Source #
Convert the media buffer vector contents to a list in O(n).
mediaBufferFromByteString :: CanBeSample a => ByteString -> MediaBuffer a Source #
An efficient conversion of a ByteString
to a MediaBuffer
mediaBufferToByteString :: CanBeSample a => MediaBuffer a -> ByteString Source #
An efficient conversion of a MediaBuffer
to a ByteString
createMediaBuffer :: CanBeSample t => (forall s. ST s (MVector s t)) -> MediaBuffer t Source #
Create a new MediaBuffer
using an ST
action that returns a mutable
MVector
.
modifyMediaBuffer :: CanBeSample a => (forall s. MVector s a -> ST s ()) -> MediaBuffer a -> MediaBuffer a Source #
Modify the underlying Vector
of some MediaBuffer
with a function that is
applied to the mutable vector of that MediaBuffer
. The function must result
in a ST
action that does the modifications.
unsafeModifyMediaBuffer :: CanBeSample a => (forall s. MVector s a -> ST s r) -> MediaBuffer a -> (r, MediaBuffer a) Source #
Modify the underlying Vector
of some MediaBuffer
with a function that is
applied to the mutable vector of that MediaBuffer
. The function must result
in a ST
action that does the modifications.
Unsafe because results can be returned, so the thawn mutable vector might escape.