hosc-0.18: Haskell Open Sound Control

Safe HaskellSafe
LanguageHaskell2010

Sound.OSC.Transport.Monad

Contents

Description

Monad class implementing an Open Sound Control transport.

Synopsis

Documentation

class Monad m => SendOSC m where Source #

Sender monad.

Methods

sendPacket :: Packet -> m () Source #

Encode and send an OSC packet.

Instances
(Transport t, MonadIO io) => SendOSC (ReaderT t io) Source #

SendOSC over ReaderT.

Instance details

Defined in Sound.OSC.Transport.Monad

Methods

sendPacket :: Packet -> ReaderT t io () Source #

class Monad m => RecvOSC m where Source #

Receiver monad.

Methods

recvPacket :: m Packet Source #

Receive and decode an OSC packet.

Instances
(Transport t, MonadIO io) => RecvOSC (ReaderT t io) Source #

RecvOSC over ReaderT.

Instance details

Defined in Sound.OSC.Transport.Monad

class (SendOSC m, RecvOSC m) => DuplexOSC m Source #

DuplexOSC is the union of SendOSC and RecvOSC.

Instances
(Transport t, MonadIO io) => DuplexOSC (ReaderT t io) Source #

DuplexOSC over ReaderT.

Instance details

Defined in Sound.OSC.Transport.Monad

class (DuplexOSC m, MonadIO m) => Transport m Source #

Transport is DuplexOSC with a MonadIO constraint.

Instances
(Transport t, MonadIO io) => Transport (ReaderT t io) Source #

Transport over ReaderT.

Instance details

Defined in Sound.OSC.Transport.Monad

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.

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.

waitImmediate :: RecvOSC m => m Packet Source #

waitUntil packet_is_immediate.

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.

waitDatum :: RecvOSC m => Address_Pattern -> m [Datum] Source #

Variant of waitReply that runs messageDatum.