packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCRtpCodec.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webrtc (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.RTCRtpCodec
       (js_newRTCRtpCodec, js_setMimeType, js_getMimeType, js_setClockRate, js_getClockRate, js_setChannels, js_getChannels, js_setSdpFmtpLine, js_getSdpFmtpLine, newRTCRtpCodec, setMimeType, getMimeType, setClockRate, getClockRate, setChannels, getChannels, getChannelsUnsafe, getChannelsUnchecked, setSdpFmtpLine, getSdpFmtpLine, getSdpFmtpLineUnsafe, getSdpFmtpLineUnchecked, RTCRtpCodec(..), gTypeRTCRtpCodec, IsRTCRtpCodec, toRTCRtpCodec)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(($1, $2) => { return ({\"mimeType\": $1, \"clockRate\": $2}); })"
        js_newRTCRtpCodec :: JSString -> Word -> IO RTCRtpCodec
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec RTCRtpCodec specification>
newRTCRtpCodec :: (MonadDOM m, ToJSString mimeType) => mimeType -> Word -> m RTCRtpCodec
newRTCRtpCodec mimeType clockRate = liftDOM ((js_newRTCRtpCodec (toJSString mimeType) (clockRate)))

foreign import javascript safe "(($1, $2) => { $1[\"mimeType\"] = $2; })"
        js_setMimeType :: RTCRtpCodec -> JSString -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-mimetype RTCRtpCodec.mimeType specification>
setMimeType :: (MonadDOM m, IsRTCRtpCodec self, ToJSString val) => self -> val -> m ()
setMimeType self val = liftDOM (void ((js_setMimeType ((Types.toRTCRtpCodec self)) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"mimeType\"]; })"
        js_getMimeType :: RTCRtpCodec -> IO JSString
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-mimetype RTCRtpCodec.mimeType specification>
getMimeType :: (MonadDOM m, IsRTCRtpCodec self, FromJSString result) => self -> m result
getMimeType self = liftDOM ((fromJSString <$> (js_getMimeType ((Types.toRTCRtpCodec self)))))

foreign import javascript safe "(($1, $2) => { $1[\"clockRate\"] = $2; })"
        js_setClockRate :: RTCRtpCodec -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-clockrate RTCRtpCodec.clockRate specification>
setClockRate :: (MonadDOM m, IsRTCRtpCodec self) => self -> Word -> m ()
setClockRate self val = liftDOM (void ((js_setClockRate ((Types.toRTCRtpCodec self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"clockRate\"]; })"
        js_getClockRate :: RTCRtpCodec -> IO Word
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-clockrate RTCRtpCodec.clockRate specification>
getClockRate :: (MonadDOM m, IsRTCRtpCodec self) => self -> m Word
getClockRate self = liftDOM ((js_getClockRate ((Types.toRTCRtpCodec self))))

foreign import javascript safe "(($1, $2) => { $1[\"channels\"] = $2; })"
        js_setChannels :: RTCRtpCodec -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-channels RTCRtpCodec.channels specification>
setChannels :: (MonadDOM m, IsRTCRtpCodec self) => self -> Word -> m ()
setChannels self val = liftDOM (void ((js_setChannels ((Types.toRTCRtpCodec self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"channels\"]; })"
        js_getChannels :: RTCRtpCodec -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-channels RTCRtpCodec.channels specification>
getChannels :: (MonadDOM m, IsRTCRtpCodec self) => self -> m (Maybe Word)
getChannels self = liftDOM (((js_getChannels ((Types.toRTCRtpCodec self))) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-channels RTCRtpCodec.channels specification>
getChannelsUnsafe :: (MonadDOM m, IsRTCRtpCodec self, HasCallStack) => self -> m Word
getChannelsUnsafe self = liftDOM ((((js_getChannels ((Types.toRTCRtpCodec self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-channels RTCRtpCodec.channels specification>
getChannelsUnchecked :: (MonadDOM m, IsRTCRtpCodec self) => self -> m Word
getChannelsUnchecked self = liftDOM ((pFromJSVal <$> (js_getChannels ((Types.toRTCRtpCodec self)))))

foreign import javascript safe "(($1, $2) => { $1[\"sdpFmtpLine\"] = $2; })"
        js_setSdpFmtpLine :: RTCRtpCodec -> JSString -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-sdpfmtpline RTCRtpCodec.sdpFmtpLine specification>
setSdpFmtpLine :: (MonadDOM m, IsRTCRtpCodec self, ToJSString val) => self -> val -> m ()
setSdpFmtpLine self val = liftDOM (void ((js_setSdpFmtpLine ((Types.toRTCRtpCodec self)) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"sdpFmtpLine\"]; })"
        js_getSdpFmtpLine :: RTCRtpCodec -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-sdpfmtpline RTCRtpCodec.sdpFmtpLine specification>
getSdpFmtpLine :: (MonadDOM m, IsRTCRtpCodec self, FromJSString result) => self -> m (Maybe result)
getSdpFmtpLine self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getSdpFmtpLine ((Types.toRTCRtpCodec self)))))

-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-sdpfmtpline RTCRtpCodec.sdpFmtpLine specification>
getSdpFmtpLineUnsafe :: (MonadDOM m, IsRTCRtpCodec self, HasCallStack, FromJSString result) => self -> m result
getSdpFmtpLineUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getSdpFmtpLine ((Types.toRTCRtpCodec self)))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcodec-sdpfmtpline RTCRtpCodec.sdpFmtpLine specification>
getSdpFmtpLineUnchecked :: (MonadDOM m, IsRTCRtpCodec self, FromJSString result) => self -> m result
getSdpFmtpLineUnchecked self = liftDOM ((pFromJSVal <$> (js_getSdpFmtpLine ((Types.toRTCRtpCodec self)))))