{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.AudioNode
(connect, connectParam, disconnect, getContext, getNumberOfInputs,
getNumberOfOutputs, setChannelCount, getChannelCount,
setChannelCountMode, getChannelCountMode, setChannelInterpretation,
getChannelInterpretation, AudioNode(..), gTypeAudioNode,
IsAudioNode, toAudioNode)
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
connect ::
(MonadDOM m, IsAudioNode self, IsAudioNode destination) =>
self -> destination -> Maybe Word -> Maybe Word -> m ()
connect self destination output input
= liftDOM
(void
((toAudioNode self) ^. jsf "connect"
[toJSVal destination, toJSVal output, toJSVal input]))
connectParam ::
(MonadDOM m, IsAudioNode self) =>
self -> AudioParam -> Maybe Word -> m ()
connectParam self destination output
= liftDOM
(void
((toAudioNode self) ^. jsf "connect"
[toJSVal destination, toJSVal output]))
disconnect ::
(MonadDOM m, IsAudioNode self) => self -> Maybe Word -> m ()
disconnect self output
= liftDOM
(void ((toAudioNode self) ^. jsf "disconnect" [toJSVal output]))
getContext ::
(MonadDOM m, IsAudioNode self) => self -> m AudioContext
getContext self
= liftDOM
(((toAudioNode self) ^. js "context") >>= fromJSValUnchecked)
getNumberOfInputs ::
(MonadDOM m, IsAudioNode self) => self -> m Word
getNumberOfInputs self
= liftDOM
(round <$>
(((toAudioNode self) ^. js "numberOfInputs") >>= valToNumber))
getNumberOfOutputs ::
(MonadDOM m, IsAudioNode self) => self -> m Word
getNumberOfOutputs self
= liftDOM
(round <$>
(((toAudioNode self) ^. js "numberOfOutputs") >>= valToNumber))
setChannelCount ::
(MonadDOM m, IsAudioNode self) => self -> Word -> m ()
setChannelCount self val
= liftDOM ((toAudioNode self) ^. jss "channelCount" (toJSVal val))
getChannelCount :: (MonadDOM m, IsAudioNode self) => self -> m Word
getChannelCount self
= liftDOM
(round <$>
(((toAudioNode self) ^. js "channelCount") >>= valToNumber))
setChannelCountMode ::
(MonadDOM m, IsAudioNode self, ToJSString val) =>
self -> val -> m ()
setChannelCountMode self val
= liftDOM
((toAudioNode self) ^. jss "channelCountMode" (toJSVal val))
getChannelCountMode ::
(MonadDOM m, IsAudioNode self, FromJSString result) =>
self -> m result
getChannelCountMode self
= liftDOM
(((toAudioNode self) ^. js "channelCountMode") >>=
fromJSValUnchecked)
setChannelInterpretation ::
(MonadDOM m, IsAudioNode self, ToJSString val) =>
self -> val -> m ()
setChannelInterpretation self val
= liftDOM
((toAudioNode self) ^. jss "channelInterpretation" (toJSVal val))
getChannelInterpretation ::
(MonadDOM m, IsAudioNode self, FromJSString result) =>
self -> m result
getChannelInterpretation self
= liftDOM
(((toAudioNode self) ^. js "channelInterpretation") >>=
fromJSValUnchecked)