Copyright | (c) Henning Thielemann 2010 (c) Iavor S. Diatchki 2007 |
---|---|
License | BSD3 |
Maintainer | Henning Thielemann |
Stability | provisional |
Safe Haskell | Safe |
Language | Haskell2010 |
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?
- data T mode
- class OpenMode mode
- class OpenMode mode => AllowOutput mode
- class OpenMode mode => AllowInput mode
- data OutputMode = OutputMode
- data InputMode = InputMode
- data DuplexMode = DuplexMode
- data BlockMode
- open :: OpenMode mode => String -> BlockMode -> IO (T mode)
- openDefault :: OpenMode mode => BlockMode -> IO (T mode)
- close :: T mode -> IO ()
- with :: OpenMode mode => String -> BlockMode -> (T mode -> IO a) -> IO a
- withDefault :: OpenMode mode => BlockMode -> (T mode -> IO a) -> IO a
- defaultName :: String
- getName :: T mode -> IO String
- setBlocking :: T mode -> BlockMode -> IO ()
- getOutputBufferSize :: T mode -> IO Word
- setOutputBufferSize :: T mode -> Word -> IO ()
- getInputBufferSize :: T mode -> IO Word
- setInputBufferSize :: T mode -> Word -> IO ()
- setPoolOutput :: T mode -> Word -> IO ()
- setPoolOutputRoom :: T mode -> Word -> IO ()
- resetPoolOutput :: T mode -> IO ()
- setPoolInput :: T mode -> Word -> IO ()
- resetPoolInput :: T mode -> IO ()
Sequencer
Read/Write permissions for the sequencer device.
This way we prevent the ALSA exception 22 "Invalid argument"
when calling event_output
on an input-only sequencer.
expOpenMode
class OpenMode mode => AllowOutput mode Source #
class OpenMode mode => AllowInput mode Source #
data OutputMode Source #
data DuplexMode Source #
Blocking behavior of the sequencer device.
:: OpenMode mode | |
=> String | The sequencer's "name".
This is not a name that you make up for your own purposes;
it has special significance to the ALSA library.
Usually you need to pass |
-> BlockMode | Blocking behavior |
-> IO (T mode) | Handle to the sequencer. |
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
.
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?
:: OpenMode mode | |
=> String | The sequencer's "name".
This is not a name that you make up for your own purposes;
it has special significance to the ALSA library.
Usually you need to pass |
-> BlockMode | Blocking behavior |
-> (T mode -> IO a) | Action on the sequencer, the result must be computed strictly. |
-> IO a |
defaultName :: String Source #
This is the name that should be passed to open
in most cases.
Get identifier of a sequencer handle.
It is the same identifier specified in the call to open
.
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
).
Manage user-space buffers
Return the byte size of the output buffer.
Resize of the output buffer.
This function clears all output events (see drop_output
).
Return the byte size of input buffer.
Resize the input buffer.
This function clears all input events (see drop_input
).
Manage kernel-space memory pools
Resize the output memory pool.
Specify how much space should become free before waking clients that are blocked due to a lack of space in the output pool.
Resize the input memory pool.