packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AudioNodeOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webaudio-1.1 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.AudioNodeOptions
       (js_newAudioNodeOptions, js_setChannelCount, js_getChannelCount, js_setChannelCountMode, js_getChannelCountMode, js_setChannelInterpretation, js_getChannelInterpretation, newAudioNodeOptions, setChannelCount, getChannelCount, getChannelCountUnsafe, getChannelCountUnchecked, setChannelCountMode, getChannelCountMode, getChannelCountModeUnsafe, getChannelCountModeUnchecked, setChannelInterpretation, getChannelInterpretation, getChannelInterpretationUnsafe, getChannelInterpretationUnchecked, AudioNodeOptions(..), gTypeAudioNodeOptions, IsAudioNodeOptions, toAudioNodeOptions)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newAudioNodeOptions :: IO AudioNodeOptions
-- | <https://webaudio.github.io/web-audio-api/#AudioNodeOptions AudioNodeOptions specification>
newAudioNodeOptions :: (MonadDOM m) => m AudioNodeOptions
newAudioNodeOptions = liftDOM ((js_newAudioNodeOptions))

foreign import javascript safe "(($1, $2) => { $1[\"channelCount\"] = $2; })"
        js_setChannelCount :: AudioNodeOptions -> Word -> IO ()
-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcount AudioNodeOptions.channelCount specification>
setChannelCount :: (MonadDOM m, IsAudioNodeOptions self) => self -> Word -> m ()
setChannelCount self val = liftDOM (void ((js_setChannelCount ((Types.toAudioNodeOptions self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"channelCount\"]; })"
        js_getChannelCount :: AudioNodeOptions -> IO JSVal
-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcount AudioNodeOptions.channelCount specification>
getChannelCount :: (MonadDOM m, IsAudioNodeOptions self) => self -> m (Maybe Word)
getChannelCount self = liftDOM (((js_getChannelCount ((Types.toAudioNodeOptions self))) >>= fromJSValUnchecked))

-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcount AudioNodeOptions.channelCount specification>
getChannelCountUnsafe :: (MonadDOM m, IsAudioNodeOptions self, HasCallStack) => self -> m Word
getChannelCountUnsafe self = liftDOM ((((js_getChannelCount ((Types.toAudioNodeOptions self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcount AudioNodeOptions.channelCount specification>
getChannelCountUnchecked :: (MonadDOM m, IsAudioNodeOptions self) => self -> m Word
getChannelCountUnchecked self = liftDOM ((pFromJSVal <$> (js_getChannelCount ((Types.toAudioNodeOptions self)))))

foreign import javascript safe "(($1, $2) => { $1[\"channelCountMode\"] = $2; })"
        js_setChannelCountMode :: AudioNodeOptions -> JSVal -> IO ()
-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcountmode AudioNodeOptions.channelCountMode specification>
setChannelCountMode :: (MonadDOM m, IsAudioNodeOptions self) => self -> ChannelCountMode -> m ()
setChannelCountMode self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setChannelCountMode ((Types.toAudioNodeOptions self)) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"channelCountMode\"]; })"
        js_getChannelCountMode :: AudioNodeOptions -> IO JSVal
-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcountmode AudioNodeOptions.channelCountMode specification>
getChannelCountMode :: (MonadDOM m, IsAudioNodeOptions self) => self -> m (Maybe ChannelCountMode)
getChannelCountMode self = liftDOM (((js_getChannelCountMode ((Types.toAudioNodeOptions self))) >>= fromJSValUnchecked))

-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcountmode AudioNodeOptions.channelCountMode specification>
getChannelCountModeUnsafe :: (MonadDOM m, IsAudioNodeOptions self, HasCallStack) => self -> m ChannelCountMode
getChannelCountModeUnsafe self = liftDOM ((((js_getChannelCountMode ((Types.toAudioNodeOptions self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelcountmode AudioNodeOptions.channelCountMode specification>
getChannelCountModeUnchecked :: (MonadDOM m, IsAudioNodeOptions self) => self -> m ChannelCountMode
getChannelCountModeUnchecked self = liftDOM ((pFromJSVal <$> (js_getChannelCountMode ((Types.toAudioNodeOptions self)))))

foreign import javascript safe "(($1, $2) => { $1[\"channelInterpretation\"] = $2; })"
        js_setChannelInterpretation :: AudioNodeOptions -> JSVal -> IO ()
-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelinterpretation AudioNodeOptions.channelInterpretation specification>
setChannelInterpretation :: (MonadDOM m, IsAudioNodeOptions self) => self -> ChannelInterpretation -> m ()
setChannelInterpretation self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setChannelInterpretation ((Types.toAudioNodeOptions self)) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"channelInterpretation\"]; })"
        js_getChannelInterpretation :: AudioNodeOptions -> IO JSVal
-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelinterpretation AudioNodeOptions.channelInterpretation specification>
getChannelInterpretation :: (MonadDOM m, IsAudioNodeOptions self) => self -> m (Maybe ChannelInterpretation)
getChannelInterpretation self = liftDOM (((js_getChannelInterpretation ((Types.toAudioNodeOptions self))) >>= fromJSValUnchecked))

-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelinterpretation AudioNodeOptions.channelInterpretation specification>
getChannelInterpretationUnsafe :: (MonadDOM m, IsAudioNodeOptions self, HasCallStack) => self -> m ChannelInterpretation
getChannelInterpretationUnsafe self = liftDOM ((((js_getChannelInterpretation ((Types.toAudioNodeOptions self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-audio-api/#dom-audionodeoptions-channelinterpretation AudioNodeOptions.channelInterpretation specification>
getChannelInterpretationUnchecked :: (MonadDOM m, IsAudioNodeOptions self) => self -> m ChannelInterpretation
getChannelInterpretationUnchecked self = liftDOM ((pFromJSVal <$> (js_getChannelInterpretation ((Types.toAudioNodeOptions self)))))