hosc-0.16: Haskell Open Sound Control

Safe HaskellSafe
LanguageHaskell98

Sound.OSC.Packet

Contents

Description

Data types for OSC messages, bundles and packets.

Synopsis

Message

type Address_Pattern = String #

OSC address pattern. This is strictly an ASCII value, but it is very common to pattern match on addresses and matching on ByteString requires OverloadedStrings.

message :: Address_Pattern -> [Datum] -> Message #

Message constructor. It is an error if the Address_Pattern doesn't conform to the OSC specification.

Bundle

data Bundle #

An OSC bundle.

Constructors

Bundle 

Instances

bundle :: Time -> [Message] -> Bundle #

Bundle constructor. It is an error if the Message list is empty.

Packet

packetTime :: Packet -> Time #

The Time of Packet, if the Packet is a Message this is immediately.

packetMessages :: Packet -> [Message] #

Retrieve the set of Messages from a Packet.

packet_to_bundle :: Packet -> Bundle #

If Packet is a Message add immediately timestamp, else id.

packet_to_message :: Packet -> Maybe Message #

If Packet is a Message or a Bundle with an immediate time tag and with one element, return the Message, else Nothing.

packet_is_immediate :: Packet -> Bool #

Is Packet immediate, ie. a Bundle with timestamp immediately, or a plain Message.

at_packet :: (Message -> a) -> (Bundle -> a) -> Packet -> a #

Variant of either for Packet.

Address Query

bundle_has_address :: Address_Pattern -> Bundle -> Bool #

Do any of the Messages at Bundle have the specified Address_Pattern.

Pretty printing

messagePP :: FP_Precision -> Message -> String #

Pretty printer for Message.

bundlePP :: FP_Precision -> Bundle -> String #

Pretty printer for Bundle.

packetPP :: FP_Precision -> Packet -> String #

Pretty printer for Packet.