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 Source #

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 Source #

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

Bundle

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

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

Packet

packetTime :: Packet -> Time Source #

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

packetMessages :: Packet -> [Message] Source #

Retrieve the set of Messages from a Packet.

packet_to_bundle :: Packet -> Bundle Source #

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

packet_to_message :: Packet -> Maybe Message Source #

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 Source #

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

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

Variant of either for Packet.

Address Query

bundle_has_address :: Address_Pattern -> Bundle -> Bool Source #

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

Pretty printing

messagePP :: FP_Precision -> Message -> String Source #

Pretty printer for Message.

bundlePP :: FP_Precision -> Bundle -> String Source #

Pretty printer for Bundle.

packetPP :: FP_Precision -> Packet -> String Source #

Pretty printer for Packet.