hosc-0.15: Haskell Open Sound Control

Safe HaskellNone
LanguageHaskell98

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

sendOSC :: OSC o => o -> m () Source

Encode and send an OSC packet.

Instances

(Transport t, MonadIO io) => SendOSC (ReaderT t io) 

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) 

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) 

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

Transport is DuplexOSC with a MonadIO constraint.

Instances

(Transport t, MonadIO io) => Transport (ReaderT t io) 

type Connection t a = ReaderT t IO a Source

Transport connection.

withTransport :: Transport t => IO t -> Connection t a -> IO a 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

recvOSC :: (RecvOSC m, OSC o) => m (Maybe o) Source

Variant of recvPacket that runs fromPacket.

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.

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

Variant of waitReply that runs messageDatum.