packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCRtpSendParameters.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.RTCRtpSendParameters
       (js_newRTCRtpSendParameters, js_setTransactionId, js_getTransactionId, js_setEncodings, js_getEncodings, js_setDegradationPreference, js_getDegradationPreference, newRTCRtpSendParameters, setTransactionId, getTransactionId, setEncodings, getEncodings, setDegradationPreference, getDegradationPreference, getDegradationPreferenceUnsafe, getDegradationPreferenceUnchecked, RTCRtpSendParameters(..), gTypeRTCRtpSendParameters)
       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, $3, $4, $5) => { return ({\"headerExtensions\": $1, \"rtcp\": $2, \"codecs\": $3, \"transactionId\": $4, \"encodings\": $5}); })"
        js_newRTCRtpSendParameters :: JSVal -> RTCRtcpParameters -> JSVal -> JSString -> JSVal -> IO RTCRtpSendParameters
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpsendparameters RTCRtpSendParameters specification>
newRTCRtpSendParameters :: (MonadDOM m, ToJSString transactionId) => [RTCRtpHeaderExtensionParameters] -> RTCRtcpParameters -> [RTCRtpCodecParameters] -> transactionId -> [RTCRtpEncodingParameters] -> m RTCRtpSendParameters
newRTCRtpSendParameters headerExtensions rtcp codecs transactionId encodings = liftDOM (((toJSVal headerExtensions) >>= \a1' -> (toJSVal codecs) >>= \a3' -> (toJSVal encodings) >>= \a5' -> js_newRTCRtpSendParameters a1' (rtcp) a3' (toJSString transactionId) a5'))

foreign import javascript safe "(($1, $2) => { $1[\"transactionId\"] = $2; })"
        js_setTransactionId :: RTCRtpSendParameters -> JSString -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpsendparameters-transactionid RTCRtpSendParameters.transactionId specification>
setTransactionId :: (MonadDOM m, ToJSString val) => RTCRtpSendParameters -> val -> m ()
setTransactionId self val = liftDOM (void ((js_setTransactionId (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"transactionId\"]; })"
        js_getTransactionId :: RTCRtpSendParameters -> IO JSString
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpsendparameters-transactionid RTCRtpSendParameters.transactionId specification>
getTransactionId :: (MonadDOM m, FromJSString result) => RTCRtpSendParameters -> m result
getTransactionId self = liftDOM ((fromJSString <$> (js_getTransactionId (self))))

foreign import javascript safe "(($1, $2) => { $1[\"encodings\"] = $2; })"
        js_setEncodings :: RTCRtpSendParameters -> JSVal -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpsendparameters-encodings RTCRtpSendParameters.encodings specification>
setEncodings :: (MonadDOM m) => RTCRtpSendParameters -> [RTCRtpEncodingParameters] -> m ()
setEncodings self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setEncodings (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"encodings\"]; })"
        js_getEncodings :: RTCRtpSendParameters -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpsendparameters-encodings RTCRtpSendParameters.encodings specification>
getEncodings :: (MonadDOM m) => RTCRtpSendParameters -> m [RTCRtpEncodingParameters]
getEncodings self = liftDOM (((js_getEncodings (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"degradationPreference\"] = $2; })"
        js_setDegradationPreference :: RTCRtpSendParameters -> JSVal -> IO ()
-- | <https://w3c.github.io/mst-content-hint/#dom-rtcrtpsendparameters-degradationpreference RTCRtpSendParameters.degradationPreference specification>
setDegradationPreference :: (MonadDOM m) => RTCRtpSendParameters -> RTCDegradationPreference -> m ()
setDegradationPreference self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setDegradationPreference (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"degradationPreference\"]; })"
        js_getDegradationPreference :: RTCRtpSendParameters -> IO JSVal
-- | <https://w3c.github.io/mst-content-hint/#dom-rtcrtpsendparameters-degradationpreference RTCRtpSendParameters.degradationPreference specification>
getDegradationPreference :: (MonadDOM m) => RTCRtpSendParameters -> m (Maybe RTCDegradationPreference)
getDegradationPreference self = liftDOM (((js_getDegradationPreference (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mst-content-hint/#dom-rtcrtpsendparameters-degradationpreference RTCRtpSendParameters.degradationPreference specification>
getDegradationPreferenceUnsafe :: (MonadDOM m, HasCallStack) => RTCRtpSendParameters -> m RTCDegradationPreference
getDegradationPreferenceUnsafe self = liftDOM ((((js_getDegradationPreference (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mst-content-hint/#dom-rtcrtpsendparameters-degradationpreference RTCRtpSendParameters.degradationPreference specification>
getDegradationPreferenceUnchecked :: (MonadDOM m) => RTCRtpSendParameters -> m RTCDegradationPreference
getDegradationPreferenceUnchecked self = liftDOM ((pFromJSVal <$> (js_getDegradationPreference (self))))