-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell Open Sound Control -- -- Haskell implementation of the Open Sound Control byte protocol @package hosc @version 0.2 module Sound.OpenSoundControl.Byte -- | Encode a signed 8-bit integer. encode_i8 :: Int -> ByteString -- | Encode a signed 16-bit integer. encode_i16 :: Int -> ByteString -- | Encode a signed 32-bit integer. encode_i32 :: Int -> ByteString -- | Encode an unsigned 16-bit integer. encode_u32 :: Int -> ByteString -- | Encode a signed 64-bit integer. encode_i64 :: Integer -> ByteString -- | Encode an unsigned 64-bit integer. encode_u64 :: Integer -> ByteString -- | Encode a 32-bit IEEE floating point number. encode_f32 :: Double -> ByteString -- | Encode a 64-bit IEEE floating point number. encode_f64 :: Double -> ByteString -- | Encode an ASCII string. encode_str :: String -> ByteString -- | Decode a signed 8-bit integer. decode_i8 :: ByteString -> Int -- | Decode a signed 16-bit integer. decode_i16 :: ByteString -> Int -- | Decode a signed 32-bit integer. decode_i32 :: ByteString -> Int -- | Decode an unsigned 32-bit integer. decode_u32 :: ByteString -> Int -- | Decode a signed 64-bit integer. decode_i64 :: ByteString -> Integer -- | Decode an unsigned 64-bit integer. decode_u64 :: ByteString -> Integer -- | Decode a 32-bit IEEE floating point number. decode_f32 :: ByteString -> Double -- | Decode a 64-bit IEEE floating point number. decode_f64 :: ByteString -> Double -- | Decode an ASCII string. decode_str :: ByteString -> String module Sound.OpenSoundControl.Time -- | UTC time is represented as a real number. type UTC = Double -- | Read current UTC timestamp. utc :: IO UTC -- | NTP time is represented as an integer. type NTP = Integer -- | Read current NTP timestamp. ntp :: IO NTP -- | Convert a real-valued NTP timestamp to an NTP timestamp. ntpr_ntp :: Double -> NTP -- | Convert UTC timestamp to NTP timestamp. utc_ntp :: UTC -> NTP module Sound.OpenSoundControl.OSC -- | An OSC packet. data OSC -- | OSC message constructor message :: String -> [Datum] -> OSC -- | OSC bundle constructor bundle :: Double -> [OSC] -> OSC -- | Retrieve the address of an OSC message, or Nothing for a bundle. address :: OSC -> Maybe String -- | Retrieve the arguments of an OSC message, or Nothing for a bundle. arguments :: OSC -> Maybe [Datum] -- | Retrieve the timestamp of an OSC bundle, or Nothing for a message. timestamp :: OSC -> Maybe Double -- | Retrieve the messages in an OSC bundle, or Nothing for a message. messages :: OSC -> Maybe [OSC] -- | The basic elements of OSC messages. data Datum -- | Construct OSC int datum. int :: Int -> Datum -- | Construct OSC float datum. float :: Double -> Datum -- | Construct OSC double datum. double :: Double -> Datum -- | Construct OSC string datum. string :: String -> Datum -- | Construct OSC blob datum. blob :: [Word8] -> Datum -- | Encode an OSC packet. encodeOSC :: OSC -> ByteString -- | Encode an OSC packet (NTP epoch). encodeOSC_NTP :: OSC -> ByteString -- | Decode an OSC packet. decodeOSC :: ByteString -> OSC instance Eq OSC instance Show OSC instance Eq Datum instance Show Datum instance Ord OSC module Sound.OpenSoundControl.Transport -- | Abstract over the underlying transport protocol. class Transport t send :: (Transport t) => t -> OSC -> IO () recv :: (Transport t) => t -> IO OSC close :: (Transport t) => t -> IO () -- | Bracket OSC communication. withTransport :: (Transport t) => IO t -> (t -> IO a) -> IO a -- | Wait for an OSC message with the specified address, discarding -- intervening messages. wait :: (Transport t) => t -> String -> IO OSC module Sound.OpenSoundControl.Transport.UDP -- | The UDP transport handle data type. data UDP -- | Make a UDP connection. openUDP :: String -> Int -> IO UDP instance Eq UDP instance Show UDP instance Transport UDP module Sound.OpenSoundControl.Transport.TCP -- | The TCP transport handle data type. data TCP -- | Make a TCP connection. openTCP :: String -> Int -> IO TCP -- | A trivial TCP OSC server. tcpServer :: Int -> (TCP -> IO ()) -> IO () instance Eq TCP instance Show TCP instance Transport TCP module Sound.OpenSoundControl f32_i32 :: Float -> Int32 i32_f32 :: Int32 -> Float f64_i64 :: Double -> Int64 i64_f64 :: Int64 -> Double -- | C strings are null suffixed byte strings. str_cstr :: String -> [Word8] cstr_str :: [Word8] -> String -- | Pascal strings are length prefixed byte strings. str_pstr :: String -> [Word8] pstr_str :: [Word8] -> String