packages feed

al (empty) → 0.1.0.0

raw patch · 22 files changed

+694/−0 lines, 22 filesdep +basesetup-changed

Dependencies added: base

Files

+ CHANGELOG.md view
@@ -0,0 +1,3 @@+## 0.1++- Initial release.
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2015, Dimitri Sabadie <dimitri.sabadie@gmail.com>
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Dimitri Sabadie <dimitri.sabadie@gmail.com> nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple
+main = defaultMain
+ al.cabal view
@@ -0,0 +1,74 @@+name:                al
+version:             0.1.0.0
+synopsis:            OpenAL 1.1 raw API.
+description:         __OpenAL__ is a minimalistic sound API that aims to provide
+                     bare features for /spacialized audio/. The API looks like
+                     the *OpenGL* one, thus the libs are pretty great together.
+
+                     Up to now, no OpenAL extension is supported. You're highly
+                     invited to contribute ;).
+
+                     __EAX__ is not supported yet eiher. It'll be embedded in
+                     future releases, soon.
+
+                     __IMPORTANT__: In order to build and install "al", you'll
+                     need to pass the path of the /include/ and /libs/ directory
+                     of your OpenAL installation.
+
+                     Then use this to install:
+
+                     @ cabal install --extra-include-dirs=path_to_include --extr-lib-dirs=path_to_libs @
+license:             BSD3
+license-file:        LICENSE
+author:              Dimitri Sabadie <dimitri.sabadie@gmail.com>
+maintainer:          Dimitri Sabadie <dimitri.sabadie@gmail.com>
+copyright:           Dimitri Sabadie
+
+category:            Sound
+build-type:          Simple
+stability:           experimental
+
+extra-source-files:  CHANGELOG.md
+
+cabal-version:       >= 1.10
+
+library
+  ghc-options:         -W -Wall -O2
+
+  if os(windows)
+    if arch(i386)
+      cpp-options:     -DCALLCV=stdcall
+    else
+      cpp-options:     -DCALLCV=ccall
+  else
+    cpp-options:       -DCALLCV=ccall
+
+  build-tools:         c2hs >= 0.23 && < 0.24
+
+  exposed-modules:     Sound.AL
+                     , Sound.AL.Buffer
+                     , Sound.AL.Defines
+                     , Sound.AL.EAX
+                     , Sound.AL.Errors
+                     , Sound.AL.Extensions
+                     , Sound.AL.Listener
+                     , Sound.AL.Source
+                     , Sound.AL.State
+                     , Sound.AL.Types
+                     , Sound.ALC
+                     , Sound.ALC.Context
+                     , Sound.ALC.Defines
+                     , Sound.ALC.Device
+                     , Sound.ALC.Errors
+                     , Sound.ALC.Extensions
+                     , Sound.ALC.State
+                     , Sound.ALC.Types
+
+  default-extensions:  CPP
+                     , ForeignFunctionInterface
+
+  build-depends:       base >= 4.7 && < 4.8
+
+  hs-source-dirs:      src
+
+  default-language:    Haskell2010
+ src/Sound/AL.hs view
@@ -0,0 +1,31 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL (+    module Sound.AL.Buffer+  , module Sound.AL.Defines+  , module Sound.AL.EAX+  , module Sound.AL.Errors+  , module Sound.AL.Extensions+  , module Sound.AL.Listener+  , module Sound.AL.Source+  , module Sound.AL.State+  , module Sound.AL.Types+  ) where++import Sound.AL.Buffer+import Sound.AL.Defines+import Sound.AL.EAX+import Sound.AL.Errors+import Sound.AL.Extensions+import Sound.AL.Listener+import Sound.AL.Source+import Sound.AL.State+import Sound.AL.Types
+ src/Sound/AL/Buffer.chs view
@@ -0,0 +1,24 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Buffer where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types++#include <al.h>++foreign import CALLCV "alGenBuffers" alGenBuffers :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alDeleteBuffers" alDeleteBuffers :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alIsBuffer" alIsBuffer :: ALuint -> IO ALboolean+foreign import CALLCV "alBufferData" alBufferData :: ALuint -> ALenum -> Ptr a -> ALsizei -> ALsizei -> IO ()+foreign import CALLCV "alGetBufferf" alGetBufferf :: ALuint -> ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetBufferi" alGetBufferi :: ALuint -> ALenum -> Ptr ALint -> IO ()
+ src/Sound/AL/Defines.chs view
@@ -0,0 +1,165 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Defines where++import Sound.AL.Types++#include <al.h>++al_BITS :: ALenum+al_BITS = {#const AL_BITS #}++al_BUFFER :: ALenum+al_BUFFER = {#const AL_BUFFER #}++al_BUFFERS_PROCESSED :: ALenum+al_BUFFERS_PROCESSED = {#const AL_BUFFERS_PROCESSED #}++al_BUFFERS_QUEUED :: ALenum+al_BUFFERS_QUEUED = {#const AL_BUFFERS_QUEUED #}++al_CHANNELS :: ALenum+al_CHANNELS = {#const AL_CHANNELS #}++al_CONE_INNER_ANGLE :: ALenum+al_CONE_INNER_ANGLE = {#const AL_CONE_INNER_ANGLE #}++al_CONE_OUTER_ANGLE :: ALenum+al_CONE_OUTER_ANGLE = {#const AL_CONE_OUTER_ANGLE #}++al_CONE_OUTER_GAIN :: ALenum+al_CONE_OUTER_GAIN = {#const AL_CONE_OUTER_GAIN #}++al_DISTANCE_MODEL :: ALenum+al_DISTANCE_MODEL = {#const AL_DISTANCE_MODEL #}++al_DOPPLER_FACTOR :: ALenum+al_DOPPLER_FACTOR = {#const AL_DOPPLER_FACTOR #}++al_DOPPLER_VELOCITY :: ALenum+al_DOPPLER_VELOCITY = {#const AL_DOPPLER_VELOCITY #}++al_DIRECTION :: ALenum+al_DIRECTION = {#const AL_DIRECTION #}++al_EXTENSIONS :: ALenum+al_EXTENSIONS = {#const AL_EXTENSIONS #}++al_FALSE :: ALenum+al_FALSE = {#const AL_FALSE #}++al_FORMAT_MONO8 :: ALenum+al_FORMAT_MONO8 = {#const AL_FORMAT_MONO8 #}++al_FORMAT_MONO16 :: ALenum+al_FORMAT_MONO16 = {#const AL_FORMAT_MONO16 #}++al_FORMAT_STEREO8 :: ALenum+al_FORMAT_STEREO8 = {#const AL_FORMAT_STEREO8 #}++al_FORMAT_STEREO16 :: ALenum+al_FORMAT_STEREO16 = {#const AL_FORMAT_STEREO16 #}++al_FREQUENCY :: ALenum+al_FREQUENCY = {#const AL_FREQUENCY #}++al_GAIN :: ALenum+al_GAIN = {#const AL_GAIN #}++al_INITIAL :: ALenum+al_INITIAL = {#const AL_INITIAL #}++al_INVALID_ENUM :: ALenum+al_INVALID_ENUM = {#const AL_INVALID_ENUM #}++al_INVALID_NAME :: ALenum+al_INVALID_NAME = {#const AL_INVALID_NAME #}++al_INVALID_OPERATION :: ALenum+al_INVALID_OPERATION = {#const AL_INVALID_OPERATION #}++al_INVALID_VALUE :: ALenum+al_INVALID_VALUE = {#const AL_INVALID_VALUE #}++al_INVERSE_DISTANCE :: ALenum+al_INVERSE_DISTANCE = {#const AL_INVERSE_DISTANCE #}++al_INVERSE_DISTANCE_CLAMPED :: ALenum+al_INVERSE_DISTANCE_CLAMPED = {#const AL_INVERSE_DISTANCE_CLAMPED #}++al_LOOPING :: ALenum+al_LOOPING = {#const AL_LOOPING #}++al_MAX_DISTANCE :: ALenum+al_MAX_DISTANCE = {#const AL_MAX_DISTANCE #}++al_MAX_GAIN :: ALenum+al_MAX_GAIN = {#const AL_MAX_GAIN #}++al_MIN_GAIN :: ALenum+al_MIN_GAIN = {#const AL_MIN_GAIN #}++al_NONE :: ALenum+al_NONE = {#const AL_NONE #}++al_NO_ERROR :: ALenum+al_NO_ERROR = {#const AL_NO_ERROR #}++al_ORIENTATION :: ALenum+al_ORIENTATION = {#const AL_ORIENTATION #}++al_OUT_OF_MEMORY :: ALenum+al_OUT_OF_MEMORY = {#const AL_OUT_OF_MEMORY #}++al_PAUSED :: ALenum+al_PAUSED = {#const AL_PAUSED #}++al_PITCH :: ALenum+al_PITCH = {#const AL_PITCH #}++al_PLAYING :: ALenum+al_PLAYING = {#const AL_PLAYING #}++al_POSITION :: ALenum+al_POSITION = {#const AL_POSITION #}++al_REFERENCE_DISTANCE :: ALenum+al_REFERENCE_DISTANCE = {#const AL_REFERENCE_DISTANCE #}++al_RENDERER :: ALenum+al_RENDERER = {#const AL_RENDERER #}++al_ROLLOFF_FACTOR :: ALenum+al_ROLLOFF_FACTOR = {#const AL_ROLLOFF_FACTOR #}++al_SIZE :: ALenum+al_SIZE = {#const AL_SIZE #}++al_SOURCE_RELATIVE :: ALenum+al_SOURCE_RELATIVE = {#const AL_SOURCE_RELATIVE #}++al_SOURCE_STATE :: ALenum+al_SOURCE_STATE = {#const AL_SOURCE_STATE #}++al_TRUE :: ALenum+al_TRUE = {#const AL_TRUE #}++al_STOPPED :: ALenum+al_STOPPED = {#const AL_STOPPED #}++al_VELOCITY :: ALenum+al_VELOCITY = {#const AL_VELOCITY #}++al_VENDOR :: ALenum+al_VENDOR = {#const AL_VENDOR #}++al_VERSION :: ALenum+al_VERSION = {#const AL_VERSION #}
+ src/Sound/AL/EAX.chs view
@@ -0,0 +1,13 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.EAX+    {-# WARNING "EAX{G,S}et not implemented yet!" #-}+  where
+ src/Sound/AL/Errors.chs view
@@ -0,0 +1,18 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Errors where++import Foreign.C.Types+import Sound.AL.Types++#include <al.h>++foreign import CALLCV "alGetError" alGetError :: IO ALenum
+ src/Sound/AL/Extensions.chs view
@@ -0,0 +1,21 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Extensions where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types++#include <al.h>++foreign import CALLCV "alIsExtensionPresent" alIsExtensionPresent :: Ptr ALubyte -> IO ALboolean+foreign import CALLCV "alGetProcAddress" alGetProcAddress :: Ptr ALubyte -> IO (Ptr ALvoid)+foreign import CALLCV "alGetEnumValue" alGetEnumValue :: Ptr ALubyte -> IO ALenum
+ src/Sound/AL/Listener.chs view
@@ -0,0 +1,26 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Listener where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types++#include <al.h>++foreign import CALLCV "alListenerf" alListenerf :: ALenum -> ALfloat -> IO ()+foreign import CALLCV "alListener3f" alListener3f :: ALenum -> ALfloat -> ALfloat -> ALfloat -> IO ()+foreign import CALLCV "alListenerfv" alListenerfv :: ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alListeneri" alListeneri :: ALenum -> ALint -> IO ()+foreign import CALLCV "alGetListenerf" alGetListenerf :: ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetListener3f" alGetListener3f :: ALenum -> Ptr ALfloat -> Ptr ALfloat -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetListenerfv" alGetListenerfv :: ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetListeneri" alGetListeneri :: ALenum -> Ptr ALint -> IO ()
+ src/Sound/AL/Source.chs view
@@ -0,0 +1,38 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Source where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types++#include <al.h>++foreign import CALLCV "alGenSources" alGenSources :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alDeleteSources" alDeleteSources :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alIsSource" alIsSource :: ALuint -> IO ALboolean+foreign import CALLCV "alSourcef" alSourcef :: ALuint -> ALenum -> ALfloat -> IO ()+foreign import CALLCV "alSourcefv" alSourcefv :: ALuint -> ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alSource3f" alSource3f :: ALuint -> ALenum -> ALfloat -> ALfloat -> ALfloat -> IO ()+foreign import CALLCV "alSourcei" alSourcei :: ALuint -> ALenum -> ALint -> IO ()+foreign import CALLCV "alGetSourcef" alGetSourcef :: ALuint -> ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetSourcefv" alGetSourcefv :: ALuint -> ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetSourcei" alGetSourcei :: ALuint -> ALenum -> Ptr ALint -> IO ()+foreign import CALLCV "alSourcePlay" alSourcePlay :: ALuint -> IO ()+foreign import CALLCV "alSourcePlayv" alSourcePlayv :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alSourcePause" alSourcePause :: ALuint -> IO ()+foreign import CALLCV "alSourcePausev" alSourcePausev :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alSourceStop" alSourceStop :: ALuint -> IO ()+foreign import CALLCV "alSourceStopv" alSourceStopv :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alSourceRewind" alSourceRewind :: ALuint -> IO ()+foreign import CALLCV "alSourceRewindv" alSourceRewindv :: ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alSourceQueueBuffers" alSourceQueueBuffers :: ALuint -> ALsizei -> Ptr ALuint -> IO ()+foreign import CALLCV "alSourceUnqueueBuffers" alSourceUnqueueBuffers :: ALuint -> ALsizei -> Ptr ALuint -> IO ()
+ src/Sound/AL/State.chs view
@@ -0,0 +1,33 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.State where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types++#include <al.h>++foreign import CALLCV "alEnable" alEnable :: ALenum -> IO ()+foreign import CALLCV "alDisable" alDisable :: ALenum -> IO ()+foreign import CALLCV "alIsEnabled" alIsEnabled :: ALenum -> IO ALboolean+foreign import CALLCV "alGetBoolean" alGetBoolean :: ALenum -> IO ALboolean+foreign import CALLCV "alGetDouble" alGetDouble :: ALenum -> IO ALdouble+foreign import CALLCV "alGetFloat" alGetFloat :: ALenum -> IO ALfloat+foreign import CALLCV "alGetInteger" alGetInteger :: ALenum -> IO ALint+foreign import CALLCV "alGetBooleanv" alGetBooleanv :: ALenum -> Ptr ALboolean -> IO ()+foreign import CALLCV "alGetDoublev" alGetDoublev :: ALenum -> Ptr ALdouble -> IO ()+foreign import CALLCV "alGetFloatv" alGetFloatv :: ALenum -> Ptr ALfloat -> IO ()+foreign import CALLCV "alGetIntegerv" alGetIntegerv :: ALenum -> Ptr ALint -> IO ()+foreign import CALLCV "alGetString" alGetString :: ALenum -> Ptr ALubyte+foreign import CALLCV "alDistanceModel" alDistanceModel :: ALenum -> IO ()+foreign import CALLCV "alDopplerFactor" alDopplerFactor :: ALfloat -> IO ()+foreign import CALLCV "alDopplerVelocity" alDopplerVelocity :: ALfloat -> IO ()
+ src/Sound/AL/Types.chs view
@@ -0,0 +1,29 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.AL.Types where++import Foreign.C.Types++#include <al.h>++type ALboolean = {#type ALboolean #}+type ALchar = {#type ALchar #}+type ALbyte = {#type ALbyte #}+type ALubyte = {#type ALubyte #}+type ALshort = {#type ALshort #}+type ALushort = {#type ALushort #}+type ALint = {#type ALint #}+type ALuint = {#type ALuint #}+type ALsizei = {#type ALsizei #}+type ALenum = {#type ALenum #}+type ALfloat = {#type ALfloat #}+type ALdouble = {#type ALdouble #}+type ALvoid = {#type ALvoid #}
+ src/Sound/ALC.hs view
@@ -0,0 +1,27 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC (+    module Sound.ALC.Context+  , module Sound.ALC.Defines+  , module Sound.ALC.Device+  , module Sound.ALC.Errors+  , module Sound.ALC.Extensions+  , module Sound.ALC.State+  , module Sound.ALC.Types+  ) where++import Sound.ALC.Context+import Sound.ALC.Defines+import Sound.ALC.Device+import Sound.ALC.Errors+import Sound.ALC.Extensions+import Sound.ALC.State+import Sound.ALC.Types
+ src/Sound/ALC/Context.chs view
@@ -0,0 +1,23 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.Context where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types+import Sound.ALC.Types++foreign import CALLCV "alcCreateContext" alcCreateContext :: Ptr ALCdevice -> Ptr ALint -> IO (Ptr ALvoid)+foreign import CALLCV "alcMakeContextCurrent" alcMakeContextCurrent :: Ptr ALvoid -> IO ALCenum+foreign import CALLCV "alcProcessContext" alcProcessContext :: Ptr ALvoid -> IO ()+foreign import CALLCV "alcSuspendContext" alcSuspendContext :: Ptr ALvoid -> IO ()+foreign import CALLCV "alcDestroyContext" alcDestroyContext :: Ptr ALvoid -> IO ALCenum+foreign import CALLCV "alcGetCurrentContext" alcGetCurrentContext :: IO (Ptr ALvoid)
+ src/Sound/ALC/Defines.chs view
@@ -0,0 +1,45 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.Defines where++import Sound.ALC.Types++#include <alc.h>++alc_DEFAULT_DEVICE_SPECIFIER :: ALCenum+alc_DEFAULT_DEVICE_SPECIFIER = {#const ALC_DEFAULT_DEVICE_SPECIFIER #}++alc_ALL_ATTRIBUTES :: ALCenum+alc_ALL_ATTRIBUTES = {#const ALC_ALL_ATTRIBUTES #}++alc_ATTRIBUTES_SIZE :: ALCenum+alc_ATTRIBUTES_SIZE = {#const ALC_ATTRIBUTES_SIZE #}++alc_DEVICE_SPECIFIER :: ALCenum+alc_DEVICE_SPECIFIER = {#const ALC_DEVICE_SPECIFIER #}++alc_EXTENSIONS :: ALCenum+alc_EXTENSIONS = {#const ALC_EXTENSIONS #}++alc_FREQUENCY :: ALCenum+alc_FREQUENCY = {#const ALC_FREQUENCY #}++alc_MAJOR_VERSION :: ALCenum+alc_MAJOR_VERSION = {#const ALC_MAJOR_VERSION #}++alc_MINOR_VERSION :: ALCenum+alc_MINOR_VERSION = {#const ALC_MINOR_VERSION #}++alc_REFRESH :: ALCenum+alc_REFRESH = {#const ALC_REFRESH #}++alc_SYNC :: ALCenum+alc_SYNC = {#const ALC_SYNC #}
+ src/Sound/ALC/Device.chs view
@@ -0,0 +1,19 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.Device where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types+import Sound.ALC.Types++foreign import CALLCV "alcOpenDevice" alcOpenDevice :: ALubyte -> IO (Ptr ALCdevice)+foreign import CALLCV "alcCloseDevice" alcCloseDevice :: Ptr ALCdevice -> IO ()
+ src/Sound/ALC/Errors.chs view
@@ -0,0 +1,16 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.Errors where++import Foreign.C.Types+import Sound.ALC.Types++foreign import CALLCV "alcGetError" alcGetError :: IO ALCenum
+ src/Sound/ALC/Extensions.chs view
@@ -0,0 +1,20 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.Extensions where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types+import Sound.ALC.Types++foreign import CALLCV "alcIsExtensionSupported" alcIsExtensionSupported :: Ptr ALCdevice -> Ptr ALubyte -> IO ALboolean+foreign import CALLCV "alcGetProcAddress" alcGetProcAddress :: Ptr ALCdevice -> Ptr ALubyte -> IO (Ptr ALvoid)+foreign import CALLCV "alcGetEnumValue" alcGetEnumValue :: Ptr ALCdevice -> Ptr ALubyte -> IO ALenum
+ src/Sound/ALC/State.chs view
@@ -0,0 +1,19 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.State where++import Foreign.C.Types+import Foreign.Ptr ( Ptr )+import Sound.AL.Types+import Sound.ALC.Types++foreign import CALLCV "alcGetString" alcGetString :: Ptr ALCdevice -> ALenum -> IO (Ptr ALubyte)+foreign import CALLCV "alcGetIntegerv" alcGetIntegerv :: Ptr ALCdevice -> ALenum -> ALsizei -> Ptr ALint -> IO ()
+ src/Sound/ALC/Types.chs view
@@ -0,0 +1,18 @@+-----------------------------------------------------------------------------+-- |+-- Copyright   : (C) 2015 Dimitri Sabadie+-- License     : BSD3+--+-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>+-- Stability   : experimental+-- Portability : portable+----------------------------------------------------------------------------++module Sound.ALC.Types where++import Foreign.C.Types++#include <alc.h>++data ALCdevice = ALCdevice+type ALCenum = {#type ALCenum #}