jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PannerOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webaudio-1.1 (webref). Do not edit.
module JSDOM.Generated.PannerOptions
(newPannerOptions, setPanningModel, getPanningModel, getPanningModelUnsafe, getPanningModelUnchecked, setDistanceModel, getDistanceModel, getDistanceModelUnsafe, getDistanceModelUnchecked, setPositionX, getPositionX, getPositionXUnsafe, getPositionXUnchecked, setPositionY, getPositionY, getPositionYUnsafe, getPositionYUnchecked, setPositionZ, getPositionZ, getPositionZUnsafe, getPositionZUnchecked, setOrientationX, getOrientationX, getOrientationXUnsafe, getOrientationXUnchecked, setOrientationY, getOrientationY, getOrientationYUnsafe, getOrientationYUnchecked, setOrientationZ, getOrientationZ, getOrientationZUnsafe, getOrientationZUnchecked, setRefDistance, getRefDistance, getRefDistanceUnsafe, getRefDistanceUnchecked, setMaxDistance, getMaxDistance, getMaxDistanceUnsafe, getMaxDistanceUnchecked, setRolloffFactor, getRolloffFactor, getRolloffFactorUnsafe, getRolloffFactorUnchecked, setConeInnerAngle, getConeInnerAngle, getConeInnerAngleUnsafe, getConeInnerAngleUnchecked, setConeOuterAngle, getConeOuterAngle, getConeOuterAngleUnsafe, getConeOuterAngleUnchecked, setConeOuterGain, getConeOuterGain, getConeOuterGainUnsafe, getConeOuterGainUnchecked, PannerOptions(..), gTypePannerOptions)
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://webaudio.github.io/web-audio-api/#PannerOptions PannerOptions specification>
newPannerOptions :: (MonadDOM m) => m PannerOptions
newPannerOptions = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-panningmodel PannerOptions.panningModel specification>
setPanningModel :: (MonadDOM m) => PannerOptions -> PanningModelType -> m ()
setPanningModel self val = liftDOM (void (self ^. jss "panningModel" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-panningmodel PannerOptions.panningModel specification>
getPanningModel :: (MonadDOM m) => PannerOptions -> m (Maybe PanningModelType)
getPanningModel self = liftDOM (((self ^. js "panningModel") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-panningmodel PannerOptions.panningModel specification>
getPanningModelUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m PanningModelType
getPanningModelUnsafe self = liftDOM ((((self ^. js "panningModel") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-panningmodel PannerOptions.panningModel specification>
getPanningModelUnchecked :: (MonadDOM m) => PannerOptions -> m PanningModelType
getPanningModelUnchecked self = liftDOM (((self ^. js "panningModel") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-distancemodel PannerOptions.distanceModel specification>
setDistanceModel :: (MonadDOM m) => PannerOptions -> DistanceModelType -> m ()
setDistanceModel self val = liftDOM (void (self ^. jss "distanceModel" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-distancemodel PannerOptions.distanceModel specification>
getDistanceModel :: (MonadDOM m) => PannerOptions -> m (Maybe DistanceModelType)
getDistanceModel self = liftDOM (((self ^. js "distanceModel") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-distancemodel PannerOptions.distanceModel specification>
getDistanceModelUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m DistanceModelType
getDistanceModelUnsafe self = liftDOM ((((self ^. js "distanceModel") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-distancemodel PannerOptions.distanceModel specification>
getDistanceModelUnchecked :: (MonadDOM m) => PannerOptions -> m DistanceModelType
getDistanceModelUnchecked self = liftDOM (((self ^. js "distanceModel") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionx PannerOptions.positionX specification>
setPositionX :: (MonadDOM m) => PannerOptions -> Float -> m ()
setPositionX self val = liftDOM (void (self ^. jss "positionX" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionx PannerOptions.positionX specification>
getPositionX :: (MonadDOM m) => PannerOptions -> m (Maybe Float)
getPositionX self = liftDOM (((self ^. js "positionX") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionx PannerOptions.positionX specification>
getPositionXUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Float
getPositionXUnsafe self = liftDOM ((((self ^. js "positionX") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionx PannerOptions.positionX specification>
getPositionXUnchecked :: (MonadDOM m) => PannerOptions -> m Float
getPositionXUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "positionX") >>= valToNumber)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positiony PannerOptions.positionY specification>
setPositionY :: (MonadDOM m) => PannerOptions -> Float -> m ()
setPositionY self val = liftDOM (void (self ^. jss "positionY" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positiony PannerOptions.positionY specification>
getPositionY :: (MonadDOM m) => PannerOptions -> m (Maybe Float)
getPositionY self = liftDOM (((self ^. js "positionY") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positiony PannerOptions.positionY specification>
getPositionYUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Float
getPositionYUnsafe self = liftDOM ((((self ^. js "positionY") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positiony PannerOptions.positionY specification>
getPositionYUnchecked :: (MonadDOM m) => PannerOptions -> m Float
getPositionYUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "positionY") >>= valToNumber)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionz PannerOptions.positionZ specification>
setPositionZ :: (MonadDOM m) => PannerOptions -> Float -> m ()
setPositionZ self val = liftDOM (void (self ^. jss "positionZ" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionz PannerOptions.positionZ specification>
getPositionZ :: (MonadDOM m) => PannerOptions -> m (Maybe Float)
getPositionZ self = liftDOM (((self ^. js "positionZ") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionz PannerOptions.positionZ specification>
getPositionZUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Float
getPositionZUnsafe self = liftDOM ((((self ^. js "positionZ") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-positionz PannerOptions.positionZ specification>
getPositionZUnchecked :: (MonadDOM m) => PannerOptions -> m Float
getPositionZUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "positionZ") >>= valToNumber)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationx PannerOptions.orientationX specification>
setOrientationX :: (MonadDOM m) => PannerOptions -> Float -> m ()
setOrientationX self val = liftDOM (void (self ^. jss "orientationX" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationx PannerOptions.orientationX specification>
getOrientationX :: (MonadDOM m) => PannerOptions -> m (Maybe Float)
getOrientationX self = liftDOM (((self ^. js "orientationX") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationx PannerOptions.orientationX specification>
getOrientationXUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Float
getOrientationXUnsafe self = liftDOM ((((self ^. js "orientationX") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationx PannerOptions.orientationX specification>
getOrientationXUnchecked :: (MonadDOM m) => PannerOptions -> m Float
getOrientationXUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "orientationX") >>= valToNumber)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationy PannerOptions.orientationY specification>
setOrientationY :: (MonadDOM m) => PannerOptions -> Float -> m ()
setOrientationY self val = liftDOM (void (self ^. jss "orientationY" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationy PannerOptions.orientationY specification>
getOrientationY :: (MonadDOM m) => PannerOptions -> m (Maybe Float)
getOrientationY self = liftDOM (((self ^. js "orientationY") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationy PannerOptions.orientationY specification>
getOrientationYUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Float
getOrientationYUnsafe self = liftDOM ((((self ^. js "orientationY") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationy PannerOptions.orientationY specification>
getOrientationYUnchecked :: (MonadDOM m) => PannerOptions -> m Float
getOrientationYUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "orientationY") >>= valToNumber)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationz PannerOptions.orientationZ specification>
setOrientationZ :: (MonadDOM m) => PannerOptions -> Float -> m ()
setOrientationZ self val = liftDOM (void (self ^. jss "orientationZ" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationz PannerOptions.orientationZ specification>
getOrientationZ :: (MonadDOM m) => PannerOptions -> m (Maybe Float)
getOrientationZ self = liftDOM (((self ^. js "orientationZ") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationz PannerOptions.orientationZ specification>
getOrientationZUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Float
getOrientationZUnsafe self = liftDOM ((((self ^. js "orientationZ") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-orientationz PannerOptions.orientationZ specification>
getOrientationZUnchecked :: (MonadDOM m) => PannerOptions -> m Float
getOrientationZUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "orientationZ") >>= valToNumber)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-refdistance PannerOptions.refDistance specification>
setRefDistance :: (MonadDOM m) => PannerOptions -> Double -> m ()
setRefDistance self val = liftDOM (void (self ^. jss "refDistance" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-refdistance PannerOptions.refDistance specification>
getRefDistance :: (MonadDOM m) => PannerOptions -> m (Maybe Double)
getRefDistance self = liftDOM (((self ^. js "refDistance") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-refdistance PannerOptions.refDistance specification>
getRefDistanceUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Double
getRefDistanceUnsafe self = liftDOM ((((self ^. js "refDistance") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-refdistance PannerOptions.refDistance specification>
getRefDistanceUnchecked :: (MonadDOM m) => PannerOptions -> m Double
getRefDistanceUnchecked self = liftDOM (((self ^. js "refDistance") >>= valToNumber))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-maxdistance PannerOptions.maxDistance specification>
setMaxDistance :: (MonadDOM m) => PannerOptions -> Double -> m ()
setMaxDistance self val = liftDOM (void (self ^. jss "maxDistance" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-maxdistance PannerOptions.maxDistance specification>
getMaxDistance :: (MonadDOM m) => PannerOptions -> m (Maybe Double)
getMaxDistance self = liftDOM (((self ^. js "maxDistance") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-maxdistance PannerOptions.maxDistance specification>
getMaxDistanceUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Double
getMaxDistanceUnsafe self = liftDOM ((((self ^. js "maxDistance") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-maxdistance PannerOptions.maxDistance specification>
getMaxDistanceUnchecked :: (MonadDOM m) => PannerOptions -> m Double
getMaxDistanceUnchecked self = liftDOM (((self ^. js "maxDistance") >>= valToNumber))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-rollofffactor PannerOptions.rolloffFactor specification>
setRolloffFactor :: (MonadDOM m) => PannerOptions -> Double -> m ()
setRolloffFactor self val = liftDOM (void (self ^. jss "rolloffFactor" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-rollofffactor PannerOptions.rolloffFactor specification>
getRolloffFactor :: (MonadDOM m) => PannerOptions -> m (Maybe Double)
getRolloffFactor self = liftDOM (((self ^. js "rolloffFactor") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-rollofffactor PannerOptions.rolloffFactor specification>
getRolloffFactorUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Double
getRolloffFactorUnsafe self = liftDOM ((((self ^. js "rolloffFactor") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-rollofffactor PannerOptions.rolloffFactor specification>
getRolloffFactorUnchecked :: (MonadDOM m) => PannerOptions -> m Double
getRolloffFactorUnchecked self = liftDOM (((self ^. js "rolloffFactor") >>= valToNumber))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneinnerangle PannerOptions.coneInnerAngle specification>
setConeInnerAngle :: (MonadDOM m) => PannerOptions -> Double -> m ()
setConeInnerAngle self val = liftDOM (void (self ^. jss "coneInnerAngle" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneinnerangle PannerOptions.coneInnerAngle specification>
getConeInnerAngle :: (MonadDOM m) => PannerOptions -> m (Maybe Double)
getConeInnerAngle self = liftDOM (((self ^. js "coneInnerAngle") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneinnerangle PannerOptions.coneInnerAngle specification>
getConeInnerAngleUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Double
getConeInnerAngleUnsafe self = liftDOM ((((self ^. js "coneInnerAngle") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneinnerangle PannerOptions.coneInnerAngle specification>
getConeInnerAngleUnchecked :: (MonadDOM m) => PannerOptions -> m Double
getConeInnerAngleUnchecked self = liftDOM (((self ^. js "coneInnerAngle") >>= valToNumber))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneouterangle PannerOptions.coneOuterAngle specification>
setConeOuterAngle :: (MonadDOM m) => PannerOptions -> Double -> m ()
setConeOuterAngle self val = liftDOM (void (self ^. jss "coneOuterAngle" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneouterangle PannerOptions.coneOuterAngle specification>
getConeOuterAngle :: (MonadDOM m) => PannerOptions -> m (Maybe Double)
getConeOuterAngle self = liftDOM (((self ^. js "coneOuterAngle") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneouterangle PannerOptions.coneOuterAngle specification>
getConeOuterAngleUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Double
getConeOuterAngleUnsafe self = liftDOM ((((self ^. js "coneOuterAngle") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneouterangle PannerOptions.coneOuterAngle specification>
getConeOuterAngleUnchecked :: (MonadDOM m) => PannerOptions -> m Double
getConeOuterAngleUnchecked self = liftDOM (((self ^. js "coneOuterAngle") >>= valToNumber))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneoutergain PannerOptions.coneOuterGain specification>
setConeOuterGain :: (MonadDOM m) => PannerOptions -> Double -> m ()
setConeOuterGain self val = liftDOM (void (self ^. jss "coneOuterGain" (toJSVal val)))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneoutergain PannerOptions.coneOuterGain specification>
getConeOuterGain :: (MonadDOM m) => PannerOptions -> m (Maybe Double)
getConeOuterGain self = liftDOM (((self ^. js "coneOuterGain") >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneoutergain PannerOptions.coneOuterGain specification>
getConeOuterGainUnsafe :: (MonadDOM m, HasCallStack) => PannerOptions -> m Double
getConeOuterGainUnsafe self = liftDOM ((((self ^. js "coneOuterGain") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://webaudio.github.io/web-audio-api/#dom-panneroptions-coneoutergain PannerOptions.coneOuterGain specification>
getConeOuterGainUnchecked :: (MonadDOM m) => PannerOptions -> m Double
getConeOuterGainUnchecked self = liftDOM (((self ^. js "coneOuterGain") >>= valToNumber))