1 /*
2     ALmixer:  A library to make playing pre-loaded sounds and streams easier
3 	with high performance and potential access to OpenAL effects.
4     Copyright 2002, 2010 Eric Wing <ewing . public @ playcontrol.net>
5 
6     This library is free software; you can redistribute it and/or
7     modify it under the terms of the GNU Library General Public
8     License as published by the Free Software Foundation; either
9     version 2 of the License, or (at your option) any later version.
10 
11     This library is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14     Library General Public License for more details.
15 
16     You should have received a copy of the GNU Library General Public
17     License along with this library; if not, write to the Free
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20 
21 module dalmixer;
22 
23 import derelict.openal.al;
24 import derelict.util.loader;
25 import derelict.util.system;
26 
27 private {
28 	static if( Derelict_OS_Windows )
29 		enum libNames = "ALmixer.dll, libALmixer";
30 	/*else static if( Derelict_OS_Mac )
31 		enum libNames = "../Frameworks/ALmixer.framework/ALmixer, /Library/Frameworks/ALmixer.framework/ALmixer, /System/Library/Frameworks/ALmixer.framework/ALmixer";*/
32 	else static if( Derelict_OS_Posix )
33 		enum libNames = "ALmixer.so, libALmixer.so, libALmixer.so.0.4.0";
34 	else
35 		static assert( 0, "Need to implement ALmixer libNames for this operating system." );
36 }
37 
38 struct ALmixer_Data;
39 struct ALmixer_RWops;
40 
41 struct ALmixer_AudioInfo
42 {
43 	ALushort format;
44 	ALubyte channels;
45 	ALuint rate;
46 };
47 
48 struct ALmixer_version
49 {
50 	ALubyte major;
51 	ALubyte minor;
52 	ALubyte patch;
53 };
54 
55 enum
56 {
57 	int ALMIXER_MAJOR_VERSION = 0,
58 	int ALMIXER_MINOR_VERSION = 4,
59 	int ALMIXER_PATCHLEVEL	= 0,
60 	
61 	int ALMIXER_DEFAULT_FREQUENCY = 0,
62 	int ALMIXER_DEFAULT_REFRESH = 0,
63 	int ALMIXER_DEFAULT_NUM_CHANNELS	= 32,
64 	int ALMIXER_DEFAULT_NUM_SOURCES = ALMIXER_DEFAULT_NUM_CHANNELS,
65 	
66 	int ALMIXER_DEFAULT_BUFFERSIZE = 8192,
67 	int ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE = 4096,
68 	int ALMIXER_DEFAULT_QUEUE_BUFFERS = 12,
69 	int ALMIXER_DEFAULT_STARTUP_BUFFERS = 4,
70 	int ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS = 2
71 }
72 
73 //alias dal_ALmixer_Init = function();
74 
75 extern( C ) @nogc nothrow {
76 
77 	///CoreOperation Initialization, Tear-down, and Core Operational Commands
78 
79 	alias dal_ALmixer_GetLinkedVersion = const ALmixer_version* function();
80 	alias dal_ALmixer_GetError = const char* function();
81 	alias dal_ALmixer_SetError = void function(const char *fmt, ...);
82 	alias dal_ALmixer_GetTicks = ALuint function();
83 	alias dal_ALmixer_Delay = void function(ALuint milliseconds_delay);
84 	alias dal_ALmixer_Init = ALboolean function( ALuint playback_frequency, ALuint num_sources, ALuint refresh_rate );
85 	alias dal_ALmixer_InitContext = ALboolean function(ALuint playback_frequency, ALuint refresh_rate);
86 	alias dal_ALmixer_InitMixer = ALboolean function(ALuint num_sources);
87 	alias dal_ALmixer_BeginInterruption = void function();
88 	alias dal_ALmixer_EndInterruption = void function();
89 	alias dal_ALmixer_IsInInterruption = ALboolean function();
90 	alias dal_ALmixer_SuspendUpdates = void function();
91 	alias dal_ALmixer_ResumeUpdates = void function();
92 	alias dal_ALmixer_AreUpdatesSuspended = ALboolean function();
93 	alias dal_ALmixer_SuspendPlayingState = void function();
94 	alias dal_ALmixer_ResumePlayingState = void function();
95 	alias dal_ALmixer_IsPlayingStateSuspended = ALboolean function();
96 	alias dal_ALmixer_Quit = void function();
97 	alias dal_ALmixer_QuitWithoutFreeData = void function();
98 	alias dal_ALmixer_IsInitialized = ALboolean function();
99 	alias dal_ALmixer_GetFrequency = ALuint function();
100 	alias dal_ALmixer_AllocateChannels = ALint function(ALint num_chans);
101 	alias dal_ALmixer_ReserveChannels = ALint function(ALint number_of_reserve_channels);
102 	alias dal_ALmixer_Update = ALint function();
103 
104 	///LoadAPI Load Audio Functions
105 
106 	alias dal_ALmixer_LoadSample_RW = ALmixer_Data* function(ALmixer_RWops* rw_ops, const char* file_ext, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
107 	alias dal_ALmixer_LoadStream_RW = ALmixer_Data* function(ALmixer_RWops* rw_ops, const char* file_ext, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
108 	alias dal_ALmixer_LoadAll_RW = ALmixer_Data* function(ALmixer_RWops* rw_ops, const char* file_ext, ALuint access_data);
109 	alias dal_ALmixer_LoadSample = ALmixer_Data * function(const char* file_name, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
110 	alias dal_ALmixer_LoadStream = ALmixer_Data* function(const char* file_name, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
111 	alias dal_ALmixer_LoadAll = ALmixer_Data* function(const char* file_name, ALuint access_data);
112 	alias dal_ALmixer_LoadSample_RAW_RW = ALmixer_Data* function(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
113 	alias dal_ALmixer_LoadStream_RAW_RW = ALmixer_Data* function(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
114 	alias dal_ALmixer_LoadAll_RAW_RW = ALmixer_Data* function(ALmixer_RWops* rw_ops, const char* file_ext, ALmixer_AudioInfo* desired_format, ALuint access_data);
115 	alias dal_ALmixer_LoadSample_RAW = ALmixer_Data* function(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
116 	alias dal_ALmixer_LoadStream_RAW = ALmixer_Data* function(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data);
117 	alias dal_ALmixer_LoadAll_RAW = ALmixer_Data* function(const char* file_name, ALmixer_AudioInfo* desired_format, ALuint access_data);
118 	alias dal_ALmixer_FreeData = void function(ALmixer_Data* functionalmixer_data);
119 	alias dal_ALmixer_IsPredecoded = ALboolean function(ALmixer_Data* functionalmixer_data);
120 
121 	///CallbackAPI Callbacks
122 
123 	alias void function(ALint which_channel, ALuint al_source, ALmixer_Data* almixer_data, ALboolean finished_naturally, void* ALmixer_SetPlaybackFinishedCallbackContainer)playback_finished_callback;
124 	alias dal_ALmixer_SetPlaybackFinishedCallback = void function(void function(ALint which_channel, ALuint al_source, ALmixer_Data* almixer_data, ALboolean finished_naturally, void* user_data)playback_finished_callback, void* user_data);
125 	alias dal_ALmixer_SetPlaybackDataCallback = void function(void function(ALint which_channel, ALuint al_source, ALbyte* pcm_data, ALuint num_bytes, ALuint frequency, ALubyte num_channels_in_sample, ALubyte bit_depth, ALboolean is_unsigned, ALboolean decode_mode_is_predecoded, ALuint length_in_msec, void* user_data), void* user_data);
126 
127 	///PlayAPI Functions useful for playback.
128 
129 	alias dal_ALmixer_GetTotalTime = ALint function(ALmixer_Data* almixer_data);
130 	alias dal_ALmixer_GetSource = ALuint function(ALint which_channel);
131 	alias dal_ALmixer_GetChannel = ALint function(ALuint al_source);
132 	alias dal_ALmixer_FindFreeChannel = ALint function(ALint start_channel);
133 	alias dal_ALmixer_PlayChannelTimed = ALint function(ALint which_channel, ALmixer_Data* almixer_data, ALint number_of_loops, ALint number_of_milliseconds);
134 	alias dal_ALmixer_PlayChannel = ALint function(ALint which_channel, ALmixer_Data* almixer_data, ALint number_of_loops);
135 	alias dal_ALmixer_PlaySourceTimed = ALuint function(ALuint al_source, ALmixer_Data* almixer_data, ALint number_of_loops, ALint number_of_milliseconds);
136 	alias dal_ALmixer_PlaySource = ALuint function(ALuint al_source, ALmixer_Data* almixer_data, ALint number_of_loops);
137 	alias dal_ALmixer_HaltChannel = ALint function(ALint which_channel);
138 	alias dal_ALmixer_HaltSource = ALint function(ALuint al_source);
139 	alias dal_ALmixer_RewindData = ALboolean function(ALmixer_Data* almixer_data);
140 	alias dal_ALmixer_RewindChannel = ALint function(ALint which_channel);
141 	alias dal_ALmixer_RewindSource = ALint function(ALuint al_source);
142 	alias dal_ALmixer_SeekData = ALboolean function(ALmixer_Data* almixer_data, ALuint msec_pos);
143 	alias dal_ALmixer_SeekChannel = ALint function(ALint which_channel, ALuint msec_pos);
144 	alias dal_ALmixer_SeekSource = ALint function(ALuint al_source, ALuint msec_pos);
145 	alias dal_ALmixer_PauseChannel = ALint function(ALint which_channel);
146 	alias dal_ALmixer_PauseSource = ALint function(ALuint al_source);
147 	alias dal_ALmixer_ResumeChannel = ALint function(ALint which_channel);
148 	alias dal_ALmixer_ResumeSource = ALint function(ALuint al_source);
149 	alias dal_ALmixer_ExpireChannel = ALint function(ALint which_channel, ALint number_of_milliseconds);
150 	alias dal_ALmixer_ExpireSource = ALint function(ALuint al_source, ALint number_of_milliseconds);
151 
152 	///VolumeAPI Volume and Fading
153 
154 	alias dal_ALmixer_FadeInChannelTimed = ALint function(ALint which_channel, ALmixer_Data* almixer_data, ALint number_of_loops, ALuint fade_ticks, ALint expire_ticks);
155 	alias dal_ALmixer_FadeInChannel = ALint function(ALint which_channel, ALmixer_Data* almixer_data, ALint number_of_loops, ALuint fade_ticks);
156 	alias dal_ALmixer_FadeInSourceTimed = ALuint function(ALuint al_source, ALmixer_Data* almixer_data, ALint number_of_loops, ALuint fade_ticks, ALint expire_ticks);
157 	alias dal_ALmixer_FadeInSource = ALuint function(ALuint al_source, ALmixer_Data* almixer_data, ALint number_of_loops, ALuint fade_ticks);
158 	alias dal_ALmixer_FadeOutChannel = ALint function(ALint which_channel, ALuint fade_ticks);
159 	alias dal_ALmixer_FadeOutSource = ALint function(ALuint al_source, ALuint fade_ticks);
160 	alias dal_ALmixer_FadeChannel = ALint function(ALint which_channel, ALuint fade_ticks, ALfloat volume);
161 	alias dal_ALmixer_FadeSource = ALint function(ALuint al_source, ALuint fade_ticks, ALfloat volume);
162 	alias dal_ALmixer_SetVolumeChannel = ALboolean function(ALint which_channel, ALfloat volume);
163 	alias dal_ALmixer_SetVolumeSource = ALboolean function(ALuint al_source, ALfloat volume);
164 	alias dal_ALmixer_GetVolumeChannel = ALfloat function(ALint which_channel);
165 	alias dal_ALmixer_GetVolumeSource = ALfloat function(ALuint al_source);
166 	alias dal_ALmixer_SetMaxVolumeChannel = ALboolean function(ALint which_channel, ALfloat volume);
167 	alias dal_ALmixer_SetMaxVolumeSource = ALboolean function(ALuint al_source, ALfloat volume);
168 	alias dal_ALmixer_GetMaxVolumeChannel = ALfloat function(ALint which_channel);
169 	alias dal_ALmixer_GetMaxVolumeSource = ALfloat function(ALuint al_source);
170 	alias dal_ALmixer_SetMinVolumeChannel = ALboolean function(ALint which_channel, ALfloat volume);
171 	alias dal_ALmixer_SetMinVolumeSource = ALboolean function(ALuint al_source, ALfloat volume);
172 	alias dal_ALmixer_GetMinVolumeChannel = ALfloat function(ALint which_channel);
173 	alias dal_ALmixer_GetMinVolumeSource = ALfloat function(ALuint al_source);
174 	alias dal_ALmixer_SetMasterVolume = ALboolean function(ALfloat new_volume);
175 	alias dal_ALmixer_GetMasterVolume = ALfloat function();
176 	
177 	///QueryAPI Query APIs
178 
179 	alias dal_ALmixer_IsActiveSource = ALint function(ALuint al_source);
180 	alias dal_ALmixer_IsPlayingChannel = ALint function(ALint which_channel);
181 	alias dal_ALmixer_IsPlayingSource = ALint function(ALuint al_source);
182 	alias dal_ALmixer_IsPausedChannel = ALint function(ALint which_channel);
183 	alias dal_ALmixer_IsPausedSource = ALint function(ALuint al_source);
184 	alias dal_ALmixer_CountAllFreeChannels = ALuint function();
185 	alias dal_ALmixer_CountUnreservedFreeChannels = ALuint function();
186 	alias dal_ALmixer_CountAllUsedChannels = ALuint function();
187 	alias dal_ALmixer_CountUnreservedUsedChannels = ALuint function();
188 	alias dal_ALmixer_CountTotalChannels = ALuint function();
189 	alias dal_ALmixer_CountReservedChannels = ALuint function();
190 	
191 	///DebugAPI Debug APIs
192 
193 	alias dal_ALmixer_OutputDecoders = void function();
194 	alias dal_ALmixer_OutputOpenALInfo = void function();
195 	alias dal_ALmixer_CompiledWithThreadBackend = ALboolean function();
196 }
197 
198 __gshared {
199 
200 	///CoreOperation Initialization, Tear-down, and Core Operational Commands
201 
202 	dal_ALmixer_GetLinkedVersion ALmixer_GetLinkedVersion;
203 	dal_ALmixer_GetError ALmixer_GetError;
204 	dal_ALmixer_SetError ALmixer_SetError;
205 	dal_ALmixer_GetTicks ALmixer_GetTicks;
206 	dal_ALmixer_Delay ALmixer_Delay;
207 	dal_ALmixer_Init ALmixer_Init;
208 	dal_ALmixer_InitContext ALmixer_InitContext;
209 	dal_ALmixer_InitMixer ALmixer_InitMixer;
210 	dal_ALmixer_BeginInterruption ALmixer_BeginInterruption;
211 	dal_ALmixer_EndInterruption ALmixer_EndInterruption;
212 	dal_ALmixer_IsInInterruption ALmixer_IsInInterruption;
213 	dal_ALmixer_SuspendUpdates ALmixer_SuspendUpdates;
214 	dal_ALmixer_ResumeUpdates ALmixer_ResumeUpdates;
215 	dal_ALmixer_AreUpdatesSuspended ALmixer_AreUpdatesSuspended;
216 	dal_ALmixer_SuspendPlayingState ALmixer_SuspendPlayingState;
217 	dal_ALmixer_ResumePlayingState ALmixer_ResumePlayingState;
218 	dal_ALmixer_IsPlayingStateSuspended ALmixer_IsPlayingStateSuspended;
219 	dal_ALmixer_Quit ALmixer_Quit;
220 	dal_ALmixer_QuitWithoutFreeData ALmixer_QuitWithoutFreeData;
221 	dal_ALmixer_IsInitialized ALmixer_IsInitialized;
222 	dal_ALmixer_GetFrequency ALmixer_GetFrequency;
223 	dal_ALmixer_AllocateChannels ALmixer_AllocateChannels;
224 	dal_ALmixer_ReserveChannels ALmixer_ReserveChannels;
225 	dal_ALmixer_Update ALmixer_Update;
226 
227 	///LoadAPI Load Audio Functions
228 
229 	dal_ALmixer_LoadSample_RW ALmixer_LoadSample_RW;
230 	dal_ALmixer_LoadStream_RW ALmixer_LoadStream_RW;
231 	dal_ALmixer_LoadAll_RW ALmixer_LoadAll_RW;
232 	dal_ALmixer_LoadSample ALmixer_LoadSample;
233 	dal_ALmixer_LoadStream ALmixer_LoadStream;
234 	dal_ALmixer_LoadAll ALmixer_LoadAll;
235 	dal_ALmixer_LoadSample_RAW_RW ALmixer_LoadSample_RAW_RW; 
236 	dal_ALmixer_LoadStream_RAW_RW ALmixer_LoadStream_RAW_RW;
237 	dal_ALmixer_LoadAll_RAW_RW ALmixer_LoadAll_RAW_RW;
238 	dal_ALmixer_LoadSample_RAW ALmixer_LoadSample_RAW;
239 	dal_ALmixer_LoadStream_RAW ALmixer_LoadStream_RAW;
240 	dal_ALmixer_LoadAll_RAW ALmixer_LoadAll_RAW;
241 	dal_ALmixer_FreeData ALmixer_FreeData;
242 	dal_ALmixer_IsPredecoded ALmixer_IsPredecoded;
243 
244 	///CallbackAPI Callbacks
245 
246 	dal_ALmixer_SetPlaybackFinishedCallback ALmixer_SetPlaybackFinishedCallback;
247 	dal_ALmixer_SetPlaybackDataCallback ALmixer_SetPlaybackDataCallback;
248 
249 	///PlayAPI Functions useful for playback.
250 
251 	dal_ALmixer_GetTotalTime ALmixer_GetTotalTime;
252 	dal_ALmixer_GetSource ALmixer_GetSource;
253 	dal_ALmixer_GetChannel ALmixer_GetChannel;
254 	dal_ALmixer_FindFreeChannel ALmixer_FindFreeChannel;
255 	dal_ALmixer_PlayChannelTimed ALmixer_PlayChannelTimed;
256 	dal_ALmixer_PlayChannel ALmixer_PlayChannel;
257 	dal_ALmixer_PlaySourceTimed ALmixer_PlaySourceTimed;
258 	dal_ALmixer_PlaySource ALmixer_PlaySource;
259 	dal_ALmixer_HaltChannel ALmixer_HaltChannel;
260 	dal_ALmixer_HaltSource ALmixer_HaltSource;
261 	dal_ALmixer_RewindData ALmixer_RewindData;
262 	dal_ALmixer_RewindChannel ALmixer_RewindChannel;
263 	dal_ALmixer_RewindSource ALmixer_RewindSource;
264 	dal_ALmixer_SeekData ALmixer_SeekData;
265 	dal_ALmixer_SeekChannel ALmixer_SeekChannel;
266 	dal_ALmixer_SeekSource ALmixer_SeekSource;
267 	dal_ALmixer_PauseChannel ALmixer_PauseChannel;
268 	dal_ALmixer_PauseSource ALmixer_PauseSource;
269 	dal_ALmixer_ResumeChannel ALmixer_ResumeChannel;
270 	dal_ALmixer_ResumeSource ALmixer_ResumeSource;
271 	dal_ALmixer_ExpireChannel ALmixer_ExpireChannel;
272 	dal_ALmixer_ExpireSource ALmixer_ExpireSource;
273 
274 	///VolumeAPI Volume and Fading
275 
276 	dal_ALmixer_FadeInChannelTimed ALmixer_FadeInChannelTimed;
277 	dal_ALmixer_FadeInChannel ALmixer_FadeInChannel;
278 	dal_ALmixer_FadeInSourceTimed ALmixer_FadeInSourceTimed;
279 	dal_ALmixer_FadeInSource ALmixer_FadeInSource;
280 	dal_ALmixer_FadeOutChannel ALmixer_FadeOutChannel;
281 	dal_ALmixer_FadeOutSource ALmixer_FadeOutSource;
282 	dal_ALmixer_FadeChannel ALmixer_FadeChannel;
283 	dal_ALmixer_FadeSource ALmixer_FadeSource;
284 	dal_ALmixer_SetVolumeChannel ALmixer_SetVolumeChannel;
285 	dal_ALmixer_SetVolumeSource ALmixer_SetVolumeSource;
286 	dal_ALmixer_GetVolumeChannel ALmixer_GetVolumeChannel;
287 	dal_ALmixer_GetVolumeSource ALmixer_GetVolumeSource;
288 	dal_ALmixer_SetMaxVolumeChannel ALmixer_SetMaxVolumeChannel;
289 	dal_ALmixer_SetMaxVolumeSource ALmixer_SetMaxVolumeSource;
290 	dal_ALmixer_GetMaxVolumeChannel ALmixer_GetMaxVolumeChannel;
291 	dal_ALmixer_GetMaxVolumeSource ALmixer_GetMaxVolumeSource;
292 	dal_ALmixer_SetMinVolumeChannel ALmixer_SetMinVolumeChannel;
293 	dal_ALmixer_SetMinVolumeSource ALmixer_SetMinVolumeSource;
294 	dal_ALmixer_GetMinVolumeChannel ALmixer_GetMinVolumeChannel;
295 	dal_ALmixer_GetMinVolumeSource ALmixer_GetMinVolumeSource;
296 	dal_ALmixer_SetMasterVolume ALmixer_SetMasterVolume;
297 	dal_ALmixer_GetMasterVolume ALmixer_GetMasterVolume;
298 
299 	///QueryAPI Query APIs
300 
301 	dal_ALmixer_IsActiveSource ALmixer_IsActiveSource;
302 	dal_ALmixer_IsPlayingChannel ALmixer_IsPlayingChannel;
303 	dal_ALmixer_IsPlayingSource ALmixer_IsPlayingSource;
304 	dal_ALmixer_IsPausedChannel ALmixer_IsPausedChannel;
305 	dal_ALmixer_IsPausedSource ALmixer_IsPausedSource;
306 	dal_ALmixer_CountAllFreeChannels ALmixer_CountAllFreeChannels;
307 	dal_ALmixer_CountUnreservedFreeChannels ALmixer_CountUnreservedFreeChannels;
308 	dal_ALmixer_CountAllUsedChannels ALmixer_CountAllUsedChannels;
309 	dal_ALmixer_CountUnreservedUsedChannels ALmixer_CountUnreservedUsedChannels;
310 	dal_ALmixer_CountTotalChannels ALmixer_CountTotalChannels;
311 	dal_ALmixer_CountReservedChannels ALmixer_CountReservedChannels;
312 
313 	///DebugAPI Debug APIs
314 
315 	dal_ALmixer_OutputDecoders ALmixer_OutputDecoders;
316 	dal_ALmixer_OutputOpenALInfo ALmixer_OutputOpenALInfo;
317 	dal_ALmixer_CompiledWithThreadBackend ALmixer_CompiledWithThreadBackend;
318 }
319 
320 class DerelictDALmixerLoader : SharedLibLoader {
321 	public this() {
322 		super( libNames );
323 	}
324 	
325 	protected override void loadSymbols() {
326 		///CoreOperation Initialization, Tear-down, and Core Operational Commands
327 		bindFunc( cast( void** )&ALmixer_GetLinkedVersion, "ALmixer_GetLinkedVersion" );
328 		bindFunc( cast( void** )&ALmixer_GetError, "ALmixer_GetError" );
329 		bindFunc( cast( void** )&ALmixer_SetError, "ALmixer_SetError" );
330 		bindFunc( cast( void** )&ALmixer_GetTicks, "ALmixer_GetTicks" );
331 		bindFunc( cast( void** )&ALmixer_Delay, "ALmixer_Delay" );
332 		bindFunc( cast( void** )&ALmixer_Init, "ALmixer_Init" );
333 		bindFunc( cast( void** )&ALmixer_InitContext, "ALmixer_InitContext" );
334 		bindFunc( cast( void** )&ALmixer_InitMixer, "ALmixer_InitMixer" );
335 		bindFunc( cast( void** )&ALmixer_BeginInterruption, "ALmixer_BeginInterruption" );
336 		bindFunc( cast( void** )&ALmixer_EndInterruption, "ALmixer_EndInterruption" );
337 		bindFunc( cast( void** )&ALmixer_IsInInterruption, "ALmixer_IsInInterruption" );
338 		bindFunc( cast( void** )&ALmixer_SuspendUpdates, "ALmixer_SuspendUpdates" );
339 		bindFunc( cast( void** )&ALmixer_ResumeUpdates, "ALmixer_ResumeUpdates" );
340 		bindFunc( cast( void** )&ALmixer_AreUpdatesSuspended, "ALmixer_AreUpdatesSuspended" );
341 		bindFunc( cast( void** )&ALmixer_SuspendPlayingState, "ALmixer_SuspendPlayingState" );
342 		bindFunc( cast( void** )&ALmixer_ResumePlayingState, "ALmixer_ResumePlayingState" );
343 		bindFunc( cast( void** )&ALmixer_IsPlayingStateSuspended, "ALmixer_IsPlayingStateSuspended" );
344 		bindFunc( cast( void** )&ALmixer_Quit, "ALmixer_Quit" );
345 		bindFunc( cast( void** )&ALmixer_QuitWithoutFreeData, "ALmixer_QuitWithoutFreeData" );
346 		bindFunc( cast( void** )&ALmixer_IsInitialized, "ALmixer_IsInitialized" );
347 		bindFunc( cast( void** )&ALmixer_GetFrequency, "ALmixer_GetFrequency" );
348 		bindFunc( cast( void** )&ALmixer_AllocateChannels, "ALmixer_AllocateChannels" );
349 		bindFunc( cast( void** )&ALmixer_ReserveChannels, "ALmixer_ReserveChannels" );
350 		bindFunc( cast( void** )&ALmixer_Update, "ALmixer_Update" );
351 		///LoadAPI Load Audio Functions
352 		bindFunc( cast( void** )&ALmixer_LoadSample_RW, "ALmixer_LoadSample_RW" );
353 		bindFunc( cast( void** )&ALmixer_LoadStream_RW, "ALmixer_LoadStream_RW" );
354 		bindFunc( cast( void** )&ALmixer_LoadAll_RW, "ALmixer_LoadAll_RW" );
355 		bindFunc( cast( void** )&ALmixer_LoadSample, "ALmixer_LoadSample" );
356 		bindFunc( cast( void** )&ALmixer_LoadStream, "ALmixer_LoadStream" );
357 		bindFunc( cast( void** )&ALmixer_LoadAll, "ALmixer_LoadAll" );
358 		bindFunc( cast( void** )&ALmixer_LoadSample_RAW_RW, "ALmixer_LoadSample_RAW_RW" );
359 		bindFunc( cast( void** )&ALmixer_LoadStream_RAW_RW, "ALmixer_LoadStream_RAW_RW" );
360 		bindFunc( cast( void** )&ALmixer_LoadAll_RAW_RW, "ALmixer_LoadAll_RAW_RW" );
361 		bindFunc( cast( void** )&ALmixer_LoadSample_RAW, "ALmixer_LoadSample_RAW" );
362 		bindFunc( cast( void** )&ALmixer_LoadStream_RAW, "ALmixer_LoadStream_RAW" );
363 		bindFunc( cast( void** )&ALmixer_LoadAll_RAW, "ALmixer_LoadAll_RAW" );
364 		bindFunc( cast( void** )&ALmixer_FreeData, "ALmixer_FreeData" );
365 		bindFunc( cast( void** )&ALmixer_IsPredecoded, "ALmixer_IsPredecoded" );
366 		///CallbackAPI Callbacks
367 		bindFunc( cast( void** )&ALmixer_SetPlaybackFinishedCallback, "ALmixer_SetPlaybackFinishedCallback" );
368 		bindFunc( cast( void** )&ALmixer_SetPlaybackDataCallback, "ALmixer_SetPlaybackDataCallback" );
369 		///PlayAPI Functions useful for playback.
370 		bindFunc( cast( void** )&ALmixer_GetTotalTime, "ALmixer_GetTotalTime" );
371 		bindFunc( cast( void** )&ALmixer_GetSource, "ALmixer_GetSource" );
372 		bindFunc( cast( void** )&ALmixer_GetChannel, "ALmixer_GetChannel" );
373 		bindFunc( cast( void** )&ALmixer_FindFreeChannel, "ALmixer_FindFreeChannel" );
374 		bindFunc( cast( void** )&ALmixer_PlayChannelTimed, "ALmixer_PlayChannelTimed" );
375 		bindFunc( cast( void** )&ALmixer_PlayChannel, "ALmixer_PlayChannel" );
376 		bindFunc( cast( void** )&ALmixer_PlaySourceTimed, "ALmixer_PlaySourceTimed" );
377 		bindFunc( cast( void** )&ALmixer_PlaySource, "ALmixer_PlaySource" );
378 		bindFunc( cast( void** )&ALmixer_HaltChannel, "ALmixer_HaltChannel" );
379 		bindFunc( cast( void** )&ALmixer_HaltSource, "ALmixer_HaltSource" );
380 		bindFunc( cast( void** )&ALmixer_RewindData, "ALmixer_RewindData" );
381 		bindFunc( cast( void** )&ALmixer_RewindChannel, "ALmixer_RewindChannel" );
382 		bindFunc( cast( void** )&ALmixer_RewindSource, "ALmixer_RewindSource" );
383 		bindFunc( cast( void** )&ALmixer_SeekData, "ALmixer_SeekData" );
384 		bindFunc( cast( void** )&ALmixer_SeekChannel, "ALmixer_SeekChannel" );
385 		bindFunc( cast( void** )&ALmixer_SeekSource, "ALmixer_SeekSource" );
386 		bindFunc( cast( void** )&ALmixer_PauseChannel, "ALmixer_PauseChannel" );
387 		bindFunc( cast( void** )&ALmixer_PauseSource, "ALmixer_PauseSource" );
388 		bindFunc( cast( void** )&ALmixer_ResumeChannel, "ALmixer_ResumeChannel" );
389 		bindFunc( cast( void** )&ALmixer_ResumeSource, "ALmixer_ResumeSource" );
390 		bindFunc( cast( void** )&ALmixer_ExpireChannel, "ALmixer_ExpireChannel" );
391 		bindFunc( cast( void** )&ALmixer_ExpireSource, "ALmixer_ExpireSource" );
392 		///VolumeAPI Volume and Fading
393 		bindFunc( cast( void** )&ALmixer_FadeInChannelTimed, "ALmixer_FadeInChannelTimed" );
394 		bindFunc( cast( void** )&ALmixer_FadeInChannel, "ALmixer_FadeInChannel" );
395 		bindFunc( cast( void** )&ALmixer_FadeInSourceTimed, "ALmixer_FadeInSourceTimed" );
396 		bindFunc( cast( void** )&ALmixer_FadeInSource, "ALmixer_FadeInSource" );
397 		bindFunc( cast( void** )&ALmixer_FadeOutChannel, "ALmixer_FadeOutChannel" );
398 		bindFunc( cast( void** )&ALmixer_FadeOutSource, "ALmixer_FadeOutSource" );
399 		bindFunc( cast( void** )&ALmixer_FadeChannel, "ALmixer_FadeChannel" );
400 		bindFunc( cast( void** )&ALmixer_FadeSource, "ALmixer_FadeSource" );
401 		bindFunc( cast( void** )&ALmixer_SetVolumeChannel, "ALmixer_SetVolumeChannel" );
402 		bindFunc( cast( void** )&ALmixer_SetVolumeSource, "ALmixer_SetVolumeSource" );
403 		bindFunc( cast( void** )&ALmixer_GetVolumeChannel, "ALmixer_GetVolumeChannel" );
404 		bindFunc( cast( void** )&ALmixer_GetVolumeSource, "ALmixer_GetVolumeSource" );
405 		bindFunc( cast( void** )&ALmixer_SetMaxVolumeChannel, "ALmixer_SetMaxVolumeChannel" );
406 		bindFunc( cast( void** )&ALmixer_SetMaxVolumeSource, "ALmixer_SetMaxVolumeSource" );
407 		bindFunc( cast( void** )&ALmixer_GetMaxVolumeChannel, "ALmixer_GetMaxVolumeChannel" );
408 		bindFunc( cast( void** )&ALmixer_GetMaxVolumeSource, "ALmixer_GetMaxVolumeSource" );
409 		bindFunc( cast( void** )&ALmixer_SetMinVolumeChannel, "ALmixer_SetMinVolumeChannel" );
410 		bindFunc( cast( void** )&ALmixer_SetMinVolumeSource, "ALmixer_SetMinVolumeSource" );
411 		bindFunc( cast( void** )&ALmixer_GetMinVolumeChannel, "ALmixer_GetMinVolumeChannel" );
412 		bindFunc( cast( void** )&ALmixer_GetMinVolumeSource, "ALmixer_GetMinVolumeSource" );
413 		bindFunc( cast( void** )&ALmixer_SetMasterVolume, "ALmixer_SetMasterVolume" );
414 		bindFunc( cast( void** )&ALmixer_GetMasterVolume, "ALmixer_GetMasterVolume" );
415 		///QueryAPI Query APIs
416 		bindFunc( cast( void** )&ALmixer_IsActiveSource, "ALmixer_IsActiveSource" );
417 		bindFunc( cast( void** )&ALmixer_IsPlayingChannel, "ALmixer_IsPlayingChannel" );
418 		bindFunc( cast( void** )&ALmixer_IsPlayingSource, "ALmixer_IsPlayingSource" );
419 		bindFunc( cast( void** )&ALmixer_IsPausedChannel, "ALmixer_IsPausedChannel" );
420 		bindFunc( cast( void** )&ALmixer_IsPausedSource, "ALmixer_IsPausedSource" );
421 		bindFunc( cast( void** )&ALmixer_CountAllFreeChannels, "ALmixer_CountAllFreeChannels" );
422 		bindFunc( cast( void** )&ALmixer_CountUnreservedFreeChannels, "ALmixer_CountUnreservedFreeChannels" );
423 		bindFunc( cast( void** )&ALmixer_CountAllUsedChannels, "ALmixer_CountAllUsedChannels" );
424 		bindFunc( cast( void** )&ALmixer_CountUnreservedUsedChannels, "ALmixer_CountUnreservedUsedChannels" );
425 		bindFunc( cast( void** )&ALmixer_CountTotalChannels, "ALmixer_CountTotalChannels" );
426 		bindFunc( cast( void** )&ALmixer_CountReservedChannels, "ALmixer_CountReservedChannels" );
427 		///DebugAPI Debug APIs
428 		bindFunc( cast( void** )&ALmixer_OutputDecoders, "ALmixer_OutputDecoders" );
429 		bindFunc( cast( void** )&ALmixer_OutputOpenALInfo, "ALmixer_OutputOpenALInfo" );
430 		bindFunc( cast( void** )&ALmixer_CompiledWithThreadBackend, "ALmixer_CompiledWithThreadBackend" );
431 	}
432 }
433 
434 __gshared DerelictDALmixerLoader DALmixer;
435 
436 shared static this() {
437 	DALmixer = new DerelictDALmixerLoader();
438 }