{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.TextTrack
(addCue, removeCue, addRegion, removeRegion, getId, setKind,
getKind, getLabel, setLanguage, getLanguage,
getInBandMetadataTrackDispatchType, setMode, getMode, getCues,
getCuesUnsafe, getCuesUnchecked, getActiveCues,
getActiveCuesUnsafe, getActiveCuesUnchecked, cueChange, getRegions,
getSourceBuffer, TextTrack(..), gTypeTextTrack)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
addCue ::
(MonadDOM m, IsTextTrackCue cue) => TextTrack -> cue -> m ()
addCue self cue
= liftDOM (void (self ^. jsf "addCue" [toJSVal cue]))
removeCue ::
(MonadDOM m, IsTextTrackCue cue) => TextTrack -> cue -> m ()
removeCue self cue
= liftDOM (void (self ^. jsf "removeCue" [toJSVal cue]))
addRegion :: (MonadDOM m) => TextTrack -> Maybe VTTRegion -> m ()
addRegion self region
= liftDOM (void (self ^. jsf "addRegion" [toJSVal region]))
removeRegion ::
(MonadDOM m) => TextTrack -> Maybe VTTRegion -> m ()
removeRegion self region
= liftDOM (void (self ^. jsf "removeRegion" [toJSVal region]))
getId :: (MonadDOM m, FromJSString result) => TextTrack -> m result
getId self = liftDOM ((self ^. js "id") >>= fromJSValUnchecked)
setKind :: (MonadDOM m) => TextTrack -> TextTrackKind -> m ()
setKind self val = liftDOM (self ^. jss "kind" (toJSVal val))
getKind :: (MonadDOM m) => TextTrack -> m TextTrackKind
getKind self = liftDOM ((self ^. js "kind") >>= fromJSValUnchecked)
getLabel ::
(MonadDOM m, FromJSString result) => TextTrack -> m result
getLabel self
= liftDOM ((self ^. js "label") >>= fromJSValUnchecked)
setLanguage ::
(MonadDOM m, ToJSString val) => TextTrack -> val -> m ()
setLanguage self val
= liftDOM (self ^. jss "language" (toJSVal val))
getLanguage ::
(MonadDOM m, FromJSString result) => TextTrack -> m result
getLanguage self
= liftDOM ((self ^. js "language") >>= fromJSValUnchecked)
getInBandMetadataTrackDispatchType ::
(MonadDOM m, FromJSString result) => TextTrack -> m result
getInBandMetadataTrackDispatchType self
= liftDOM
((self ^. js "inBandMetadataTrackDispatchType") >>=
fromJSValUnchecked)
setMode :: (MonadDOM m) => TextTrack -> TextTrackMode -> m ()
setMode self val = liftDOM (self ^. jss "mode" (toJSVal val))
getMode :: (MonadDOM m) => TextTrack -> m TextTrackMode
getMode self = liftDOM ((self ^. js "mode") >>= fromJSValUnchecked)
getCues :: (MonadDOM m) => TextTrack -> m (Maybe TextTrackCueList)
getCues self = liftDOM ((self ^. js "cues") >>= fromJSVal)
getCuesUnsafe ::
(MonadDOM m, HasCallStack) => TextTrack -> m TextTrackCueList
getCuesUnsafe self
= liftDOM
(((self ^. js "cues") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getCuesUnchecked :: (MonadDOM m) => TextTrack -> m TextTrackCueList
getCuesUnchecked self
= liftDOM ((self ^. js "cues") >>= fromJSValUnchecked)
getActiveCues ::
(MonadDOM m) => TextTrack -> m (Maybe TextTrackCueList)
getActiveCues self
= liftDOM ((self ^. js "activeCues") >>= fromJSVal)
getActiveCuesUnsafe ::
(MonadDOM m, HasCallStack) => TextTrack -> m TextTrackCueList
getActiveCuesUnsafe self
= liftDOM
(((self ^. js "activeCues") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getActiveCuesUnchecked ::
(MonadDOM m) => TextTrack -> m TextTrackCueList
getActiveCuesUnchecked self
= liftDOM ((self ^. js "activeCues") >>= fromJSValUnchecked)
cueChange :: EventName TextTrack Event
cueChange = unsafeEventName (toJSString "cuechange")
getRegions :: (MonadDOM m) => TextTrack -> m VTTRegionList
getRegions self
= liftDOM ((self ^. js "regions") >>= fromJSValUnchecked)
getSourceBuffer :: (MonadDOM m) => TextTrack -> m SourceBuffer
getSourceBuffer self
= liftDOM ((self ^. js "sourceBuffer") >>= fromJSValUnchecked)