Stability | provisional |
---|---|
Maintainer | Iavor S. Diatchki |
Sound.Alsa.Sequencer
Contents
Description
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 SndSeq
- data OpenMode
- open_output :: OpenMode
- open_input :: OpenMode
- open_duplex :: OpenMode
- data BlockMode
- open :: String -> OpenMode -> BlockMode -> IO SndSeq
- close :: SndSeq -> IO ()
- default_seq_name :: String
- get_seq_name :: SndSeq -> IO String
- set_blocking :: SndSeq -> BlockMode -> IO ()
- get_output_buffer_size :: SndSeq -> IO Word
- set_output_buffer_size :: SndSeq -> Word -> IO ()
- get_input_buffer_size :: SndSeq -> IO Word
- set_input_buffer_size :: SndSeq -> Word -> IO ()
- set_pool_output :: SndSeq -> Word -> IO ()
- set_pool_output_room :: SndSeq -> Word -> IO ()
- reset_pool_output :: SndSeq -> IO ()
- set_pool_input :: SndSeq -> Word -> IO ()
- reset_pool_input :: SndSeq -> IO ()
- module Sound.Alsa.Sequencer.Queue
- module Sound.Alsa.Sequencer.Client
- module Sound.Alsa.Sequencer.Port
- connect_from :: SndSeq -> Port -> Addr -> IO ()
- connect_to :: SndSeq -> Port -> Addr -> IO ()
- disconnect_from :: SndSeq -> Port -> Addr -> IO ()
- disconnect_to :: SndSeq -> Port -> Addr -> IO ()
- volume_same :: Int16
- module Sound.Alsa.Sequencer.Event
- data RealTime = RT {}
- data TimeStamp
- data InstrCluster
- data Instr = Instr {
- instr_cluster :: !InstrCluster
- instr_std :: !Word32
- instr_bank :: !Word16
- instr_prg :: !Word16
- data Event = Event {}
- data EventData
- data NoteEv
- data Note = Note {
- note_channel :: !Word8
- note_note :: !Word8
- note_velocity :: !Word8
- note_off_velocity :: !Word8
- note_duration :: !Word32
- simple_note :: Word8 -> Word8 -> Word8 -> Note
- data CtrlEv
- data Ctrl = Ctrl {
- ctrl_channel :: !Word8
- ctrl_param :: !Word32
- ctrl_value :: !Int32
- data AddrEv
- = ClientStart
- | ClientExit
- | ClientChange
- | PortStart
- | PortExit
- | PortChange
- data Addr = Addr {
- addr_client :: !Client
- addr_port :: !Port
- parse_address :: SndSeq -> String -> IO Addr
- addr_subscribers :: Addr
- data ConnEv
- data Connect
- data EmptyEv
- = TuneRequest
- | Reset
- | Sensing
- | None
- | Unknown
- data Sample = Sample {
- sample_std :: !Word32
- sample_bank :: !Word16
- sample_prg :: !Word16
- newtype Cluster = Cluster {}
- data Volume = Volume {}
- data AlsaException
- exception_code :: AlsaException -> Word
- exception_description :: AlsaException -> String
- alsa_catch :: IO a -> (AlsaException -> IO a) -> IO a
Sequencer
Read/Write permissions for the sequencer device.
Blocking behavior of the sequencer device.
Arguments
:: 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 |
-> OpenMode | |
-> BlockMode | |
-> IO SndSeq |
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?
default_seq_name :: StringSource
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.
Queue Interface
module Sound.Alsa.Sequencer.Queue
Client Interface
module Sound.Alsa.Sequencer.Client
Port Interface
module Sound.Alsa.Sequencer.Port
Connections
connect_from :: SndSeq -> Port -> Addr -> IO ()Source
Simple subscription (w/o exclusive & time conversion).
connect_to :: SndSeq -> Port -> Addr -> IO ()Source
Simple subscription (w/o exclusive & time conversion).
Events
Used for volume control: means do not change the valume.
module Sound.Alsa.Sequencer.Event
Types
data InstrCluster Source
Constructors
Instr | |
Fields
|
Constructors
Event | |
Constructors
Note | |
Fields
|
Make a note whose unspecified fields contain 0.
Constructors
Ctrl | |
Fields
|
Constructors
ClientStart | |
ClientExit | |
ClientChange | |
PortStart | |
PortExit | |
PortChange |
Constructors
Addr | |
Fields
|
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.
addr_subscribers :: AddrSource
The address of all subscribed ports.
Constructors
Sample | |
Fields
|
Constructors
Cluster | |
Fields |
These are all 14 bit values.
Constructors
Volume | |
Error handling
data AlsaException Source
exception_code :: AlsaException -> WordSource
the (positive) error code
exception_description :: AlsaException -> StringSource
a text description of the problem
alsa_catch :: IO a -> (AlsaException -> IO a) -> IO aSource
Catch an exception generated by the binding.