Skip to content

Commit

Permalink
Use MonadIO. Updated copyright.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenpanne committed Mar 18, 2015
1 parent dfe1aea commit 8f5544a
Show file tree
Hide file tree
Showing 32 changed files with 206 additions and 175 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2003-2013, Sven Panne
Copyright (c) 2003-2015, Sven Panne
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
1 change: 1 addition & 0 deletions OpenAL.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description:
This package has also been tested on GNU/Linux and iOS.
homepage: https://github.com/haskell-openal/ALUT
bug-reports: https://github.com/haskell-openal/ALUT/issues
copyright: Copyright (C) 2003-2015 Sven Panne
license: BSD3
license-file: LICENSE
author: Sven Panne
Expand Down
2 changes: 1 addition & 1 deletion src/Sound/OpenAL.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Sound/OpenAL/AL.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand Down
6 changes: 3 additions & 3 deletions src/Sound/OpenAL/AL/ALboolean.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.ALboolean
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -17,8 +17,8 @@ module Sound.OpenAL.AL.ALboolean (
marshalALboolean, unmarshalALboolean
) where

import Sound.OpenAL.AL.BasicTypes ( ALboolean )
import Sound.OpenAL.Constants ( al_FALSE, al_TRUE )
import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.Constants

--------------------------------------------------------------------------------

Expand Down
11 changes: 7 additions & 4 deletions src/Sound/OpenAL/AL/Attenuation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Attenuation
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -28,10 +28,13 @@ module Sound.OpenAL.AL.Attenuation (
-- $NoCullingByDistance
) where

import Data.StateVar
-- Make the foreign imports happy.
import Foreign.C.Types
import Foreign.Marshal.Alloc
import Foreign.Ptr

import Data.StateVar ( StateVar, makeStateVar )
import Foreign.Marshal.Alloc ( alloca )
import Foreign.Ptr ( Ptr )

import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.PeekPoke
import Sound.OpenAL.AL.QueryUtils
Expand Down
2 changes: 1 addition & 1 deletion src/Sound/OpenAL/AL/BasicTypes.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.BasicTypes
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand Down
15 changes: 9 additions & 6 deletions src/Sound/OpenAL/AL/Buffer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Buffer
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand Down Expand Up @@ -69,15 +69,18 @@ module Sound.OpenAL.AL.Buffer (
Buffer, MemoryRegion(..), Format(..), BufferData(..), bufferData
) where

import Data.StateVar
-- Make the foreign imports happy.
import Foreign.C.Types
import Foreign.Marshal.Alloc
import Foreign.Ptr

import Data.StateVar ( StateVar, makeStateVar )
import Foreign.Marshal.Alloc ( alloca )
import Foreign.Ptr ( Ptr, nullPtr )

import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.BufferInternal
import Sound.OpenAL.AL.Format
import Sound.OpenAL.AL.PeekPoke
import Sound.OpenAL.ALC.Context ( Frequency )
import qualified Sound.OpenAL.ALC.Context as ALC
import Sound.OpenAL.Constants

-- For Haddock only.
Expand All @@ -89,7 +92,7 @@ import Sound.OpenAL.AL.SourceState
data MemoryRegion a = MemoryRegion (Ptr a) ALsizei
deriving ( Eq, Ord, Show )

data BufferData a = BufferData (MemoryRegion a) Format Frequency
data BufferData a = BufferData (MemoryRegion a) Format ALC.Frequency
deriving ( Eq, Ord, Show )

--------------------------------------------------------------------------------
Expand Down
15 changes: 9 additions & 6 deletions src/Sound/OpenAL/AL/BufferInternal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.BufferInternal
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -17,15 +17,18 @@ module Sound.OpenAL.AL.BufferInternal (
Buffer(..), marshalBuffer, unmarshalBuffer
) where

-- Make the foreign imports happy.
import Foreign.C.Types

import Control.Monad.IO.Class ( MonadIO(..) )
import Data.ObjectName
import Data.ObjectName ( ObjectName(..), GeneratableObjectName(..) )
import Foreign.Marshal.Array ( withArrayLen, peekArray, allocaArray )
import Foreign.C.Types
import Foreign.Ptr ( Ptr, castPtr )
import Foreign.Storable ( Storable(..) )
import Sound.OpenAL.AL.ALboolean ( unmarshalALboolean )
import Sound.OpenAL.AL.BasicTypes ( ALboolean, ALuint, ALsizei )
import Sound.OpenAL.AL.PeekPoke ( peek1, poke1 )

import Sound.OpenAL.AL.ALboolean
import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.PeekPoke

--------------------------------------------------------------------------------

Expand Down
9 changes: 6 additions & 3 deletions src/Sound/OpenAL/AL/Doppler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Doppler
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -20,9 +20,12 @@ module Sound.OpenAL.AL.Doppler (
dopplerFactor, speedOfSound
) where

import Data.StateVar
-- Make the foreign imports happy.
import Foreign.C.Types
import Foreign.Ptr

import Data.StateVar ( get, StateVar, makeStateVar )
import Foreign.Ptr ( FunPtr )

import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.Extensions
import Sound.OpenAL.AL.QueryUtils
Expand Down
15 changes: 8 additions & 7 deletions src/Sound/OpenAL/AL/Errors.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Errors
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -17,13 +17,14 @@ module Sound.OpenAL.AL.Errors (
ALError(..), ALErrorCategory(..), alErrors
) where

import Data.StateVar
-- Make the foreign imports happy.
import Foreign.C.Types
import Sound.OpenAL.AL.BasicTypes ( ALenum )
import Sound.OpenAL.Constants (
al_NO_ERROR, al_INVALID_NAME, al_INVALID_ENUM, al_INVALID_VALUE,
al_INVALID_OPERATION, al_OUT_OF_MEMORY )
import Sound.OpenAL.AL.QueryUtils ( StringName(..), getString )

import Data.StateVar ( GettableStateVar, makeGettableStateVar )

import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.Constants
import Sound.OpenAL.AL.QueryUtils

--------------------------------------------------------------------------------

Expand Down
7 changes: 5 additions & 2 deletions src/Sound/OpenAL/AL/Extensions.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Extensions
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -22,9 +22,12 @@ module Sound.OpenAL.AL.Extensions (
unmarshalALboolean, unmarshalFormat, unmarshalBuffer
) where

import Data.StateVar
-- Make the foreign imports happy.
import Foreign.C.Types

import Data.StateVar ( GettableStateVar, makeGettableStateVar )
import Foreign.Ptr

import Sound.OpenAL.AL.ALboolean
import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.BufferInternal
Expand Down
7 changes: 3 additions & 4 deletions src/Sound/OpenAL/AL/Format.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Format
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -17,9 +17,8 @@ module Sound.OpenAL.AL.Format (
Format(..), marshalFormat, unmarshalFormat
) where

import Sound.OpenAL.AL.BasicTypes ( ALenum )
import Sound.OpenAL.Constants (
al_FORMAT_MONO8, al_FORMAT_MONO16, al_FORMAT_STEREO8, al_FORMAT_STEREO16 )
import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.Constants

--------------------------------------------------------------------------------

Expand Down
17 changes: 10 additions & 7 deletions src/Sound/OpenAL/AL/Listener.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.Listener
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand Down Expand Up @@ -31,13 +31,16 @@ module Sound.OpenAL.AL.Listener (
listenerPosition, listenerVelocity, Gain, listenerGain, orientation
) where

import Data.StateVar
-- Make the foreign imports happy.
import Foreign.C.Types
import Foreign.Marshal.Array
import Foreign.Marshal.Utils
import Foreign.Ptr
import Foreign.Storable
import Graphics.Rendering.OpenGL.GL.Tensor

import Data.StateVar ( StateVar, makeStateVar )
import Foreign.Marshal.Array ( allocaArray, withArray )
import Foreign.Marshal.Utils ( with )
import Foreign.Ptr ( Ptr )
import Foreign.Storable ( Storable )
import Graphics.Rendering.OpenGL.GL.Tensor ( Vector3(..), Vertex3 (..) )

import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.PeekPoke
import Sound.OpenAL.AL.QueryUtils
Expand Down
2 changes: 1 addition & 1 deletion src/Sound/OpenAL/AL/PeekPoke.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.PeekPoke
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand Down
18 changes: 7 additions & 11 deletions src/Sound/OpenAL/AL/QueryUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------------
-- |
-- Module : Sound.OpenAL.AL.QueryUtils
-- Copyright : (c) Sven Panne 2003-2013
-- Copyright : (c) Sven Panne 2003-2015
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
Expand All @@ -18,18 +18,14 @@ module Sound.OpenAL.AL.QueryUtils (
StringName(..), getString
) where

-- Make the foreign imports happy.
import Foreign.C.Types

import Foreign.Ptr ( Ptr )
import Sound.OpenAL.AL.BasicTypes ( ALchar, ALenum )
import Sound.OpenAL.AL.String ( peekALString )
import Sound.OpenAL.Constants (
al_DISTANCE_MODEL, al_DOPPLER_FACTOR, al_SPEED_OF_SOUND, al_POSITION,
al_VELOCITY, al_GAIN, al_ORIENTATION, al_SOURCE_RELATIVE, al_SOURCE_TYPE,
al_LOOPING, al_BUFFER, al_BUFFERS_QUEUED, al_BUFFERS_PROCESSED, al_MIN_GAIN,
al_MAX_GAIN, al_REFERENCE_DISTANCE, al_ROLLOFF_FACTOR, al_MAX_DISTANCE,
al_PITCH, al_DIRECTION, al_CONE_INNER_ANGLE, al_CONE_OUTER_ANGLE,
al_CONE_OUTER_GAIN, al_SEC_OFFSET, al_SAMPLE_OFFSET, al_BYTE_OFFSET,
al_SOURCE_STATE, al_VENDOR, al_RENDERER, al_VERSION, al_EXTENSIONS )

import Sound.OpenAL.AL.BasicTypes
import Sound.OpenAL.AL.String
import Sound.OpenAL.Constants

--------------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit 8f5544a

Please sign in to comment.