| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Sound.Osc.Packet
Contents
Description
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 BundleOf t = Bundle {
- bundleTime :: !Time
- bundleMessages :: ![t]
- type Bundle = BundleOf Message
- bundle :: Time -> [t] -> BundleOf t
- data PacketOf t
- = Packet_Message {
- packetMessage :: !Message
- | Packet_Bundle {
- packetBundle :: !(BundleOf t)
- = Packet_Message {
- type Packet = PacketOf Message
- p_bundle :: Time -> [t] -> PacketOf t
- p_message :: Address_Pattern -> [Datum] -> PacketOf t
- immediately :: Time
- packetTime :: PacketOf t -> Time
- packetMessages :: PacketOf Message -> [Message]
- packet_to_bundle :: PacketOf Message -> BundleOf Message
- packet_to_message :: PacketOf Message -> Maybe Message
- packet_is_immediate :: PacketOf t -> Bool
- at_packet :: (Message -> a) -> (BundleOf t -> a) -> PacketOf t -> a
- message_has_address :: Address_Pattern -> Message -> Bool
- bundle_has_address :: Address_Pattern -> BundleOf Message -> Bool
- packet_has_address :: Address_Pattern -> PacketOf Message -> 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.
Constructors
| Message | |
Fields
| |
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 Messages.
The type parameter specifies the element type.
Ordinarily this is Message, which does not allow recursion.
Constructors
| Bundle | |
Fields
| |
Instances
| Read t => Read (BundleOf t) Source # | |
| Show t => Show (BundleOf t) Source # | |
| Eq t => Eq (BundleOf t) Source # | |
| Eq t => Ord (BundleOf t) Source # | Osc |
Packet
Constructors
| Packet_Message | |
Fields
| |
| Packet_Bundle | |
Fields
| |
immediately :: Time Source #
Constant indicating a bundle to be executed immediately.
It has the Ntp64 representation of 1.
>>>immediately == (1 / (2 ^ 32))True
packetTime :: PacketOf t -> Time Source #
The Time of Packet, if the Packet is a Message this is immediately.
packet_to_bundle :: PacketOf Message -> BundleOf Message Source #
If Packet is a Message add immediately timestamp, else id.
packet_is_immediate :: PacketOf t -> Bool Source #
Is Packet immediate, ie. a BundleOf 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 -> BundleOf Message -> Bool Source #
Do any of the Messages at 'Bundle Message' have the specified
Address_Pattern.
packet_has_address :: Address_Pattern -> PacketOf Message -> Bool Source #
Does Packet have the specified Address_Pattern, ie.
message_has_address or bundle_has_address.