{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.RTCDTMFSender
(insertDTMF, toneChange, getToneBuffer, getCanInsertDTMF, getTrack,
getDuration, getInterToneGap, RTCDTMFSender(..),
gTypeRTCDTMFSender)
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
insertDTMF ::
(MonadDOM m, ToJSString tones) =>
RTCDTMFSender -> tones -> Maybe Int -> Maybe Int -> m ()
insertDTMF self tones duration interToneGap
= liftDOM
(void
(self ^. jsf "insertDTMF"
[toJSVal tones, toJSVal duration, toJSVal interToneGap]))
toneChange :: EventName RTCDTMFSender Event
toneChange = unsafeEventName (toJSString "tonechange")
getToneBuffer ::
(MonadDOM m, FromJSString result) => RTCDTMFSender -> m result
getToneBuffer self
= liftDOM ((self ^. js "toneBuffer") >>= fromJSValUnchecked)
getCanInsertDTMF :: (MonadDOM m) => RTCDTMFSender -> m Bool
getCanInsertDTMF self
= liftDOM ((self ^. js "canInsertDTMF") >>= valToBool)
getTrack :: (MonadDOM m) => RTCDTMFSender -> m MediaStreamTrack
getTrack self
= liftDOM ((self ^. js "track") >>= fromJSValUnchecked)
getDuration :: (MonadDOM m) => RTCDTMFSender -> m Int
getDuration self
= liftDOM (round <$> ((self ^. js "duration") >>= valToNumber))
getInterToneGap :: (MonadDOM m) => RTCDTMFSender -> m Int
getInterToneGap self
= liftDOM (round <$> ((self ^. js "interToneGap") >>= valToNumber))