Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Monad class implementing an Open Sound Control transport.
Synopsis
- class Monad m => SendOsc m where
- sendPacket :: Packet -> m ()
- class Monad m => RecvOsc m where
- recvPacket :: m Packet
- class (SendOsc m, RecvOsc m) => DuplexOsc m
- class (DuplexOsc m, MonadIO m) => Transport m
- type Connection t a = ReaderT t IO a
- withTransport :: Transport t => IO t -> Connection t r -> IO r
- withTransport_ :: Transport t => IO t -> Connection t r -> IO ()
- sendMessage :: SendOsc m => Message -> m ()
- sendBundle :: SendOsc m => Bundle -> m ()
- recvBundle :: RecvOsc m => m Bundle
- recvMessage :: RecvOsc m => m (Maybe Message)
- recvMessage_err :: RecvOsc m => m Message
- recvMessages :: RecvOsc m => m [Message]
- waitUntil :: RecvOsc m => (Packet -> Bool) -> m Packet
- waitFor :: RecvOsc m => (Packet -> Maybe a) -> m a
- waitImmediate :: RecvOsc m => m Packet
- waitMessage :: RecvOsc m => m Message
- waitAddress :: RecvOsc m => Address_Pattern -> m Packet
- waitReply :: RecvOsc m => Address_Pattern -> m Message
- waitDatum :: RecvOsc m => Address_Pattern -> m [Datum]
Documentation
class Monad m => SendOsc m where Source #
Sender monad.
sendPacket :: Packet -> m () Source #
Encode and send an Osc packet.
class Monad m => RecvOsc m where Source #
Receiver monad.
recvPacket :: m Packet Source #
Receive and decode an Osc packet.
type Connection t a = ReaderT t IO a Source #
Transport connection.
withTransport :: Transport t => IO t -> Connection t r -> IO r Source #
Bracket Open Sound Control communication.
withTransport_ :: Transport t => IO t -> Connection t r -> IO () Source #
void
of withTransport
.
Send
sendMessage :: SendOsc m => Message -> m () Source #
Type restricted synonym for sendOsc
.
sendBundle :: SendOsc m => Bundle -> m () Source #
Type restricted synonym for sendOsc
.
Receive
recvBundle :: RecvOsc m => m Bundle Source #
Variant of recvPacket
that runs packet_to_bundle
.
recvMessage :: RecvOsc m => m (Maybe Message) Source #
Variant of recvPacket
that runs packet_to_message
.
recvMessage_err :: RecvOsc m => m Message Source #
Erroring variant.
recvMessages :: RecvOsc m => m [Message] Source #
Variant of recvPacket
that runs packetMessages
.
Wait
waitUntil :: RecvOsc m => (Packet -> Bool) -> m Packet Source #
Wait for a Packet
where the supplied predicate is True
,
discarding intervening packets.
waitFor :: RecvOsc m => (Packet -> Maybe a) -> m a Source #
Wait for a Packet
where the supplied function does not give
Nothing
, discarding intervening packets.
waitMessage :: RecvOsc m => m Message Source #
waitFor
packet_to_message
, ie. an incoming Message
or
immediate mode Bundle
with one element.
waitAddress :: RecvOsc m => Address_Pattern -> m Packet Source #
A waitFor
for variant using packet_has_address
to match on
the Address_Pattern
of incoming Packets
.
waitReply :: RecvOsc m => Address_Pattern -> m Message Source #
Variant on waitAddress
that returns matching Message
.