orx  stable
Portable Game Engine
orxSoundSystem.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxSOUNDSYSTEM_H_
44 #define _orxSOUNDSYSTEM_H_
45 
46 #include "orxInclude.h"
47 #include "math/orxVector.h"
48 #include "plugin/orxPluginCore.h"
49 
50 
51 /***************************************************************************
52  * Structure declaration *
53  ***************************************************************************/
54 
57 typedef struct __orxSOUNDSYSTEM_SOUND_t orxSOUNDSYSTEM_SOUND;
58 typedef struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE;
59 
62 typedef enum __orxSOUNDSYSTEM_STATUS_t
63 {
67 
69 
71 
73 
74 
77 #define orxSOUNDSYSTEM_KZ_CONFIG_SECTION "SoundSystem"
78 #define orxSOUNDSYSTEM_KZ_CONFIG_RATIO "DimensionRatio"
79 #define orxSOUNDSYSTEM_KZ_CONFIG_STREAM_BUFFER_SIZE "StreamBufferSize"
80 #define orxSOUNDSYSTEM_KZ_CONFIG_STREAM_BUFFER_NUMBER "StreamBufferNumber"
81 
82 
83 /***************************************************************************
84  * Functions directly implemented by orx core
85  ***************************************************************************/
86 
89 extern orxDLLAPI void orxFASTCALL orxSoundSystem_Setup();
90 
91 
92 /***************************************************************************
93  * Functions extended by plugins
94  ***************************************************************************/
95 
99 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Init();
100 
103 extern orxDLLAPI void orxFASTCALL orxSoundSystem_Exit();
104 
111 extern orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate);
112 
117 extern orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_LoadSample(const orxSTRING _zFilename);
118 
124 
132 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSampleInfo(const orxSOUNDSYSTEM_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate);
133 
140 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSampleData(orxSOUNDSYSTEM_SAMPLE *_pstSample, const orxS16 *_as16Data, orxU32 _u32SampleNumber);
141 
147 
154 extern orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zReference);
155 
161 extern orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStreamFromFile(const orxSTRING _zFilename, const orxSTRING _zReference);
162 
166 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Delete(orxSOUNDSYSTEM_SOUND *_pstSound);
167 
172 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Play(orxSOUNDSYSTEM_SOUND *_pstSound);
173 
178 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Pause(orxSOUNDSYSTEM_SOUND *_pstSound);
179 
184 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Stop(orxSOUNDSYSTEM_SOUND *_pstSound);
185 
193 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber);
194 
199 
203 extern orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_HasRecordingSupport();
204 
210 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetVolume(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fVolume);
211 
217 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPitch(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPitch);
218 
224 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPosition(orxSOUNDSYSTEM_SOUND *_pstSound, const orxVECTOR *_pvPosition);
225 
231 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetAttenuation(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fAttenuation);
232 
238 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetReferenceDistance(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fDistance);
239 
245 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Loop(orxSOUNDSYSTEM_SOUND *_pstSound, orxBOOL _bLoop);
246 
251 extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetVolume(const orxSOUNDSYSTEM_SOUND *_pstSound);
252 
257 extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetPitch(const orxSOUNDSYSTEM_SOUND *_pstSound);
258 
264 extern orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetPosition(const orxSOUNDSYSTEM_SOUND *_pstSound, orxVECTOR *_pvPosition);
265 
270 extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetAttenuation(const orxSOUNDSYSTEM_SOUND *_pstSound);
271 
276 extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetReferenceDistance(const orxSOUNDSYSTEM_SOUND *_pstSound);
277 
282 extern orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsLooping(const orxSOUNDSYSTEM_SOUND *_pstSound);
283 
288 extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetDuration(const orxSOUNDSYSTEM_SOUND *_pstSound);
289 
295 
300 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetGlobalVolume(orxFLOAT _fGlobalVolume);
301 
305 extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetGlobalVolume();
306 
311 extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetListenerPosition(const orxVECTOR *_pvPosition);
312 
317 extern orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetListenerPosition(orxVECTOR *_pvPosition);
318 
319 #endif /* _orxSOUNDSYSTEM_H_ */
320 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Loop(orxSOUNDSYSTEM_SOUND *_pstSound, orxBOOL _bLoop)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Stop(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Play(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetReferenceDistance(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSampleInfo(const orxSOUNDSYSTEM_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate)
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_LoadSample(const orxSTRING _zFilename)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetAttenuation(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zReference)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetAttenuation(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fAttenuation)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetReferenceDistance(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fDistance)
orxDLLAPI void orxFASTCALL orxSoundSystem_Exit()
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPosition(orxSOUNDSYSTEM_SOUND *_pstSound, const orxVECTOR *_pvPosition)
orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetPosition(const orxSOUNDSYSTEM_SOUND *_pstSound, orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetVolume(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fVolume)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetListenerPosition(const orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetGlobalVolume(orxFLOAT _fGlobalVolume)
orxSOUNDSYSTEM_STATUS
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateFromSample(const orxSOUNDSYSTEM_SAMPLE *_pstSample)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_DeleteSample(orxSOUNDSYSTEM_SAMPLE *_pstSample)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetVolume(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxSOUNDSYSTEM_STATUS orxFASTCALL orxSoundSystem_GetStatus(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStreamFromFile(const orxSTRING _zFilename, const orxSTRING _zReference)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Delete(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Init()
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetGlobalVolume()
orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetListenerPosition(orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Pause(orxSOUNDSYSTEM_SOUND *_pstSound)
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate)
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsLooping(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetPitch(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StopRecording()
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPitch(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPitch)
struct __orxSOUNDSYSTEM_SOUND_t orxSOUNDSYSTEM_SOUND
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_HasRecordingSupport()
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetDuration(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI void orxFASTCALL orxSoundSystem_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSampleData(orxSOUNDSYSTEM_SAMPLE *_pstSample, const orxS16 *_as16Data, orxU32 _u32SampleNumber)
struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE

Generated for orx by doxygen 1.5.6