-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Binding to the ALSA Library API (MIDI sequencer).
--
-- This package provides access to ALSA sequencer (MIDI support). For
-- audio support see alsa-pcm. Included are some simple example programs.
-- For more example programs including a GUI, see the alsa-gui programs.
@package alsa-seq
@version 0.6.0.7
module Sound.ALSA.Sequencer.Poll
descriptors :: T mode -> Events -> IO [Fd]
module Sound.ALSA.Sequencer.Time
data T
Cons :: Mode -> Stamp -> T
[mode] :: T -> Mode
[stamp] :: T -> Stamp
consAbs :: Stamp -> T
consRel :: Stamp -> T
data Mode
Absolute :: Mode
Relative :: Mode
data Stamp
Tick :: !Tick -> Stamp
Real :: !T -> Stamp
module Sound.ALSA.Sequencer.RealTime
data T
Cons :: !Word32 -> !Word32 -> T
[secs] :: T -> !Word32
[nano] :: T -> !Word32
-- | Convert fractional number of seconds to T Time must be
-- non-negative.
fromDouble :: Double -> T
fromFractional :: (RealFrac a) => a -> T
-- | Convert number of nanoseconds to T
fromInteger :: Integer -> T
-- | Convert fractional number of seconds to T
toDouble :: T -> Double
toFractional :: (RealFrac a) => T -> a
-- | Convert number of nanoseconds to T
toInteger :: T -> Integer
-- | 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
-- | The type of queue identifiers.
data T
direct :: T
alloc :: T mode -> IO T
allocNamed :: T mode -> String -> IO T
-- | Delete the specified queue.
free :: T mode -> T -> IO ()
with :: T mode -> (T -> IO a) -> IO a
withNamed :: T mode -> String -> (T -> IO a) -> IO a
-- | startstopcontinue a queue
--
-- In the prototype event you can provide additional information. The
-- prototype event does not need to be a queue control event, this part
-- is ignored anyway. In the prototype event you may also specify a
-- queue. This is the queue that the timestamp of the prototype event
-- refers to. This way you can control the target queue using timing from
-- another queue.
control :: T mode -> T -> QueueEv -> Maybe T -> IO ()
-- | This module allows to cancel events according to some criteria. In all
-- cases other than setInput and setOutput the criteria are
-- combined by logical AND. For every criterion we provide three kinds of
-- accessors:
--
--
-- - set: enable a criterion
-- - put: enable or disable a criterion
-- - get: query, whether the criterion is enabled or
-- disabled.
--
--
-- Currently only the set functions are really usable. The
-- put and get functions would become useful for
-- manipulating the remove criterion record, that ALSA maintains.
module Sound.ALSA.Sequencer.Event.RemoveMonad
data T a
-- | Remove events according to the given conditions
run :: T mode -> T a -> IO a
-- | All events in the local input buffer are removed. The conditions are
-- not checked for these events. This is equivalent to
-- dropInputBuffer.
setInput :: T ()
putInput :: Bool -> T ()
getInput :: T Bool
-- | Matching events in the local output buffer are removed, too. Matching
-- events in the kernel buffer are removed in any case. If there are no
-- further conditions, then this is equivalent to
-- dropOutputBuffer.
setOutput :: T ()
putOutput :: Bool -> T ()
getOutput :: T Bool
setChannel :: Channel -> T ()
putChannel :: Maybe Channel -> T ()
getChannel :: T (Maybe Channel)
setEventType :: Type e => e -> T ()
putEventType :: Type e => Maybe e -> T ()
setTag :: Tag -> T ()
putTag :: Maybe Tag -> T ()
getTag :: T (Maybe Tag)
-- | ALSA maintainers say, that destination address and queue are checked
-- together, at least in the kernel buffer. However up to ALSA-1.0.22 the
-- check for the queue is missing in libasound for the local buffer.
setDest :: (T, T) -> T ()
putDest :: Maybe (T, T) -> T ()
getDest :: T (Maybe (T, T))
setTime :: Ordering -> Stamp -> T ()
putTime :: Maybe Ordering -> Stamp -> T ()
getTime :: T (Maybe Ordering, Stamp)
-- | NoteOff events are kept in any case.
setIgnoreOff :: T ()
putIgnoreOff :: Bool -> T ()
getIgnoreOff :: T Bool
instance GHC.Base.Monad Sound.ALSA.Sequencer.Event.RemoveMonad.T
instance GHC.Base.Applicative Sound.ALSA.Sequencer.Event.RemoveMonad.T
instance GHC.Base.Functor Sound.ALSA.Sequencer.Event.RemoveMonad.T
module Sound.ALSA.Sequencer.Query
class C info => C info
init :: C info => info -> IO ()
next :: C info => T mode -> info -> IO Bool
init :: C info => info -> IO ()
next :: C info => T mode -> info -> IO Bool
first :: (C info) => T mode -> IO info
loop_ :: (C info) => T mode -> (info -> IO ()) -> (info -> IO ()) -> IO ()
loop :: (C info) => T mode -> (info -> IO ()) -> (info -> IO a) -> IO [a]
-- | 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.Info
data T
get :: T mode -> IO T
-- | Copy the content of an object to a newly created object.
--
-- Create a new information area filled with data about an arbitrary
-- client.
getAny :: T mode -> T -> IO T
queryFirst :: T mode -> IO T
-- | Get information about the client with the next biggest identifier.
queryNext :: T mode -> T -> IO Bool
queryLoop_ :: T mode -> (T -> IO ()) -> IO ()
queryLoop :: T mode -> (T -> IO a) -> IO [a]
-- | Set the information for the sequencer client based on the data in the
-- given information area.
set :: T mode -> T -> IO ()
-- | Create a new information area filled with data about the sequencer
-- client.
copy :: T -> T -> IO ()
clone :: T -> IO T
getClient :: T -> IO T
getType :: T -> IO Type
getName :: T -> IO String
getBroadcastFilter :: T -> IO Bool
-- | Allocate an uninitialized object. (Not exported)
getErrorBounce :: T -> IO Bool
getNumPorts :: T -> IO Word
getEventLost :: T -> IO Word
setClient :: T -> T -> IO ()
setName :: T -> String -> IO ()
setBroadcastFilter :: T -> Bool -> IO ()
setErrorBounce :: T -> Bool -> IO ()
filterClear :: T -> IO ()
filterAdd :: Type e => T -> e -> IO ()
filterDel :: Type e => T -> e -> IO ()
filterCheck :: Type e => T -> e -> IO Bool
module Sound.ALSA.Sequencer.Client.InfoMonad
data T a
run :: T a -> T -> IO a
get :: T mode -> T a -> IO a
modify :: T mode -> T a -> IO a
getClient :: T T
getType :: T Type
getName :: T String
getBroadcastFilter :: T Bool
getErrorBounce :: T Bool
getNumPorts :: T Word
getEventLost :: T Word
setClient :: T -> T ()
setName :: String -> T ()
setBroadcastFilter :: Bool -> T ()
setErrorBounce :: Bool -> T ()
instance GHC.Base.Monad Sound.ALSA.Sequencer.Client.InfoMonad.T
instance GHC.Base.Applicative Sound.ALSA.Sequencer.Client.InfoMonad.T
instance GHC.Base.Functor Sound.ALSA.Sequencer.Client.InfoMonad.T
-- | 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.
newtype T
Cons :: Word8 -> T
unknown :: T
system :: T
subscribers :: T
broadcast :: T
-- | Get the client identifier for the sequencer. A convinience function.
getId :: T mode -> IO T
-- | Set the name for the sequencer client. A convinience function.
setName :: T mode -> String -> IO ()
-- | The different types of clients.
data Type
User :: Type
Kernel :: Type
module Sound.ALSA.Sequencer.Connect
data T
Cons :: !T -> !T -> T
[source] :: T -> !T
[dest] :: T -> !T
reverse :: T -> T
toSubscribers :: T -> T
fromSubscribers :: T -> T
-- | Simple subscription (w/o exclusive & time conversion).
createFrom :: AllowInput mode => T mode -> T -> T -> IO T
-- | Simple disconnection.
deleteFrom :: AllowInput mode => T mode -> T -> T -> IO ()
-- | Temporary subscription.
withFrom :: AllowInput mode => T mode -> T -> T -> (T -> IO a) -> IO a
-- | Simple subscription (w/o exclusive & time conversion).
createTo :: AllowOutput mode => T mode -> T -> T -> IO T
-- | Simple disconnection.
deleteTo :: AllowOutput mode => T mode -> T -> T -> IO ()
-- | Temporary subscription.
withTo :: AllowOutput mode => T mode -> T -> T -> (T -> IO a) -> IO a
-- | 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
newtype T
Cons :: Word8 -> T
-- | Create a new port, as described by the info structure.
create :: T mode -> T -> IO ()
-- | Create a port - simple version.
createSimple :: T mode -> String -> Cap -> Type -> IO T
-- | Delete the port.
delete :: T mode -> T -> IO ()
-- | Delete the port.
deleteSimple :: T mode -> T -> IO ()
withSimple :: T mode -> String -> Cap -> Type -> (T -> IO a) -> IO a
systemTimer :: T
systemAnnounce :: T
unknown :: T
-- | Port capabilities.
type Cap = T CUInt CapabilityFlag
capRead :: Cap
capWrite :: Cap
capSyncRead :: Cap
capSyncWrite :: Cap
capDuplex :: Cap
capSubsRead :: Cap
capSubsWrite :: Cap
capNoExport :: Cap
caps :: [Cap] -> Cap
-- | Port types.
type Type = T CUInt TypeFlag
typeSpecific :: Type
typeMidiGeneric :: Type
typeMidiGM :: Type
typeMidiGS :: Type
typeMidiXG :: Type
typeMidiMT32 :: Type
typeMidiGM2 :: Type
typeSynth :: Type
typeDirectSample :: Type
typeSample :: Type
typeHardware :: Type
typeSoftware :: Type
typeSynthesizer :: Type
typePort :: Type
typeApplication :: Type
types :: [Type] -> Type
-- | 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.InfoMonad
data T a
run :: T a -> T -> IO a
get :: T mode -> T -> T a -> IO a
modify :: T mode -> T -> T a -> IO a
getPort :: T T
getClient :: T T
getAddr :: T T
getName :: T String
getCapability :: T Cap
getMidiChannels :: T Word
getMidiVoices :: T Word
getSynthVoices :: T Word
getPortSpecified :: T Bool
getTimestamping :: T Bool
getTimestampReal :: T Bool
getTimestampQueue :: T T
getReadUse :: T Word
getWriteUse :: T Word
setPort :: T -> T ()
setClient :: T -> T ()
setAddr :: T -> T ()
setName :: String -> T ()
setCapability :: Cap -> T ()
setMidiChannels :: Word -> T ()
setSynthVoices :: Word -> T ()
setMidiVoices :: Word -> T ()
setPortSpecified :: Bool -> T ()
setTimestamping :: Bool -> T ()
setTimestampReal :: Bool -> T ()
setTimestampQueue :: T -> T ()
instance GHC.Base.Monad Sound.ALSA.Sequencer.Port.InfoMonad.T
instance GHC.Base.Applicative Sound.ALSA.Sequencer.Port.InfoMonad.T
instance GHC.Base.Functor Sound.ALSA.Sequencer.Port.InfoMonad.T
-- | 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.Info
data T
-- | Set the information for the sequencer port based on the data in the
-- given information area.
get :: T mode -> T -> IO T
getAny :: T mode -> T -> T -> IO T
-- | Get information about the first port on our client.
queryFirst :: T mode -> IO T
-- | 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 and True is returned.
queryNext :: T mode -> T -> IO Bool
queryLoop_ :: T mode -> T -> (T -> IO ()) -> IO ()
queryLoop :: T mode -> T -> (T -> IO a) -> IO [a]
set :: T mode -> T -> T -> IO ()
copy :: T -> T -> IO ()
clone :: T -> IO T
getPort :: T -> IO T
getClient :: T -> IO T
getAddr :: T -> IO T
getName :: T -> IO String
getCapability :: T -> IO Cap
getMidiChannels :: T -> IO Word
getMidiVoices :: T -> IO Word
-- | Copy the content of an object to a newly created object.
getSynthVoices :: T -> IO Word
getPortSpecified :: T -> IO Bool
-- | Copy the content of one object into another.
getTimestamping :: T -> IO Bool
getTimestampReal :: T -> IO Bool
getTimestampQueue :: T -> IO T
getReadUse :: T -> IO Word
getWriteUse :: T -> IO Word
setPort :: T -> T -> IO ()
setClient :: T -> T -> IO ()
setAddr :: T -> T -> IO ()
setName :: T -> String -> IO ()
setCapability :: T -> Cap -> IO ()
setMidiChannels :: T -> Word -> IO ()
setSynthVoices :: T -> Word -> IO ()
setMidiVoices :: T -> Word -> IO ()
setPortSpecified :: T -> Bool -> IO ()
setTimestamping :: T -> Bool -> IO ()
setTimestampReal :: T -> Bool -> IO ()
-- | Set the port address.
setTimestampQueue :: T -> T -> IO ()
-- | 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.Info
data T
get :: T mode -> T -> IO T
set :: T mode -> T -> T -> IO ()
copy :: T -> T -> IO ()
-- | Copy the content of an object to a newly created object.
clone :: T -> IO T
getQueue :: T -> IO T
getName :: T -> IO String
getLocked :: T -> IO Bool
getOwner :: T -> IO T
getFlags :: T -> IO Word
setName :: T -> String -> IO ()
setLocked :: T -> Bool -> IO ()
setOwner :: T -> T -> IO ()
setFlags :: T -> Word -> IO ()
instance Sound.ALSA.Sequencer.Area.C Sound.ALSA.Sequencer.Queue.Info.T
-- | 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.Status
data T
get :: T mode -> T -> IO T
-- | Copy the content of one object into another.
copy :: T -> T -> IO ()
-- | Copy the content of an object to a newly created object.
clone :: T -> IO T
getQueue :: T -> IO T
getEvents :: T -> IO Int
-- | Allocate an uninitialized object. (Not exported)
getTickTime :: T -> IO Tick
getRealTime :: T -> IO T
instance Sound.ALSA.Sequencer.Area.C Sound.ALSA.Sequencer.Queue.Status.T
-- | 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.Tempo
data T
get :: T mode -> T -> IO T
set :: T mode -> T -> T -> IO ()
copy :: T -> T -> IO ()
-- | Copy the content of an object to a newly created object.
clone :: T -> IO T
getQueue :: T -> IO T
getTempo :: T -> IO Word
getPPQ :: T -> IO Int
getSkew :: T -> IO Word
getSkewBase :: T -> IO Word
-- | Copy the content of one object into another.
setTempo :: T -> Word -> IO ()
setPPQ :: T -> Int -> IO ()
setSkew :: T -> Word -> IO ()
setSkewBase :: T -> Word -> IO ()
instance Sound.ALSA.Sequencer.Area.C Sound.ALSA.Sequencer.Queue.Tempo.T
-- | 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.Timer
data T
get :: T mode -> T -> IO T
set :: T mode -> T -> T -> IO ()
copy :: T -> T -> IO ()
-- | Copy the content of an object to a newly created object.
clone :: T -> IO T
getQueue :: T -> IO T
getType :: T -> IO Type
getResolution :: T -> IO Word
setType :: T -> Type -> IO ()
setResolution :: T -> Word -> IO ()
data Type
Alsa :: Type
MidiClock :: Type
MidiTick :: Type
instance GHC.Enum.Enum Sound.ALSA.Sequencer.Queue.Timer.Type
instance GHC.Classes.Ord Sound.ALSA.Sequencer.Queue.Timer.Type
instance GHC.Classes.Eq Sound.ALSA.Sequencer.Queue.Timer.Type
instance GHC.Show.Show Sound.ALSA.Sequencer.Queue.Timer.Type
instance Sound.ALSA.Sequencer.Area.C Sound.ALSA.Sequencer.Queue.Timer.T
-- | This module contains functions for working with subscriptions.
-- Reference:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_subscribe.html
module Sound.ALSA.Sequencer.Subscribe
data T
malloc :: IO T
copy :: T -> T -> IO ()
-- | Copy the content of an object to a newly created object.
clone :: T -> IO T
getSender :: T -> IO T
getDest :: T -> IO T
getQueue :: T -> IO T
getExclusive :: T -> IO Bool
-- | Allocate an uninitialized object. (Not exported)
getTimeUpdate :: T -> IO Bool
getTimeReal :: T -> IO Bool
setSender :: T -> T -> IO ()
setDest :: T -> T -> IO ()
setQueue :: T -> T -> IO ()
setExclusive :: T -> Bool -> IO ()
setTimeUpdate :: T -> Bool -> IO ()
setTimeReal :: T -> Bool -> IO ()
-- | Subscribe a port connection
subscribePort :: T mode -> T -> IO ()
unsubscribePort :: T mode -> T -> IO ()
create :: T -> T -> Bool -> Maybe (T, Bool) -> IO T
-- | Subscribe a port connection: subscribeSimple sender dest
-- exclusive (Just (updatequeue, realtime))
subscribe :: T mode -> T -> T -> Bool -> Maybe (T, Bool) -> IO ()
-- | Unsubscribe a port connection: unsubscribeSimple sender
-- dest
unsubscribe :: T mode -> T -> T -> IO ()
instance Sound.ALSA.Sequencer.Area.C Sound.ALSA.Sequencer.Subscribe.T
-- | This module contains functions for working with subscriptions.
-- Reference:
-- http://www.alsa-project.org/alsa-doc/alsa-lib/group___seq_subscribe.html
module Sound.ALSA.Sequencer.Subscribe.Query
data T
data Type
Read :: Type
Write :: Type
malloc :: IO T
copy :: T -> T -> IO ()
clone :: T -> IO T
getClient :: T -> IO T
getPort :: T -> IO T
-- | Set the client/port address of a query
getRoot :: T -> IO T
getType :: T -> IO Type
getIndex :: T -> IO Word
getNumSubs :: T -> IO Word
getAddr :: T -> IO T
getQueue :: T -> IO T
getExclusive :: T -> IO Bool
getTimeUpdate :: T -> IO Bool
getTimeReal :: T -> IO Bool
setClient :: T -> T -> IO ()
setPort :: T -> T -> IO ()
setType :: T -> Type -> IO ()
setIndex :: T -> Word -> IO ()
-- | Queries a subscriber connected to (Write) or from (Read) a given
-- address: query seq addr typ index
query :: T mode -> T -> Type -> Word -> IO (Maybe T)
-- | Queries the list of subscribers accessing a port
queryAll :: T mode -> T -> Type -> IO [T]
instance GHC.Enum.Enum Sound.ALSA.Sequencer.Subscribe.Query.Type
instance GHC.Classes.Ord Sound.ALSA.Sequencer.Subscribe.Query.Type
instance GHC.Classes.Eq Sound.ALSA.Sequencer.Subscribe.Query.Type
instance GHC.Show.Show Sound.ALSA.Sequencer.Subscribe.Query.Type
instance Sound.ALSA.Sequencer.Area.C Sound.ALSA.Sequencer.Subscribe.Query.T
module Sound.ALSA.Sequencer.Address
data T
Cons :: !T -> !T -> T
[client] :: T -> !T
[port] :: T -> !T
unknown :: T
-- | The address of all subscribed ports.
subscribers :: T
broadcast :: T
systemTimer :: T
systemAnnounce :: T
-- | 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 or prefixes thereof. Throws (Errno 2)
-- exception if no client name matches.
parse :: T mode -> String -> IO T
-- | 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
-- | Output an event and drain the buffer, if it became full. Throws
-- exceptions. See also: outputDirect, outputBuffer,
-- outputPending, drainOutput, dropOutput,
-- extractOutput, removeOutput
output :: AllowOutput mode => T mode -> T -> IO Word
-- | Output an event without draining the buffer. Throws -EAGAIN
-- if the buffer becomes full. See also output.
outputBuffer :: AllowOutput mode => T mode -> T -> 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
-- output.
outputDirect :: AllowOutput mode => T mode -> T -> IO Word
-- | Return the size (in bytes) of pending events on output buffer. See
-- also output.
outputPending :: AllowOutput mode => T mode -> IO Word
-- | Extract the first event in output buffer. Throws (Errno 2)
-- exception if output buffer is empty. See also output.
extractOutput :: AllowOutput mode => T mode -> IO T
-- | Remove the first event in output buffer. Throws an exception on error.
-- See also output.
removeOutput :: AllowOutput mode => T mode -> 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 syncOutputQueue after calling this function. Throws an
-- exception on error. See also: output, syncOutputQueue.
drainOutput :: AllowOutput mode => T mode -> IO Word
-- | Remove events from both the user-space output buffer, and the
-- kernel-space sequencer queue. See also: drainOutput,
-- dropOutputBuffer, removeOutput.
dropOutput :: AllowOutput mode => T mode -> IO ()
-- | Remove events from the user-space output buffer. See also:
-- dropOutput.
dropOutputBuffer :: AllowOutput mode => T mode -> IO ()
-- | Wait until all events of the client are processed.
syncOutputQueue :: T mode -> 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).
input :: AllowInput mode => T mode -> IO T
-- | 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.
inputPending :: AllowInput mode => T mode -> Bool -> IO Word
-- | Remove events from both the user-space input buffer, and the
-- kernel-space sequencer queue. See also: dropInputBuffer,
-- removeOutput.
dropInput :: AllowInput mode => T mode -> IO ()
-- | Remove events from the user-space input buffer. See also:
-- dropInput.
dropInputBuffer :: AllowInput mode => T mode -> IO ()
data T
Cons :: !Bool -> !Tag -> !T -> !T -> !T -> !T -> !Data -> T
[highPriority] :: T -> !Bool
[tag] :: T -> !Tag
[queue] :: T -> !T
[time] :: T -> !T
[source] :: T -> !T
[dest] :: T -> !T
[body] :: T -> !Data
-- | Construct an ALSA sequencer event from very few information. Most
-- fields are initialized with sensible defaults. You may use this as a
-- start and alter its fields for your special needs.
--
--
-- (Event.simple myAddr (Event.simpleNote (Event.Channel 0) (Event.Pitch 60) Event.normalVelocity)) {Event.dest = destAddr}
--
simple :: T -> Data -> T
forSourcePort :: T -> Data -> T
forConnection :: T -> Data -> T
data Data
NoteEv :: NoteEv -> Note -> Data
CtrlEv :: CtrlEv -> Ctrl -> Data
QueueEv :: QueueEv -> T -> Data
AddrEv :: AddrEv -> T -> Data
ConnEv :: ConnEv -> T -> Data
EmptyEv :: EmptyEv -> Data
CustomEv :: CustomEv -> Custom -> Data
ExtEv :: ExtEv -> ByteString -> Data
class Type e
data NoteEv
ANote :: NoteEv
NoteOn :: NoteEv
NoteOff :: NoteEv
KeyPress :: NoteEv
data Note
Note :: !Channel -> !Pitch -> !Velocity -> !Velocity -> !Duration -> Note
[noteChannel] :: Note -> !Channel
[noteNote] :: Note -> !Pitch
[noteVelocity] :: Note -> !Velocity
[noteOffVelocity] :: Note -> !Velocity
[noteDuration] :: Note -> !Duration
-- | Make a note whose unspecified fields contain 0.
simpleNote :: Channel -> Pitch -> Velocity -> 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 :: !Channel -> !Parameter -> !Value -> Ctrl
[ctrlChannel] :: Ctrl -> !Channel
[ctrlParam] :: Ctrl -> !Parameter
[ctrlValue] :: Ctrl -> !Value
data CustomEv
Echo :: CustomEv
OSS :: CustomEv
User0 :: CustomEv
User1 :: CustomEv
User2 :: CustomEv
User3 :: CustomEv
User4 :: CustomEv
User5 :: CustomEv
User6 :: CustomEv
User7 :: CustomEv
User8 :: CustomEv
User9 :: CustomEv
data Custom
Custom :: !Word32 -> Custom
[custom0, custom1, custom2] :: Custom -> !Word32
customZero :: Custom
data ExtEv
SysEx :: ExtEv
Bounce :: ExtEv
UserVar0 :: ExtEv
UserVar1 :: ExtEv
UserVar2 :: ExtEv
UserVar3 :: ExtEv
UserVar4 :: ExtEv
data QueueEv
QueueStart :: QueueEv
QueueContinue :: QueueEv
QueueStop :: QueueEv
QueueSetPosTick :: !Tick -> QueueEv
QueueSetPosTime :: !T -> QueueEv
QueueTempo :: !Tempo -> QueueEv
QueueClock :: QueueEv
QueueTick :: QueueEv
QueueSkew :: !Skew -> QueueEv
QueueSyncPos :: !Position -> QueueEv
data AddrEv
ClientStart :: AddrEv
ClientExit :: AddrEv
ClientChange :: AddrEv
PortStart :: AddrEv
PortExit :: AddrEv
PortChange :: AddrEv
data ConnEv
PortSubscribed :: ConnEv
PortUnsubscribed :: ConnEv
data EmptyEv
TuneRequest :: EmptyEv
Reset :: EmptyEv
Sensing :: EmptyEv
None :: EmptyEv
Unknown :: EmptyEv
newtype Tag
Tag :: Word8 -> Tag
[unTag] :: Tag -> Word8
newtype Tempo
Tempo :: Int32 -> Tempo
[unTempo] :: Tempo -> Int32
newtype Parameter
Parameter :: Word32 -> Parameter
[unParameter] :: Parameter -> Word32
newtype Value
Value :: Int32 -> Value
[unValue] :: Value -> Int32
newtype Channel
Channel :: Word8 -> Channel
[unChannel] :: Channel -> Word8
newtype Pitch
Pitch :: Word8 -> Pitch
[unPitch] :: Pitch -> Word8
newtype Velocity
Velocity :: Word8 -> Velocity
[unVelocity] :: Velocity -> Word8
normalVelocity :: Velocity
offVelocity :: Velocity
newtype Duration
Duration :: Word32 -> Duration
[unDuration] :: Duration -> Word32
module Sound.ALSA.Sequencer.Concurrent
-- | Wait for new input to be available from the sequencer (even if there
-- is already input in the buffer)
threadWaitInput :: AllowInput mode => T mode -> IO ()
-- | Wait until new output may be drained from the buffer to the sequencer
-- (even if the output buffer is already empty)
threadWaitOutput :: AllowOutput mode => T mode -> IO ()
-- | Wait until new input is available or new output may be drained
threadWaitDuplex :: (AllowInput mode, AllowOutput mode) => T mode -> IO ()
-- | A thread-compatible version of
-- Sound.ALSA.Sequencer.Event.input. This call is always
-- blocking (unless there are already event in the input buffer) but will
-- not block other threads. The sequencer, however, must be set
-- non-blocking or this will not work as expected.
input :: AllowInput mode => T mode -> IO T
-- | A thread-compatible version of
-- Sound.ALSA.Sequencer.Event.output. This call is always
-- blocking (unless there is space in the output buffer) but will not
-- block other threads. The sequencer, however, must be set non-blocking
-- or this will not work as expected.
output :: AllowOutput mode => T mode -> T -> IO Word
-- | A thread-compatible version of
-- Sound.ALSA.Sequencer.Event.drainBuffer. This call is always
-- blocking but will not block other threads. The sequencer, however,
-- must be set non-blocking or this will not work as expected.
drainOutput :: AllowOutput mode => T mode -> IO ()
module Sound.ALSA.Sequencer.Event.Accessor
highPriority :: T T Bool
tag :: T T Tag
queue :: T T T
time :: T T T
timeStamp :: T T Stamp
source :: T T T
dest :: T T T
connect :: T T T
body :: T T Data
-- | 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 T mode
-- | 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.
class OpenMode mode
class OpenMode mode => AllowOutput mode
class OpenMode mode => AllowInput mode
data OutputMode
OutputMode :: OutputMode
data InputMode
InputMode :: InputMode
data DuplexMode
DuplexMode :: DuplexMode
-- | 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 :: OpenMode mode => String -> BlockMode -> IO (T mode)
openDefault :: OpenMode mode => BlockMode -> IO (T mode)
-- | 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 :: T mode -> IO ()
with :: OpenMode mode => String -> BlockMode -> (T mode -> IO a) -> IO a
withDefault :: OpenMode mode => BlockMode -> (T mode -> IO a) -> IO a
-- | This is the name that should be passed to open in most cases.
defaultName :: String
-- | Get identifier of a sequencer handle. It is the same identifier
-- specified in the call to open.
getName :: T mode -> 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).
setBlocking :: T mode -> BlockMode -> IO ()
-- | Return the byte size of the output buffer.
getOutputBufferSize :: T mode -> IO Word
-- | Resize of the output buffer. This function clears all output events
-- (see drop_output).
setOutputBufferSize :: T mode -> Word -> IO ()
-- | Return the byte size of input buffer.
getInputBufferSize :: T mode -> IO Word
-- | Resize the input buffer. This function clears all input events (see
-- drop_input).
setInputBufferSize :: T mode -> Word -> IO ()
-- | Resize the output memory pool.
setPoolOutput :: T mode -> 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.
setPoolOutputRoom :: T mode -> Word -> IO ()
-- | Reset the output pool.
resetPoolOutput :: T mode -> IO ()
-- | Resize the input memory pool.
setPoolInput :: T mode -> Word -> IO ()
-- | Reset the input pool.
resetPoolInput :: T mode -> IO ()