packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCRtpContributingSource.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.RTCRtpContributingSource
       (js_newRTCRtpContributingSource, js_setTimestamp, js_getTimestamp, js_setSource, js_getSource, js_setAudioLevel, js_getAudioLevel, js_setRtpTimestamp, js_getRtpTimestamp, newRTCRtpContributingSource, setTimestamp, getTimestamp, setSource, getSource, setAudioLevel, getAudioLevel, getAudioLevelUnsafe, getAudioLevelUnchecked, setRtpTimestamp, getRtpTimestamp, RTCRtpContributingSource(..), gTypeRTCRtpContributingSource, IsRTCRtpContributingSource, toRTCRtpContributingSource)
       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) => { return ({\"timestamp\": $1, \"source\": $2, \"rtpTimestamp\": $3}); })"
        js_newRTCRtpContributingSource :: Double -> Word -> Word -> IO RTCRtpContributingSource
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource RTCRtpContributingSource specification>
newRTCRtpContributingSource :: (MonadDOM m) => Double -> Word -> Word -> m RTCRtpContributingSource
newRTCRtpContributingSource timestamp source rtpTimestamp = liftDOM ((js_newRTCRtpContributingSource (timestamp) (source) (rtpTimestamp)))

foreign import javascript safe "(($1, $2) => { $1[\"timestamp\"] = $2; })"
        js_setTimestamp :: RTCRtpContributingSource -> Double -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-timestamp RTCRtpContributingSource.timestamp specification>
setTimestamp :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> Double -> m ()
setTimestamp self val = liftDOM (void ((js_setTimestamp ((Types.toRTCRtpContributingSource self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"timestamp\"]; })"
        js_getTimestamp :: RTCRtpContributingSource -> IO Double
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-timestamp RTCRtpContributingSource.timestamp specification>
getTimestamp :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> m Double
getTimestamp self = liftDOM ((js_getTimestamp ((Types.toRTCRtpContributingSource self))))

foreign import javascript safe "(($1, $2) => { $1[\"source\"] = $2; })"
        js_setSource :: RTCRtpContributingSource -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-source RTCRtpContributingSource.source specification>
setSource :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> Word -> m ()
setSource self val = liftDOM (void ((js_setSource ((Types.toRTCRtpContributingSource self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"source\"]; })"
        js_getSource :: RTCRtpContributingSource -> IO Word
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-source RTCRtpContributingSource.source specification>
getSource :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> m Word
getSource self = liftDOM ((js_getSource ((Types.toRTCRtpContributingSource self))))

foreign import javascript safe "(($1, $2) => { $1[\"audioLevel\"] = $2; })"
        js_setAudioLevel :: RTCRtpContributingSource -> Double -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-audiolevel RTCRtpContributingSource.audioLevel specification>
setAudioLevel :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> Double -> m ()
setAudioLevel self val = liftDOM (void ((js_setAudioLevel ((Types.toRTCRtpContributingSource self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"audioLevel\"]; })"
        js_getAudioLevel :: RTCRtpContributingSource -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-audiolevel RTCRtpContributingSource.audioLevel specification>
getAudioLevel :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> m (Maybe Double)
getAudioLevel self = liftDOM (((js_getAudioLevel ((Types.toRTCRtpContributingSource self))) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-audiolevel RTCRtpContributingSource.audioLevel specification>
getAudioLevelUnsafe :: (MonadDOM m, IsRTCRtpContributingSource self, HasCallStack) => self -> m Double
getAudioLevelUnsafe self = liftDOM ((((js_getAudioLevel ((Types.toRTCRtpContributingSource self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-audiolevel RTCRtpContributingSource.audioLevel specification>
getAudioLevelUnchecked :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> m Double
getAudioLevelUnchecked self = liftDOM ((pFromJSVal <$> (js_getAudioLevel ((Types.toRTCRtpContributingSource self)))))

foreign import javascript safe "(($1, $2) => { $1[\"rtpTimestamp\"] = $2; })"
        js_setRtpTimestamp :: RTCRtpContributingSource -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-rtptimestamp RTCRtpContributingSource.rtpTimestamp specification>
setRtpTimestamp :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> Word -> m ()
setRtpTimestamp self val = liftDOM (void ((js_setRtpTimestamp ((Types.toRTCRtpContributingSource self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"rtpTimestamp\"]; })"
        js_getRtpTimestamp :: RTCRtpContributingSource -> IO Word
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcrtpcontributingsource-rtptimestamp RTCRtpContributingSource.rtpTimestamp specification>
getRtpTimestamp :: (MonadDOM m, IsRTCRtpContributingSource self) => self -> m Word
getRtpTimestamp self = liftDOM ((js_getRtpTimestamp ((Types.toRTCRtpContributingSource self))))