hosc-0.14: Haskell Open Sound Control

Safe HaskellNone

Sound.OSC.Transport.Monad

Contents

Description

Monad class implementing an Open Sound Control transport.

Synopsis

Documentation

class Monad m => SendOSC m whereSource

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 whereSource

Receiver monad.

Methods

recvPacket :: m PacketSource

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 aSource

Transport connection.

withTransport :: Transport t => IO t -> Connection t a -> IO aSource

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 PacketSource

Wait for a Packet where the supplied predicate is True, discarding intervening packets.

waitFor :: RecvOSC m => (Packet -> Maybe a) -> m aSource

Wait for a Packet where the supplied function does not give Nothing, discarding intervening packets.

waitMessage :: RecvOSC m => m MessageSource

waitFor packet_to_message, ie. an incoming Message or immediate mode Bundle with one element.

waitAddress :: RecvOSC m => Address_Pattern -> m PacketSource

A waitFor for variant using packet_has_address to match on the Address_Pattern of incoming Packets.

waitReply :: RecvOSC m => Address_Pattern -> m MessageSource

Variant on waitAddress that returns matching Message.

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

Variant of waitReply that runs messageDatum.