Stability | provisional |
---|---|
Maintainer | Iavor S. Diatchki |
This module contains functions for working with events. Reference: http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_event.html
- syncOutputQueue :: T mode -> IO ()
- input :: AllowInput mode => T mode -> IO T
- inputPending :: AllowInput mode => T mode -> Bool -> IO Word
- output :: AllowOutput mode => T mode -> T -> IO Word
- outputBuffer :: AllowOutput mode => T mode -> T -> IO Word
- outputDirect :: AllowOutput mode => T mode -> T -> IO Word
- outputPending :: AllowOutput mode => T mode -> IO Word
- extractOutput :: AllowOutput mode => T mode -> IO T
- removeOutput :: AllowOutput mode => T mode -> IO ()
- drainOutput :: AllowOutput mode => T mode -> IO Word
- dropOutput :: AllowOutput mode => T mode -> IO ()
- dropOutputBuffer :: AllowOutput mode => T mode -> IO ()
- dropInput :: AllowInput mode => T mode -> IO ()
- dropInputBuffer :: AllowInput mode => T mode -> IO ()
- volumeSame :: Int16
- data TimeStamp
- data InstrCluster
- data Instr = Instr {
- instrCluster :: !InstrCluster
- instrStd :: !Word32
- instrBank :: !Word16
- instrPrg :: !Word16
- data Sample = Sample {}
- newtype Cluster = Cluster {}
- data Volume = Volume {}
- data T = Cons {}
- data Data
- data NoteEv
- data Note = Note {
- noteChannel :: !Word8
- noteNote :: !Word8
- noteVelocity :: !Word8
- noteOffVelocity :: !Word8
- noteDuration :: !Word32
- simpleNote :: Word8 -> Word8 -> Word8 -> Note
- data CtrlEv
- data Ctrl = Ctrl {}
- data CustomEv
- data Custom = Custom {}
- data QueueEv
- = QueueStart
- | QueueContinue
- | QueueStop
- | QueueSetPosTick
- | QueueSetPosTime
- | QueueTempo
- | QueueClock
- | QueueTick
- | QueueSkew
- | QueueSyncPos
- data AddrEv
- = ClientStart
- | ClientExit
- | ClientChange
- | PortStart
- | PortExit
- | PortChange
- data ConnEv
- data Connect
- data EmptyEv
- = TuneRequest
- | Reset
- | Sensing
- | None
- | Unknown
Documentation
syncOutputQueue :: T mode -> IO ()Source
Wait until all events of the client are processed.
input :: AllowInput mode => T mode -> IO TSource
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).
:: AllowInput mode | |
=> T mode | |
-> Bool | refill if empty? |
-> IO Word | number of events in buffer |
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: input
.
:: AllowOutput mode | |
=> T mode | |
-> T | |
-> IO Word | the number of remaining events (or bytes?) |
Output an event and drain the buffer, if it became full.
Throws exceptions.
See also: outputDirect
, outputBuffer
,
outputPending
, drainOutput
, dropOutput
,
extractOutput
, removeEvents
:: AllowOutput mode | |
=> T mode | |
-> T | |
-> IO Word | the byte size of remaining events |
Output an event without draining the buffer.
Throws -EAGAIN
if the buffer becomes full.
See also output
.
:: AllowOutput mode | |
=> T mode | |
-> T | |
-> IO Word | number of bytes sent to the sequencer |
Output an event directly to the sequencer, NOT through the output buffer.
If an error occurs, then we throw an exception.
See also output
.
:: AllowOutput mode | |
=> T mode | |
-> IO Word | size of pending events (in bytes) |
Return the size (in bytes) of pending events on output buffer.
See also output
.
:: AllowOutput mode | |
=> T mode | |
-> IO T | the first event in the buffer (if one was present) |
Extract the first event in output buffer.
Throws an exception on error.
See also output
.
removeOutput :: AllowOutput mode => T mode -> IO ()Source
Remove the first event in output buffer.
Throws an exception on error.
See also output
.
:: AllowOutput mode | |
=> T mode | |
-> IO Word | byte size of events remaining in the buffer. |
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 syncOutputQueue
after calling this function.
Throws an exception on error.
See also: output
, syncOutputQueue
.
dropOutput :: AllowOutput mode => T mode -> IO ()Source
Remove events from both the user-space output buffer,
and the kernel-space sequencer queue.
See also: drainOutput
, dropOutputBuffer
, removeEvents
.
dropOutputBuffer :: AllowOutput mode => T mode -> IO ()Source
Remove events from the user-space output buffer.
See also: dropOutput
.
dropInput :: AllowInput mode => T mode -> IO ()Source
Remove events from both the user-space input buffer,
and the kernel-space sequencer queue.
See also: dropInputBuffer
, removeEvents
.
dropInputBuffer :: AllowInput mode => T mode -> IO ()Source
Remove events from the user-space input buffer.
See also: dropInput
.
Used for volume control: means do not change the volume.
data InstrCluster Source
Instr | |
|
These are all 14 bit values.
Note | |
|
Make a note whose unspecified fields contain 0.