-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Binding to the ALSA Library API.
--
-- This package provides access to
--
--
-- - ALSA sequencer (MIDI support)
-- - ALSA realtime audio signal input and output
--
@package alsa
@version 0.3
-- | This module contains functions for working with sequencer queue.
-- Reference:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_queue.html
module Sound.Alsa.Sequencer.Queue
data Queue
queue_direct :: Queue
alloc_queue :: SndSeq -> IO Queue
alloc_named_queue :: SndSeq -> String -> IO Queue
-- | Delete the specified queue.
free_queue :: SndSeq -> Queue -> IO ()
data QueueInfo
get_queue_info :: SndSeq -> Queue -> IO QueueInfo
set_queue_info :: SndSeq -> Queue -> QueueInfo -> IO ()
queue_info_copy :: QueueInfo -> QueueInfo -> IO ()
-- | Copy the content of an object to a newly created object.
queue_info_clone :: QueueInfo -> IO QueueInfo
queue_info_get_queue :: QueueInfo -> IO Queue
queue_info_get_name :: QueueInfo -> IO String
queue_info_get_locked :: QueueInfo -> IO Bool
queue_info_get_owner :: QueueInfo -> IO Client
queue_info_get_flags :: QueueInfo -> IO Word
queue_info_set_name :: QueueInfo -> String -> IO ()
queue_info_set_locked :: QueueInfo -> Bool -> IO ()
queue_info_set_owner :: QueueInfo -> Client -> IO ()
queue_info_set_flags :: QueueInfo -> Word -> IO ()
-- | Copy the content of one object into another.
data QueueStatus
get_queue_status :: SndSeq -> Queue -> IO QueueStatus
queue_status_copy :: QueueStatus -> QueueStatus -> IO ()
queue_status_clone :: QueueStatus -> IO QueueStatus
data QueueTempo
get_queue_tempo :: SndSeq -> Queue -> IO QueueTempo
set_queue_tempo :: SndSeq -> Queue -> QueueTempo -> IO ()
queue_tempo_copy :: QueueTempo -> QueueTempo -> IO ()
queue_tempo_clone :: QueueTempo -> IO QueueTempo
queue_tempo_get_queue :: QueueTempo -> IO Queue
queue_tempo_get_tempo :: QueueTempo -> IO Word
queue_tempo_get_ppq :: QueueTempo -> IO Int
queue_tempo_get_skew :: QueueTempo -> IO Word
queue_tempo_get_skew_base :: QueueTempo -> IO Word
queue_tempo_set_tempo :: QueueTempo -> Word -> IO ()
queue_tempo_set_ppq :: QueueTempo -> Int -> IO ()
queue_tempo_set_skew :: QueueTempo -> Word -> IO ()
queue_tempo_set_skew_base :: QueueTempo -> Word -> IO ()
data QueueTimer
get_queue_timer :: SndSeq -> Queue -> IO QueueTimer
set_queue_timer :: SndSeq -> Queue -> QueueTimer -> IO ()
queue_timer_copy :: QueueTimer -> QueueTimer -> IO ()
-- | Copy the content of an object to a newly created object.
queue_timer_clone :: QueueTimer -> IO QueueTimer
queue_timer_get_queue :: QueueTimer -> IO Queue
queue_timer_get_type :: QueueTimer -> IO QueueTimerType
queue_timer_get_resolution :: QueueTimer -> IO Word
queue_timer_set_type :: QueueTimer -> QueueTimerType -> IO ()
queue_timer_set_resolution :: QueueTimer -> Word -> IO ()
data QueueTimerType
TimerAlsa :: QueueTimerType
TimerMidiClock :: QueueTimerType
TimerMidiTick :: QueueTimerType
-- | This module contains functions for working with events. Reference:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_event.html
module Sound.Alsa.Sequencer.Event
-- | Wait until all events of the client are processed.
sync_output_queue :: SndSeq -> IO ()
-- | Get an event from the input buffer. If the input buffer is empty, then
-- it is filled with data from the sequencer queue. If there is no data
-- in the sequencer queue, then the process is either put to sleep (if
-- the sequencer is operating in blocking mode), or we throw
-- EAGAIN (if the sequence is operating in non-blocking mode).
--
-- We may also throw ENOSPC, which means that the sequencer
-- queue over-run and some events were lost (this clears the input
-- buffer).
event_input :: SndSeq -> IO Event
-- | Returns the number of events in the input buffer. If the input buffer
-- is empty and the boolean argument is true, then try to fill the input
-- buffer with data from the sequencer queue. See also:
-- snd_seq_event_input.
event_input_pending :: SndSeq -> Bool -> IO Word
-- | Output an event and drain the buffer, if it became full. Throws
-- exceptions. See also: event_output_direct,
-- event_output_buffer, event_output_pending,
-- drain_output, drop_output, extract_output,
-- remove_events
event_output :: SndSeq -> Event -> IO Word
-- | Output an event without draining the buffer. Throws -EAGAIN
-- if the buffer becomes full. See also event_output.
event_output_buffer :: SndSeq -> Event -> IO Word
-- | Output an event directly to the sequencer, NOT through the output
-- buffer. If an error occurs, then we throw an exception. See also
-- event_output.
event_output_direct :: SndSeq -> Event -> IO Word
-- | Return the size (in bytes) of pending events on output buffer. See
-- also snd_seq_event_output.
event_output_pending :: SndSeq -> IO Word
-- | Extract the first event in output buffer. Throws an exception on
-- error. See also snd_seq_event_output.
extract_output :: SndSeq -> IO Event
-- | Remove the first event in output buffer. Throws an exception on error.
-- See also snd_seq_event_output.
remove_output :: SndSeq -> IO ()
-- | Drain output buffer to sequencer. This function drains all pending
-- events on the output buffer. The function returns immediately after
-- the events are sent to the queues regardless whether the events are
-- processed or not. To get synchronization with the all event processes,
-- use sync_output_queue after calling this function. Throws an
-- exception on error. See also: event_output,
-- sync_output_queue.
drain_output :: SndSeq -> IO Word
-- | Remove events from both the user-space output buffer, and the
-- kernel-space sequencer queue. See also: drain_output,
-- drop_output_buffer, remove_events.
drop_output :: SndSeq -> IO ()
-- | Remove events from the user-space output buffer. See also:
-- drop_output.
drop_output_buffer :: SndSeq -> IO ()
-- | Remove events from both the user-space input buffer, and the
-- kernel-space sequencer queue. See also: drop_input_buffer,
-- remove_events.
drop_input :: SndSeq -> IO ()
-- | Remove events from the user-space input buffer. See also:
-- drop_input.
drop_input_buffer :: SndSeq -> IO ()
-- | This module contains functions for working with ports. Reference:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_port.html
module Sound.Alsa.Sequencer.Port
data Port
port_system_timer :: Port
port_system_announce :: Port
port_unknown :: Port
-- | Port capabilities.
data PortCap
cap_read :: PortCap
cap_write :: PortCap
cap_sync_read :: PortCap
cap_sync_write :: PortCap
cap_duplex :: PortCap
cap_subs_read :: PortCap
cap_subs_write :: PortCap
cap_no_export :: PortCap
caps :: [PortCap] -> PortCap
-- | Port types.
data PortType
type_specific :: PortType
type_midi_generic :: PortType
type_midi_gm :: PortType
type_midi_gs :: PortType
type_midi_xg :: PortType
type_midi_mt32 :: PortType
type_midi_gm2 :: PortType
type_synth :: PortType
type_direct_sample :: PortType
type_sample :: PortType
type_hardware :: PortType
type_software :: PortType
type_synthesizer :: PortType
type_port :: PortType
type_application :: PortType
types :: [PortType] -> PortType
data PortInfo
-- | Create a new port, as described by the info structure.
create_port :: SndSeq -> PortInfo -> IO ()
-- | Create a port - simple version.
create_simple_port :: SndSeq -> String -> PortCap -> PortType -> IO Port
-- | Delete the port.
delete_port :: SndSeq -> Port -> IO ()
-- | Create a new information area filled with data about a specific port
-- on our client.
get_port_info :: SndSeq -> Port -> IO PortInfo
-- | Create a new information area filled with data about an given port on
-- a given client.
get_any_port_info :: SndSeq -> Client -> Port -> IO PortInfo
-- | Get information about the first port on our client.
query_first_port :: SndSeq -> IO PortInfo
-- | Get information about the port with the next biggest identifier. If a
-- matching port is found, then its information is stored in the given
-- area, otherwise we throw an error.
query_next_port :: SndSeq -> PortInfo -> IO ()
-- | Set the information for the sequencer port based on the data in the
-- given information area.
set_port_info :: SndSeq -> Port -> PortInfo -> IO ()
port_info_copy :: PortInfo -> PortInfo -> IO ()
port_info_clone :: PortInfo -> IO PortInfo
port_info_get_port :: PortInfo -> IO Port
port_info_get_client :: PortInfo -> IO Client
-- | Get the address of the information area.
port_info_get_addr :: PortInfo -> IO Addr
port_info_get_name :: PortInfo -> IO String
port_info_get_capability :: PortInfo -> IO PortCap
port_info_get_midi_channels :: PortInfo -> IO Word
port_info_get_midi_voices :: PortInfo -> IO Word
port_info_get_synth_voices :: PortInfo -> IO Word
port_info_get_port_specified :: PortInfo -> IO Bool
port_info_get_timestamping :: PortInfo -> IO Bool
port_info_get_timestamp_real :: PortInfo -> IO Bool
port_info_get_timestamp_queue :: PortInfo -> IO Queue
port_info_get_read_use :: PortInfo -> IO Word
port_info_get_write_use :: PortInfo -> IO Word
port_info_set_port :: PortInfo -> Port -> IO ()
port_info_set_client :: PortInfo -> Client -> IO ()
-- | Set the port address.
port_info_set_addr :: PortInfo -> Addr -> IO ()
port_info_set_name :: PortInfo -> String -> IO ()
port_info_set_capability :: PortInfo -> PortCap -> IO ()
port_info_set_midi_channels :: PortInfo -> Word -> IO ()
port_info_set_synth_voices :: PortInfo -> Word -> IO ()
port_info_set_midi_voices :: PortInfo -> Word -> IO ()
port_info_set_port_specified :: PortInfo -> Bool -> IO ()
port_info_set_timestamping :: PortInfo -> Bool -> IO ()
port_info_set_timestamp_real :: PortInfo -> Bool -> IO ()
port_info_set_timestamp_queue :: PortInfo -> Queue -> IO ()
-- | This module contains functions for working with sequencer clients.
-- Reference:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_client.html
module Sound.Alsa.Sequencer.Client
-- | The type of client identifiers.
data Client
client_unknown :: Client
client_system :: Client
client_subscribers :: Client
client_broadcast :: Client
-- | Get the client identifier for the sequencer. A convinience function.
get_client_id :: SndSeq -> IO Client
-- | Set the name for the sequencer client. A convinience function.
set_client_name :: SndSeq -> String -> IO ()
data ClientInfo
-- | The different types of clients.
data ClientType
UserClient :: ClientType
KernelClient :: ClientType
-- | Create a new information area filled with data about the sequencer
-- client.
get_client_info :: SndSeq -> IO ClientInfo
-- | Create a new information area filled with data about an arbitrary
-- client.
get_any_client_info :: SndSeq -> Client -> IO ClientInfo
query_first_client :: SndSeq -> IO ClientInfo
-- | Get information about the client with the next biggest identifier.
query_next_client :: SndSeq -> ClientInfo -> IO Bool
-- | Set the information for the sequencer client based on the data in the
-- given information area.
set_client_info :: SndSeq -> ClientInfo -> IO ()
client_info_copy :: ClientInfo -> ClientInfo -> IO ()
client_info_clone :: ClientInfo -> IO ClientInfo
client_info_get_client :: ClientInfo -> IO Client
client_info_get_type :: ClientInfo -> IO ClientType
client_info_get_name :: ClientInfo -> IO String
client_info_get_broadcast_filter :: ClientInfo -> IO Bool
client_info_get_error_bounce :: ClientInfo -> IO Bool
client_info_get_num_ports :: ClientInfo -> IO Word
client_info_get_event_lost :: ClientInfo -> IO Word
client_info_set_client :: ClientInfo -> Client -> IO ()
client_info_set_name :: ClientInfo -> String -> IO ()
client_info_set_broadcast_filter :: ClientInfo -> Bool -> IO ()
client_info_set_error_bounce :: ClientInfo -> Bool -> IO ()
-- | Overview:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/seq.html
--
-- WARNING: This whole library does not seem to be particlarly thread
-- aware. Perhaps place the sequencer handle in an MVar?
module Sound.Alsa.Sequencer
-- | The type of sequencer handles.
data SndSeq
-- | Read/Write permissions for the sequencer device.
data OpenMode
open_output :: OpenMode
open_input :: OpenMode
open_duplex :: OpenMode
-- | Blocking behavior of the sequencer device.
data BlockMode
-- | Operations may block.
Block :: BlockMode
-- | Throw exceptions instead of blocking.
Nonblock :: BlockMode
-- | Creates a new handle and opens a connection to the kernel sequencer
-- interface. After a client is created successfully, a
-- ClientStart event is broadcast to the announce port. May throw
-- an exception. See also: open_lconf, close, get_seq_type,
-- get_seq_name, set_blocking, get_client_id.
open :: String -> OpenMode -> BlockMode -> IO SndSeq
-- | Close the sequencer. Closes the sequencer client and releases its
-- resources. After a client is closed, an event with ClientExit
-- is broadcast to announce port. The connection between other clients
-- are disconnected. Call this just before exiting your program. NOTE: we
-- could put this in a finalizer for the handle?
close :: SndSeq -> IO ()
-- | This is the name that should be passed to open in most cases.
default_seq_name :: String
-- | Get identifier of a sequencer handle. It is the same identifier
-- specified in the call to open.
get_seq_name :: SndSeq -> IO String
-- | Change the blocking mode of the given client. In block mode, the
-- client falls into sleep when it fills the output pool with events, or
-- when it demands events from an empty input pool. memory pool with full
-- events. Clients that are sleeping due to loack of space in the output
-- pool are woken when a certain amount of free space becomes available
-- (see set_output_room).
set_blocking :: SndSeq -> BlockMode -> IO ()
-- | Return the byte size of the output buffer.
get_output_buffer_size :: SndSeq -> IO Word
-- | Resize of the output buffer. This function clears all output events
-- (see drop_output).
set_output_buffer_size :: SndSeq -> Word -> IO ()
-- | Return the byte size of input buffer.
get_input_buffer_size :: SndSeq -> IO Word
-- | Resize the input buffer. This function clears all input events (see
-- drop_input).
set_input_buffer_size :: SndSeq -> Word -> IO ()
-- | Resize the output memory pool.
set_pool_output :: SndSeq -> Word -> IO ()
-- | Specify how much space should become free before waking clients that
-- are blocked due to a lack of space in the output pool.
set_pool_output_room :: SndSeq -> Word -> IO ()
-- | Reset the output pool.
reset_pool_output :: SndSeq -> IO ()
-- | Resize the input memory pool.
set_pool_input :: SndSeq -> Word -> IO ()
-- | Reset the input pool.
reset_pool_input :: SndSeq -> IO ()
-- | Simple subscription (w/o exclusive & time conversion).
connect_from :: SndSeq -> Port -> Addr -> IO ()
-- | Simple subscription (w/o exclusive & time conversion).
connect_to :: SndSeq -> Port -> Addr -> IO ()
-- | Simple disconnection.
disconnect_from :: SndSeq -> Port -> Addr -> IO ()
-- | Simple disconnection.
disconnect_to :: SndSeq -> Port -> Addr -> IO ()
-- | Used for volume control: means do not change the valume.
volume_same :: Int16
data RealTime
RT :: !Word32 -> !Word32 -> RealTime
rt_secs :: RealTime -> !Word32
rt_nano :: RealTime -> !Word32
data TimeStamp
TickTime :: !Word32 -> TimeStamp
RealTime :: !RealTime -> TimeStamp
data InstrCluster
data Instr
Instr :: !InstrCluster -> !Word32 -> !Word16 -> !Word16 -> Instr
instr_cluster :: Instr -> !InstrCluster
instr_std :: Instr -> !Word32
instr_bank :: Instr -> !Word16
instr_prg :: Instr -> !Word16
data Event
Event :: !Bool -> !Word8 -> !Queue -> !TimeStamp -> !Addr -> !Addr -> !EventData -> Event
ev_high_priority :: Event -> !Bool
ev_tag :: Event -> !Word8
ev_queue :: Event -> !Queue
ev_timestamp :: Event -> !TimeStamp
ev_source :: Event -> !Addr
ev_dest :: Event -> !Addr
ev_data :: Event -> !EventData
data EventData
NoteEv :: NoteEv -> Note -> EventData
CtrlEv :: CtrlEv -> Ctrl -> EventData
AddrEv :: AddrEv -> Addr -> EventData
ConnEv :: ConnEv -> Connect -> EventData
EmptyEv :: EmptyEv -> EventData
data NoteEv
ANote :: NoteEv
NoteOn :: NoteEv
NoteOff :: NoteEv
KeyPress :: NoteEv
data Note
Note :: !Word8 -> !Word8 -> !Word8 -> !Word8 -> !Word32 -> Note
note_channel :: Note -> !Word8
note_note :: Note -> !Word8
note_velocity :: Note -> !Word8
note_off_velocity :: Note -> !Word8
note_duration :: Note -> !Word32
-- | Make a note whose unspecified fields contain 0.
simple_note :: Word8 -> Word8 -> Word8 -> Note
data CtrlEv
Controller :: CtrlEv
PgmChange :: CtrlEv
ChanPress :: CtrlEv
PitchBend :: CtrlEv
Control14 :: CtrlEv
NonRegParam :: CtrlEv
RegParam :: CtrlEv
SongPos :: CtrlEv
SongSel :: CtrlEv
QFrame :: CtrlEv
TimeSign :: CtrlEv
KeySign :: CtrlEv
data Ctrl
Ctrl :: !Word8 -> !Word32 -> !Int32 -> Ctrl
ctrl_channel :: Ctrl -> !Word8
ctrl_param :: Ctrl -> !Word32
ctrl_value :: Ctrl -> !Int32
data AddrEv
ClientStart :: AddrEv
ClientExit :: AddrEv
ClientChange :: AddrEv
PortStart :: AddrEv
PortExit :: AddrEv
PortChange :: AddrEv
data Addr
Addr :: !Client -> !Port -> Addr
addr_client :: Addr -> !Client
addr_port :: Addr -> !Port
-- | Parse the given string into sequencer address. The client and port are
-- separated by either colon or period, e.g. 128:1. The function also
-- accepts client names.
parse_address :: SndSeq -> String -> IO Addr
-- | The address of all subscribed ports.
addr_subscribers :: Addr
data ConnEv
PortSubscribed :: ConnEv
PortUnsubscribed :: ConnEv
data Connect
data EmptyEv
TuneRequest :: EmptyEv
Reset :: EmptyEv
Sensing :: EmptyEv
None :: EmptyEv
Unknown :: EmptyEv
data Sample
Sample :: !Word32 -> !Word16 -> !Word16 -> Sample
sample_std :: Sample -> !Word32
sample_bank :: Sample -> !Word16
sample_prg :: Sample -> !Word16
newtype Cluster
Cluster :: InstrCluster -> Cluster
cluster_cluster :: Cluster -> InstrCluster
-- | These are all 14 bit values.
data Volume
Volume :: !Int16 -> !Int16 -> !Int16 -> !Int16 -> Volume
volume_volume :: Volume -> !Int16
volume_lr :: Volume -> !Int16
volume_fr :: Volume -> !Int16
volume_du :: Volume -> !Int16
data AlsaException
-- | the (positive) error code
exception_code :: AlsaException -> Word
-- | a text description of the problem
exception_description :: AlsaException -> String
-- | Catch an exception generated by the binding.
alsa_catch :: IO a -> (AlsaException -> IO a) -> IO a
module Sound.Alsa.Error
data AlsaException
AlsaException :: String -> String -> Errno -> AlsaException
exception_location :: AlsaException -> String
exception_description :: AlsaException -> String
exception_code :: AlsaException -> Errno
checkResult :: (Integral a) => String -> a -> IO a
checkResult_ :: (Integral a) => String -> a -> IO ()
throwAlsa :: String -> Errno -> IO a
catchAlsa :: IO a -> (AlsaException -> IO a) -> IO a
catchAlsaErrno :: Errno -> IO a -> IO a -> IO a
catchXRun :: IO a -> IO a -> IO a
showAlsaException :: AlsaException -> String
-- | Converts any AlsaException into an IOError. This
-- produces better a error message than letting an uncaught
-- AlsaException propagate to the top.
rethrowAlsaExceptions :: IO a -> IO a
-- | Returns the message for an error code.
strerror :: Errno -> IO String
snd_strerror :: Errno -> IO CString
instance Typeable AlsaException
module Sound.Alsa.Core
newtype Pcm
Pcm :: (Ptr (Pcm)) -> Pcm
newtype PcmHwParams
PcmHwParams :: (Ptr (PcmHwParams)) -> PcmHwParams
newtype PcmSwParams
PcmSwParams :: (Ptr (PcmSwParams)) -> PcmSwParams
data PcmStream
PcmStreamPlayback :: PcmStream
PcmStreamCapture :: PcmStream
PcmStreamLast :: PcmStream
data PcmAccess
PcmAccessMmapInterleaved :: PcmAccess
PcmAccessMmapNoninterleaved :: PcmAccess
PcmAccessMmapComplex :: PcmAccess
PcmAccessRwInterleaved :: PcmAccess
PcmAccessRwNoninterleaved :: PcmAccess
PcmAccessLast :: PcmAccess
data PcmFormat
PcmFormatUnknown :: PcmFormat
PcmFormatS8 :: PcmFormat
PcmFormatU8 :: PcmFormat
PcmFormatS16Le :: PcmFormat
PcmFormatS16Be :: PcmFormat
PcmFormatU16Le :: PcmFormat
PcmFormatU16Be :: PcmFormat
PcmFormatS24Le :: PcmFormat
PcmFormatS24Be :: PcmFormat
PcmFormatU24Le :: PcmFormat
PcmFormatU24Be :: PcmFormat
PcmFormatS32Le :: PcmFormat
PcmFormatS32Be :: PcmFormat
PcmFormatU32Le :: PcmFormat
PcmFormatU32Be :: PcmFormat
PcmFormatFloatLe :: PcmFormat
PcmFormatFloatBe :: PcmFormat
PcmFormatFloat64Le :: PcmFormat
PcmFormatFloat64Be :: PcmFormat
PcmFormatIec958SubframeLe :: PcmFormat
PcmFormatIec958SubframeBe :: PcmFormat
PcmFormatMuLaw :: PcmFormat
PcmFormatALaw :: PcmFormat
PcmFormatImaAdpcm :: PcmFormat
PcmFormatMpeg :: PcmFormat
PcmFormatGsm :: PcmFormat
PcmFormatSpecial :: PcmFormat
PcmFormatS243le :: PcmFormat
PcmFormatS243be :: PcmFormat
PcmFormatU243le :: PcmFormat
PcmFormatU243be :: PcmFormat
PcmFormatS203le :: PcmFormat
PcmFormatS203be :: PcmFormat
PcmFormatU203le :: PcmFormat
PcmFormatU203be :: PcmFormat
PcmFormatS183le :: PcmFormat
PcmFormatS183be :: PcmFormat
PcmFormatU183le :: PcmFormat
PcmFormatU183be :: PcmFormat
PcmFormatLast :: PcmFormat
PcmFormatS16 :: PcmFormat
PcmFormatU16 :: PcmFormat
PcmFormatS24 :: PcmFormat
PcmFormatU24 :: PcmFormat
PcmFormatS32 :: PcmFormat
PcmFormatU32 :: PcmFormat
PcmFormatFloat :: PcmFormat
PcmFormatFloat64 :: PcmFormat
PcmFormatIec958Subframe :: PcmFormat
pcm_open :: String -> PcmStream -> Int -> IO (Pcm)
pcm_close :: Pcm -> IO ()
pcm_prepare :: Pcm -> IO ()
pcm_start :: Pcm -> IO ()
pcm_drop :: Pcm -> IO ()
pcm_drain :: Pcm -> IO ()
pcm_hw_params :: Pcm -> PcmHwParams -> IO ()
pcm_hw_params_any :: Pcm -> PcmHwParams -> IO ()
pcm_hw_params_set_access :: Pcm -> PcmHwParams -> PcmAccess -> IO ()
pcm_hw_params_set_format :: Pcm -> PcmHwParams -> PcmFormat -> IO ()
pcm_hw_params_set_rate :: Pcm -> PcmHwParams -> Int -> Ordering -> IO ()
pcm_hw_params_set_channels :: Pcm -> PcmHwParams -> Int -> IO ()
pcm_hw_params_set_buffer_size :: Pcm -> PcmHwParams -> Int -> IO ()
pcm_hw_params_get_buffer_size :: PcmHwParams -> IO (Int)
pcm_hw_params_get_period_size :: PcmHwParams -> IO (Int, Ordering)
pcm_hw_params_set_period_time_near :: Pcm -> PcmHwParams -> Int -> Ordering -> IO (Int, Ordering)
pcm_hw_params_set_periods :: Pcm -> PcmHwParams -> Int -> Ordering -> IO ()
pcm_hw_params_set_buffer_time_near :: Pcm -> PcmHwParams -> Int -> Ordering -> IO (Int, Ordering)
pcm_hw_params_get_buffer_time :: PcmHwParams -> IO (Int, Ordering)
pcm_sw_params_set_start_threshold :: Pcm -> PcmSwParams -> Int -> IO ()
pcm_sw_params_set_avail_min :: Pcm -> PcmSwParams -> Int -> IO ()
pcm_sw_params_set_xfer_align :: Pcm -> PcmSwParams -> Int -> IO ()
pcm_sw_params_set_silence_threshold :: Pcm -> PcmSwParams -> Int -> IO ()
pcm_sw_params_set_silence_size :: Pcm -> PcmSwParams -> Int -> IO ()
pcm_readi :: Pcm -> Ptr a -> Int -> IO (Int)
pcm_writei :: Pcm -> Ptr a -> Int -> IO (Int)
pcm_hw_params_malloc :: IO (PcmHwParams)
pcm_hw_params_free :: PcmHwParams -> IO ()
pcm_sw_params_malloc :: IO (PcmSwParams)
pcm_sw_params_free :: PcmSwParams -> IO ()
pcm_sw_params :: Pcm -> PcmSwParams -> IO ()
pcm_sw_params_current :: Pcm -> PcmSwParams -> IO ()
orderingToInt :: Ordering -> CInt
intToOrdering :: CInt -> Ordering
peekOrdering :: Ptr CInt -> IO Ordering
withOrdering :: Ordering -> (Ptr CInt -> IO a) -> IO a
pcm_open'_ :: (Ptr (Pcm)) -> ((Ptr CChar) -> (CInt -> (CInt -> (IO CInt))))
pcm_close'_ :: (Pcm) -> (IO CInt)
pcm_prepare'_ :: (Pcm) -> (IO CInt)
pcm_start'_ :: (Pcm) -> (IO CInt)
pcm_drop'_ :: (Pcm) -> (IO CInt)
pcm_drain'_ :: (Pcm) -> (IO CInt)
pcm_hw_params'_ :: (Pcm) -> ((PcmHwParams) -> (IO CInt))
pcm_hw_params_any'_ :: (Pcm) -> ((PcmHwParams) -> (IO CInt))
pcm_hw_params_set_access'_ :: (Pcm) -> ((PcmHwParams) -> (CInt -> (IO CInt)))
pcm_hw_params_set_format'_ :: (Pcm) -> ((PcmHwParams) -> (CInt -> (IO CInt)))
pcm_hw_params_set_rate'_ :: (Pcm) -> ((PcmHwParams) -> (CUInt -> (CInt -> (IO CInt))))
pcm_hw_params_set_channels'_ :: (Pcm) -> ((PcmHwParams) -> (CUInt -> (IO CInt)))
pcm_hw_params_set_buffer_size'_ :: (Pcm) -> ((PcmHwParams) -> (CULong -> (IO CInt)))
pcm_hw_params_get_buffer_size'_ :: (PcmHwParams) -> ((Ptr CULong) -> (IO CInt))
pcm_hw_params_get_period_size'_ :: (PcmHwParams) -> ((Ptr CULong) -> ((Ptr CInt) -> (IO CInt)))
pcm_hw_params_set_period_time_near'_ :: (Pcm) -> ((PcmHwParams) -> ((Ptr CUInt) -> ((Ptr CInt) -> (IO CInt))))
pcm_hw_params_set_periods'_ :: (Pcm) -> ((PcmHwParams) -> (CUInt -> (CInt -> (IO CInt))))
pcm_hw_params_set_buffer_time_near'_ :: (Pcm) -> ((PcmHwParams) -> ((Ptr CUInt) -> ((Ptr CInt) -> (IO CInt))))
pcm_hw_params_get_buffer_time'_ :: (PcmHwParams) -> ((Ptr CUInt) -> ((Ptr CInt) -> (IO CInt)))
pcm_sw_params_set_start_threshold'_ :: (Pcm) -> ((PcmSwParams) -> (CULong -> (IO CInt)))
pcm_sw_params_set_avail_min'_ :: (Pcm) -> ((PcmSwParams) -> (CULong -> (IO CInt)))
pcm_sw_params_set_xfer_align'_ :: (Pcm) -> ((PcmSwParams) -> (CULong -> (IO CInt)))
pcm_sw_params_set_silence_threshold'_ :: (Pcm) -> ((PcmSwParams) -> (CULong -> (IO CInt)))
pcm_sw_params_set_silence_size'_ :: (Pcm) -> ((PcmSwParams) -> (CULong -> (IO CInt)))
pcm_readi'_ :: (Pcm) -> ((Ptr ()) -> (CULong -> (IO CLong)))
pcm_writei'_ :: (Pcm) -> ((Ptr ()) -> (CULong -> (IO CLong)))
pcm_hw_params_malloc'_ :: (Ptr (PcmHwParams)) -> (IO CInt)
pcm_hw_params_free'_ :: (PcmHwParams) -> (IO ())
pcm_sw_params_malloc'_ :: (Ptr (PcmSwParams)) -> (IO CInt)
pcm_sw_params_free'_ :: (PcmSwParams) -> (IO ())
pcm_sw_params'_ :: (Pcm) -> ((PcmSwParams) -> (IO CInt))
pcm_sw_params_current'_ :: (Pcm) -> ((PcmSwParams) -> (IO CInt))
instance Eq PcmFormat
instance Show PcmFormat
instance Eq PcmAccess
instance Show PcmAccess
instance Eq PcmStream
instance Show PcmStream
instance Enum PcmFormat
instance Enum PcmAccess
instance Enum PcmStream
instance Storable PcmSwParams
instance Storable PcmHwParams
instance Storable Pcm
module Sound.Alsa
class (Storable y, C y) => SampleFmt y
sampleFmtToPcmFormat :: (SampleFmt y) => y -> PcmFormat
type SampleFreq = Int
type Time = Int
data SoundFmt y
SoundFmt :: SampleFreq -> SoundFmt y
sampleFreq :: SoundFmt y -> SampleFreq
-- | Counts are in samples, not bytes. Multi-channel data is interleaved.
data SoundSource y handle
SoundSource :: SoundFmt y -> IO handle -> (handle -> IO ()) -> (handle -> IO ()) -> (handle -> IO ()) -> (handle -> Ptr y -> Int -> IO Int) -> SoundSource y handle
soundSourceFmt :: SoundSource y handle -> SoundFmt y
soundSourceOpen :: SoundSource y handle -> IO handle
soundSourceClose :: SoundSource y handle -> handle -> IO ()
soundSourceStart :: SoundSource y handle -> handle -> IO ()
soundSourceStop :: SoundSource y handle -> handle -> IO ()
soundSourceRead :: SoundSource y handle -> handle -> Ptr y -> Int -> IO Int
data SoundSink y handle
SoundSink :: SoundFmt y -> IO handle -> (handle -> IO ()) -> (handle -> Ptr y -> Int -> IO ()) -> (handle -> IO ()) -> (handle -> IO ()) -> SoundSink y handle
soundSinkFmt :: SoundSink y handle -> SoundFmt y
soundSinkOpen :: SoundSink y handle -> IO handle
soundSinkClose :: SoundSink y handle -> handle -> IO ()
soundSinkWrite :: SoundSink y handle -> handle -> Ptr y -> Int -> IO ()
soundSinkStart :: SoundSink y handle -> handle -> IO ()
soundSinkStop :: SoundSink y handle -> handle -> IO ()
data SoundBufferTime
SoundBufferTime :: Time -> Time -> SoundBufferTime
bufferTime :: SoundBufferTime -> Time
periodTime :: SoundBufferTime -> Time
withSoundSource :: SoundSource y h -> (h -> IO a) -> IO a
withSoundSourceRunning :: SoundSource y h -> h -> IO a -> IO a
withSoundSink :: SoundSink y h -> (h -> IO a) -> IO a
withSoundSinkRunning :: SoundSink y h -> h -> IO a -> IO a
soundFmtMIME :: (SampleFmt y) => SoundFmt y -> String
audioBytesPerSample :: (SampleFmt y) => SoundFmt y -> Int
audioBytesPerFrame :: (SampleFmt y) => SoundFmt y -> Int
soundSourceBytesPerFrame :: (SampleFmt y) => SoundSource y h -> Int
soundSinkBytesPerFrame :: (SampleFmt y) => SoundSink y h -> Int
copySound :: (SampleFmt y) => SoundSource y h1 -> SoundSink y h2 -> Int -> IO ()
alsaSoundSource :: (SampleFmt y) => String -> SoundFmt y -> SoundSource y Pcm
alsaSoundSink :: (SampleFmt y) => String -> SoundFmt y -> SoundSink y Pcm
alsaSoundSourceTime :: (SampleFmt y) => String -> SoundFmt y -> SoundBufferTime -> SoundSource y Pcm
alsaSoundSinkTime :: (SampleFmt y) => String -> SoundFmt y -> SoundBufferTime -> SoundSink y Pcm
fileSoundSource :: (SampleFmt y) => FilePath -> SoundFmt y -> SoundSource y Handle
fileSoundSink :: (SampleFmt y) => FilePath -> SoundFmt y -> SoundSink y Handle
instance Show SoundBufferTime
instance Show (SoundFmt y)
instance (SampleFmt a) => SampleFmt (T a)
instance SampleFmt T
instance SampleFmt Double
instance SampleFmt Float
instance SampleFmt Int32
instance SampleFmt Word32
instance SampleFmt Int16
instance SampleFmt Word16
instance SampleFmt Int8
instance SampleFmt Word8