packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/VideoFrameCallbackMetadata.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from video-rvfc (webref). Do not edit.
module JSDOM.Generated.VideoFrameCallbackMetadata
       (newVideoFrameCallbackMetadata, setPresentationTime, getPresentationTime, setExpectedDisplayTime, getExpectedDisplayTime, setWidth, getWidth, setHeight, getHeight, setMediaTime, getMediaTime, setPresentedFrames, getPresentedFrames, setProcessingDuration, getProcessingDuration, getProcessingDurationUnsafe, getProcessingDurationUnchecked, setCaptureTime, getCaptureTime, getCaptureTimeUnsafe, getCaptureTimeUnchecked, setReceiveTime, getReceiveTime, getReceiveTimeUnsafe, getReceiveTimeUnchecked, setRtpTimestamp, getRtpTimestamp, getRtpTimestampUnsafe, getRtpTimestampUnchecked, VideoFrameCallbackMetadata(..), gTypeVideoFrameCallbackMetadata)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://wicg.github.io/video-rvfc/#dictdef-videoframecallbackmetadata VideoFrameCallbackMetadata specification>
newVideoFrameCallbackMetadata :: (MonadDOM m) => Double -> Double -> Word -> Word -> Double -> Word -> m VideoFrameCallbackMetadata
newVideoFrameCallbackMetadata presentationTime expectedDisplayTime width height mediaTime presentedFrames = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "presentationTime" (toJSVal presentationTime)) P.>> (o ^. jss "expectedDisplayTime" (toJSVal expectedDisplayTime)) P.>> (o ^. jss "width" (toJSVal width)) P.>> (o ^. jss "height" (toJSVal height)) P.>> (o ^. jss "mediaTime" (toJSVal mediaTime)) P.>> (o ^. jss "presentedFrames" (toJSVal presentedFrames)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-presentationtime VideoFrameCallbackMetadata.presentationTime specification>
setPresentationTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> Double -> m ()
setPresentationTime self val = liftDOM (void (self ^. jss "presentationTime" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-presentationtime VideoFrameCallbackMetadata.presentationTime specification>
getPresentationTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Double
getPresentationTime self = liftDOM (((self ^. js "presentationTime") >>= valToNumber))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-expecteddisplaytime VideoFrameCallbackMetadata.expectedDisplayTime specification>
setExpectedDisplayTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> Double -> m ()
setExpectedDisplayTime self val = liftDOM (void (self ^. jss "expectedDisplayTime" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-expecteddisplaytime VideoFrameCallbackMetadata.expectedDisplayTime specification>
getExpectedDisplayTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Double
getExpectedDisplayTime self = liftDOM (((self ^. js "expectedDisplayTime") >>= valToNumber))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-width VideoFrameCallbackMetadata.width specification>
setWidth :: (MonadDOM m) => VideoFrameCallbackMetadata -> Word -> m ()
setWidth self val = liftDOM (void (self ^. jss "width" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-width VideoFrameCallbackMetadata.width specification>
getWidth :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Word
getWidth self = liftDOM ((P.round <$> ((self ^. js "width") >>= valToNumber)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-height VideoFrameCallbackMetadata.height specification>
setHeight :: (MonadDOM m) => VideoFrameCallbackMetadata -> Word -> m ()
setHeight self val = liftDOM (void (self ^. jss "height" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-height VideoFrameCallbackMetadata.height specification>
getHeight :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Word
getHeight self = liftDOM ((P.round <$> ((self ^. js "height") >>= valToNumber)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-mediatime VideoFrameCallbackMetadata.mediaTime specification>
setMediaTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> Double -> m ()
setMediaTime self val = liftDOM (void (self ^. jss "mediaTime" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-mediatime VideoFrameCallbackMetadata.mediaTime specification>
getMediaTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Double
getMediaTime self = liftDOM (((self ^. js "mediaTime") >>= valToNumber))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-presentedframes VideoFrameCallbackMetadata.presentedFrames specification>
setPresentedFrames :: (MonadDOM m) => VideoFrameCallbackMetadata -> Word -> m ()
setPresentedFrames self val = liftDOM (void (self ^. jss "presentedFrames" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-presentedframes VideoFrameCallbackMetadata.presentedFrames specification>
getPresentedFrames :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Word
getPresentedFrames self = liftDOM ((P.round <$> ((self ^. js "presentedFrames") >>= valToNumber)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-processingduration VideoFrameCallbackMetadata.processingDuration specification>
setProcessingDuration :: (MonadDOM m) => VideoFrameCallbackMetadata -> Double -> m ()
setProcessingDuration self val = liftDOM (void (self ^. jss "processingDuration" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-processingduration VideoFrameCallbackMetadata.processingDuration specification>
getProcessingDuration :: (MonadDOM m) => VideoFrameCallbackMetadata -> m (Maybe Double)
getProcessingDuration self = liftDOM (((self ^. js "processingDuration") >>= fromJSValUnchecked))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-processingduration VideoFrameCallbackMetadata.processingDuration specification>
getProcessingDurationUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCallbackMetadata -> m Double
getProcessingDurationUnsafe self = liftDOM ((((self ^. js "processingDuration") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-processingduration VideoFrameCallbackMetadata.processingDuration specification>
getProcessingDurationUnchecked :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Double
getProcessingDurationUnchecked self = liftDOM (((self ^. js "processingDuration") >>= valToNumber))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-capturetime VideoFrameCallbackMetadata.captureTime specification>
setCaptureTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> Double -> m ()
setCaptureTime self val = liftDOM (void (self ^. jss "captureTime" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-capturetime VideoFrameCallbackMetadata.captureTime specification>
getCaptureTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> m (Maybe Double)
getCaptureTime self = liftDOM (((self ^. js "captureTime") >>= fromJSValUnchecked))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-capturetime VideoFrameCallbackMetadata.captureTime specification>
getCaptureTimeUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCallbackMetadata -> m Double
getCaptureTimeUnsafe self = liftDOM ((((self ^. js "captureTime") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-capturetime VideoFrameCallbackMetadata.captureTime specification>
getCaptureTimeUnchecked :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Double
getCaptureTimeUnchecked self = liftDOM (((self ^. js "captureTime") >>= valToNumber))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-receivetime VideoFrameCallbackMetadata.receiveTime specification>
setReceiveTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> Double -> m ()
setReceiveTime self val = liftDOM (void (self ^. jss "receiveTime" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-receivetime VideoFrameCallbackMetadata.receiveTime specification>
getReceiveTime :: (MonadDOM m) => VideoFrameCallbackMetadata -> m (Maybe Double)
getReceiveTime self = liftDOM (((self ^. js "receiveTime") >>= fromJSValUnchecked))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-receivetime VideoFrameCallbackMetadata.receiveTime specification>
getReceiveTimeUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCallbackMetadata -> m Double
getReceiveTimeUnsafe self = liftDOM ((((self ^. js "receiveTime") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-receivetime VideoFrameCallbackMetadata.receiveTime specification>
getReceiveTimeUnchecked :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Double
getReceiveTimeUnchecked self = liftDOM (((self ^. js "receiveTime") >>= valToNumber))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-rtptimestamp VideoFrameCallbackMetadata.rtpTimestamp specification>
setRtpTimestamp :: (MonadDOM m) => VideoFrameCallbackMetadata -> Word -> m ()
setRtpTimestamp self val = liftDOM (void (self ^. jss "rtpTimestamp" (toJSVal val)))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-rtptimestamp VideoFrameCallbackMetadata.rtpTimestamp specification>
getRtpTimestamp :: (MonadDOM m) => VideoFrameCallbackMetadata -> m (Maybe Word)
getRtpTimestamp self = liftDOM (((self ^. js "rtpTimestamp") >>= fromJSValUnchecked))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-rtptimestamp VideoFrameCallbackMetadata.rtpTimestamp specification>
getRtpTimestampUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCallbackMetadata -> m Word
getRtpTimestampUnsafe self = liftDOM ((((self ^. js "rtpTimestamp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://wicg.github.io/video-rvfc/#dom-videoframecallbackmetadata-rtptimestamp VideoFrameCallbackMetadata.rtpTimestamp specification>
getRtpTimestampUnchecked :: (MonadDOM m) => VideoFrameCallbackMetadata -> m Word
getRtpTimestampUnchecked self = liftDOM ((P.round <$> ((self ^. js "rtpTimestamp") >>= valToNumber)))