-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Handling of samples in an (audio) signal
--   
--   This package provides a type class to handle signed and unsigned
--   samples of various size and number of channels in a uniform way.
--   
--   We expect that you use the types <a>Int8</a>, <a>Word8</a> and so on
--   for monophonic samples and thus provide instances of the class for
--   them. Further we define Stereo record and mu-law sample type.
--   Quadrophony can be achieved by nested Stereo value, but I'm uncertain,
--   whether this is a good way to go. Maybe we add 5+1 channels or so in
--   future.
--   
--   This is used by packages <tt>sox</tt>, <tt>alsa</tt>,
--   <tt>synthesizer</tt>.
@package sample-frame
@version 0.0.3

module Sound.Frame

-- | This is a class for nested tuples used as sample frames.
--   
--   Should we make Storable a superclass of <a>C</a>?
class C y

-- | The argument is not touched and can be undefined
numberOfChannels :: C y => y -> Int

-- | Size of elements. In a nested record type, like <tt>Stereo (Stereo
--   a)</tt>, it is the size of the atomic element, in our example
--   <tt>a</tt>. We assume that the atomic element values all have the same
--   size, such that <tt>sizeOfElement undefined</tt> is defined.
sizeOfElement :: C y => y -> Int

-- | Default implementations for a foldable Frame.
numberOfChannelsFoldable :: (C y, Foldable f) => f y -> Int
sizeOfElementFoldable :: (C y, Foldable f) => f y -> Int

-- | Returns the size of an undefined element. This might be more efficient
--   than <a>sizeOfElementFoldable</a>.
sizeOfElementType :: (C y) => f y -> Int

-- | Space that an element consumes in a Storable Array. This is space for
--   the element plus padding.
paddedSizeOf :: Storable a => a -> Int
withSignal :: (y -> a) -> (sig y -> a)
instance Sound.Frame.C GHC.Word.Word8
instance Sound.Frame.C GHC.Int.Int8
instance Sound.Frame.C GHC.Word.Word16
instance Sound.Frame.C GHC.Int.Int16
instance Sound.Frame.C GHC.Word.Word32
instance Sound.Frame.C GHC.Int.Int32
instance Sound.Frame.C GHC.Types.Float
instance Sound.Frame.C GHC.Types.Double

module Sound.Frame.MuLaw
data T
cons :: Word8 -> T
decons :: T -> Word8
fromLinear16 :: Int16 -> T
toLinear16 :: T -> Int16
instance GHC.Classes.Eq Sound.Frame.MuLaw.T
instance GHC.Show.Show Sound.Frame.MuLaw.T
instance Test.QuickCheck.Arbitrary.Arbitrary Sound.Frame.MuLaw.T
instance Foreign.Storable.Storable Sound.Frame.MuLaw.T
instance Sound.Frame.C Sound.Frame.MuLaw.T

module Sound.Frame.Stereo
data T a
left :: T a -> a
right :: T a -> a
cons :: a -> a -> T a
map :: (a -> b) -> T a -> T b
data Channel
Left :: Channel
Right :: Channel
select :: T a -> Channel -> a
interleave :: (T a, T b) -> T (a, b)
sequence :: (Functor f) => f (T a) -> T (f a)
liftApplicative :: (Applicative f) => (f a -> f b) -> f (T a) -> f (T b)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Sound.Frame.Stereo.T a)
instance GHC.Show.Show a => GHC.Show.Show (Sound.Frame.Stereo.T a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Sound.Frame.Stereo.T a)
instance GHC.Base.Functor Sound.Frame.Stereo.T
instance GHC.Base.Applicative Sound.Frame.Stereo.T
instance Data.Foldable.Foldable Sound.Frame.Stereo.T
instance Data.Traversable.Traversable Sound.Frame.Stereo.T
instance Foreign.Storable.Storable a => Foreign.Storable.Storable (Sound.Frame.Stereo.T a)
instance Sound.Frame.C a => Sound.Frame.C (Sound.Frame.Stereo.T a)
