-- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell) -- Edit the ORIGNAL .chs file instead! {-# LINE 1 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE TypeSynonymInstances #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.althainz.de/HGamer3D.html -- -- (c) 2011, 2012 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- ClassSoundSource.chs -- module HGamer3D.Bindings.SFML.ClassSoundSource where import Foreign import Foreign.Ptr import Foreign.C import HGamer3D.Data.HG3DClass import HGamer3D.Data.Vector import HGamer3D.Data.Colour import HGamer3D.Data.Angle import HGamer3D.Bindings.SFML.Utils {-# LINE 40 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} import HGamer3D.Bindings.SFML.ClassPtr {-# LINE 41 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} import HGamer3D.Bindings.SFML.StructHG3DClass {-# LINE 42 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Destructor. delete :: HG3DClass -- ^ classpointer - pointer of Class instance which is going to be deleted. -> IO () -- ^ delete a1 = withHG3DClass a1 $ \a1' -> delete'_ a1' >>= \res -> return () {-# LINE 47 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Set the pitch of the sound. - Details: The pitch represents the perceived fundamental frequency of a sound; thus you can make a sound more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the sound as well. The default value for the pitch is 1. setPitch :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ pitch -> IO () -- ^ setPitch a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setPitch'_ a1' a2' >>= \res -> return () {-# LINE 52 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Set the volume of the sound. - Details: The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100. setVolume :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ volume -> IO () -- ^ setVolume a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setVolume'_ a1' a2' >>= \res -> return () {-# LINE 57 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Set the 3D position of the sound in the audio scene. - Details: Only sounds with one channel (mono sounds) can be spatialized. The default position of a sound is (0, 0, 0). setPosition :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ x -> Float -- ^ y -> Float -- ^ z -> IO () -- ^ setPosition a1 a2 a3 a4 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in let {a3' = realToFrac a3} in let {a4' = realToFrac a4} in setPosition'_ a1' a2' a3' a4' >>= \res -> return () {-# LINE 64 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Make the sound's position relative to the listener or absolute. - Details: Making a sound relative to the listener will ensure that it will always be played the same way regardless the position of the listener. This can be useful for non-spatialized sounds, sounds that are produced by the listener, or sounds attached to it. The default value is false (position is absolute). setRelativeToListener :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ relative -> IO () -- ^ setRelativeToListener a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setRelativeToListener'_ a1' a2' >>= \res -> return () {-# LINE 69 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Set the minimum distance of the sound. - Details: The "minimum distance" of a sound is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head --of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1. setMinDistance :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ distance -> IO () -- ^ setMinDistance a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setMinDistance'_ a1' a2' >>= \res -> return () {-# LINE 74 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Set the attenuation factor of the sound. - Details: The attenuation is a multiplicative factor which makes the sound more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated sound, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the sound fade out very quickly as it gets further from the listener. The default value of the attenuation is 1. setAttenuation :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ attenuation -> IO () -- ^ setAttenuation a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setAttenuation'_ a1' a2' >>= \res -> return () {-# LINE 79 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Get the pitch of the sound. - Details: setPitch getPitch :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ return value - Pitch of the sound getPitch a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getPitch'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 84 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Get the volume of the sound. - Details: setVolume getVolume :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ return value - Volume of the sound, in the range [0, 100] getVolume a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getVolume'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 89 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Tell whether the sound's position is relative to the listener or is absolute. - Details: setRelativeToListener isRelativeToListener :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ return value - True if the position is relative, false if it's absolute isRelativeToListener a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> isRelativeToListener'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 94 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Get the minimum distance of the sound. - Details: setMinDistancegetAttenuation getMinDistance :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ return value - Minimum distance of the sound getMinDistance a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getMinDistance'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 99 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} -- | Get the attenuation factor of the sound. - Details: setAttenuationgetMinDistance getAttenuation :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ return value - Attenuation factor of the sound getAttenuation a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getAttenuation'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 104 ".\\HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs" #-} foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_destruct" delete'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_setPitch" setPitch'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_setVolume" setVolume'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_setPosition" setPosition'_ :: ((HG3DClassPtr) -> (CFloat -> (CFloat -> (CFloat -> (IO ()))))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_setRelativeToListener" setRelativeToListener'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_setMinDistance" setMinDistance'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_setAttenuation" setAttenuation'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_getPitch" getPitch'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_getVolume" getVolume'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_isRelativeToListener" isRelativeToListener'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_getMinDistance" getMinDistance'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\SFML\\ClassSoundSource.chs.h sfml_snsr_getAttenuation" getAttenuation'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ())))