hosc-0.20: Haskell Open Sound Control
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Osc.Packet

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, however it is very common to pattern match on addresses and matching on Data.ByteString.Char8 requires OverloadedStrings.

data Message Source #

An Osc message, an Address_Pattern and a sequence of Datum.

Constructors

Message 

Instances

Instances details
Read Message Source # 
Instance details

Defined in Sound.Osc.Packet

Show Message Source # 
Instance details

Defined in Sound.Osc.Packet

Eq Message Source # 
Instance details

Defined in Sound.Osc.Packet

Methods

(==) :: Message -> Message -> Bool #

(/=) :: Message -> Message -> Bool #

Ord Message Source # 
Instance details

Defined in Sound.Osc.Packet

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

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

Bundle

data Bundle Source #

An Osc bundle, a Time and a sequence of Messages. Do not allow recursion, all contents must be messages.

Constructors

Bundle 

Instances

Instances details
Read Bundle Source # 
Instance details

Defined in Sound.Osc.Packet

Show Bundle Source # 
Instance details

Defined in Sound.Osc.Packet

Eq Bundle Source # 
Instance details

Defined in Sound.Osc.Packet

Methods

(==) :: Bundle -> Bundle -> Bool #

(/=) :: Bundle -> Bundle -> Bool #

Ord Bundle Source #

Osc Bundles can be ordered (time ascending).

Instance details

Defined in Sound.Osc.Packet

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

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

Packet

data Packet Source #

An Osc Packet is either a Message or a Bundle.

Instances

Instances details
Read Packet Source # 
Instance details

Defined in Sound.Osc.Packet

Show Packet Source # 
Instance details

Defined in Sound.Osc.Packet

Eq Packet Source # 
Instance details

Defined in Sound.Osc.Packet

Methods

(==) :: Packet -> Packet -> Bool #

(/=) :: Packet -> Packet -> Bool #

immediately :: Time Source #

Constant indicating a bundle to be executed immediately. It has the Ntp64 representation of 1.

ntpr_to_ntpi immediately == 1

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.