Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data types for Osc messages, bundles and packets.
Synopsis
- type Address_Pattern = String
- data Message = Message {
- messageAddress :: !Address_Pattern
- messageDatum :: ![Datum]
- message :: Address_Pattern -> [Datum] -> Message
- messageSignature :: Message -> String
- messageDescriptor :: Message -> Ascii
- data Bundle = Bundle {
- bundleTime :: !Time
- bundleMessages :: ![Message]
- bundle :: Time -> [Message] -> Bundle
- data Packet
- = Packet_Message {
- packetMessage :: !Message
- | Packet_Bundle {
- packetBundle :: !Bundle
- = Packet_Message {
- p_bundle :: Time -> [Message] -> Packet
- p_message :: Address_Pattern -> [Datum] -> Packet
- immediately :: Time
- packetTime :: Packet -> Time
- packetMessages :: Packet -> [Message]
- packet_to_bundle :: Packet -> Bundle
- packet_to_message :: Packet -> Maybe Message
- packet_is_immediate :: Packet -> Bool
- at_packet :: (Message -> a) -> (Bundle -> a) -> Packet -> a
- message_has_address :: Address_Pattern -> Message -> Bool
- bundle_has_address :: Address_Pattern -> Bundle -> Bool
- packet_has_address :: Address_Pattern -> Packet -> Bool
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
.
An Osc message, an Address_Pattern
and a sequence of Datum
.
Message | |
|
message :: Address_Pattern -> [Datum] -> Message Source #
Message
constructor. It is an error
if the Address_Pattern
doesn't conform to the Osc specification.
messageSignature :: Message -> String Source #
messageDescriptor :: Message -> Ascii Source #
Bundle
An Osc bundle, a Time
and a sequence of Message
s.
Do not allow recursion, all contents must be messages.
Bundle | |
|
Packet
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
.
packet_to_bundle :: Packet -> Bundle Source #
If Packet
is a Message
add immediately
timestamp, else id
.
packet_is_immediate :: Packet -> Bool Source #
Is Packet
immediate, ie. a Bundle
with timestamp immediately
, or a plain Message.
Address Query
message_has_address :: Address_Pattern -> Message -> Bool Source #
Does Message
have the specified Address_Pattern
.
bundle_has_address :: Address_Pattern -> Bundle -> Bool Source #
Do any of the Message
s at Bundle
have the specified
Address_Pattern
.
packet_has_address :: Address_Pattern -> Packet -> Bool Source #
Does Packet
have the specified Address_Pattern
, ie.
message_has_address
or bundle_has_address
.