zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alEffect.c
Go to the documentation of this file.
1 
21 #include "config.h"
22 
23 #include <stdlib.h>
24 #include <math.h>
25 #include <float.h>
26 
27 #include "AL/al.h"
28 #include "AL/alc.h"
29 #include "alMain.h"
30 #include "alEffect.h"
31 #include "alThunk.h"
32 #include "alError.h"
33 
34 
36 
37 
38 static void InitEffectParams(ALeffect *effect, ALenum type);
39 
40 
42 {
43  ALCcontext *Context;
44  ALsizei cur = 0;
45 
46  Context = GetContextRef();
47  if(!Context) return;
48 
49  al_try
50  {
51  ALCdevice *device = Context->Device;
52  ALenum err;
53 
54  CHECK_VALUE(Context, n >= 0);
55  for(cur = 0;cur < n;cur++)
56  {
57  ALeffect *effect = calloc(1, sizeof(ALeffect));
58  err = AL_OUT_OF_MEMORY;
59  if(!effect || (err=InitEffect(effect)) != AL_NO_ERROR)
60  {
61  free(effect);
62  al_throwerr(Context, err);
63  }
64 
65  err = NewThunkEntry(&effect->id);
66  if(err == AL_NO_ERROR)
67  err = InsertUIntMapEntry(&device->EffectMap, effect->id, effect);
68  if(err != AL_NO_ERROR)
69  {
70  FreeThunkEntry(effect->id);
71  memset(effect, 0, sizeof(ALeffect));
72  free(effect);
73 
74  al_throwerr(Context, err);
75  }
76 
77  effects[cur] = effect->id;
78  }
79  }
80  al_catchany()
81  {
82  if(cur > 0)
83  alDeleteEffects(cur, effects);
84  }
85  al_endtry;
86 
87  ALCcontext_DecRef(Context);
88 }
89 
91 {
92  ALCcontext *Context;
93  ALeffect *Effect;
94  ALsizei i;
95 
96  Context = GetContextRef();
97  if(!Context) return;
98 
99  al_try
100  {
101  ALCdevice *device = Context->Device;
102  CHECK_VALUE(Context, n >= 0);
103  for(i = 0;i < n;i++)
104  {
105  if(effects[i] && LookupEffect(device, effects[i]) == NULL)
106  al_throwerr(Context, AL_INVALID_NAME);
107  }
108 
109  for(i = 0;i < n;i++)
110  {
111  if((Effect=RemoveEffect(device, effects[i])) == NULL)
112  continue;
113  FreeThunkEntry(Effect->id);
114 
115  memset(Effect, 0, sizeof(*Effect));
116  free(Effect);
117  }
118  }
119  al_endtry;
120 
121  ALCcontext_DecRef(Context);
122 }
123 
125 {
126  ALCcontext *Context;
128 
129  Context = GetContextRef();
130  if(!Context) return AL_FALSE;
131 
132  result = ((!effect || LookupEffect(Context->Device, effect)) ?
133  AL_TRUE : AL_FALSE);
134 
135  ALCcontext_DecRef(Context);
136 
137  return result;
138 }
139 
141 {
142  ALCcontext *Context;
143  ALCdevice *Device;
144  ALeffect *ALEffect;
145 
146  Context = GetContextRef();
147  if(!Context) return;
148 
149  Device = Context->Device;
150  if((ALEffect=LookupEffect(Device, effect)) == NULL)
151  alSetError(Context, AL_INVALID_NAME);
152  else
153  {
154  if(param == AL_EFFECT_TYPE)
155  {
156  ALboolean isOk = (value == AL_EFFECT_NULL);
157  ALint i;
158  for(i = 0;!isOk && EffectList[i].val;i++)
159  {
160  if(value == EffectList[i].val &&
162  isOk = AL_TRUE;
163  }
164 
165  if(isOk)
166  InitEffectParams(ALEffect, value);
167  else
168  alSetError(Context, AL_INVALID_VALUE);
169  }
170  else
171  {
172  /* Call the appropriate handler */
173  ALeffect_SetParami(ALEffect, Context, param, value);
174  }
175  }
176 
177  ALCcontext_DecRef(Context);
178 }
179 
181 {
182  ALCcontext *Context;
183  ALCdevice *Device;
184  ALeffect *ALEffect;
185 
186  switch(param)
187  {
188  case AL_EFFECT_TYPE:
189  alEffecti(effect, param, values[0]);
190  return;
191  }
192 
193  Context = GetContextRef();
194  if(!Context) return;
195 
196  Device = Context->Device;
197  if((ALEffect=LookupEffect(Device, effect)) == NULL)
198  alSetError(Context, AL_INVALID_NAME);
199  else
200  {
201  /* Call the appropriate handler */
202  ALeffect_SetParamiv(ALEffect, Context, param, values);
203  }
204 
205  ALCcontext_DecRef(Context);
206 }
207 
209 {
210  ALCcontext *Context;
211  ALCdevice *Device;
212  ALeffect *ALEffect;
213 
214  Context = GetContextRef();
215  if(!Context) return;
216 
217  Device = Context->Device;
218  if((ALEffect=LookupEffect(Device, effect)) == NULL)
219  alSetError(Context, AL_INVALID_NAME);
220  else
221  {
222  /* Call the appropriate handler */
223  ALeffect_SetParamf(ALEffect, Context, param, value);
224  }
225 
226  ALCcontext_DecRef(Context);
227 }
228 
230 {
231  ALCcontext *Context;
232  ALCdevice *Device;
233  ALeffect *ALEffect;
234 
235  Context = GetContextRef();
236  if(!Context) return;
237 
238  Device = Context->Device;
239  if((ALEffect=LookupEffect(Device, effect)) == NULL)
240  alSetError(Context, AL_INVALID_NAME);
241  else
242  {
243  /* Call the appropriate handler */
244  ALeffect_SetParamfv(ALEffect, Context, param, values);
245  }
246 
247  ALCcontext_DecRef(Context);
248 }
249 
251 {
252  ALCcontext *Context;
253  ALCdevice *Device;
254  ALeffect *ALEffect;
255 
256  Context = GetContextRef();
257  if(!Context) return;
258 
259  Device = Context->Device;
260  if((ALEffect=LookupEffect(Device, effect)) == NULL)
261  alSetError(Context, AL_INVALID_NAME);
262  else
263  {
264  if(param == AL_EFFECT_TYPE)
265  *value = ALEffect->type;
266  else
267  {
268  /* Call the appropriate handler */
269  ALeffect_GetParami(ALEffect, Context, param, value);
270  }
271  }
272 
273  ALCcontext_DecRef(Context);
274 }
275 
277 {
278  ALCcontext *Context;
279  ALCdevice *Device;
280  ALeffect *ALEffect;
281 
282  switch(param)
283  {
284  case AL_EFFECT_TYPE:
285  alGetEffecti(effect, param, values);
286  return;
287  }
288 
289  Context = GetContextRef();
290  if(!Context) return;
291 
292  Device = Context->Device;
293  if((ALEffect=LookupEffect(Device, effect)) == NULL)
294  alSetError(Context, AL_INVALID_NAME);
295  else
296  {
297  /* Call the appropriate handler */
298  ALeffect_GetParamiv(ALEffect, Context, param, values);
299  }
300 
301  ALCcontext_DecRef(Context);
302 }
303 
305 {
306  ALCcontext *Context;
307  ALCdevice *Device;
308  ALeffect *ALEffect;
309 
310  Context = GetContextRef();
311  if(!Context) return;
312 
313  Device = Context->Device;
314  if((ALEffect=LookupEffect(Device, effect)) == NULL)
315  alSetError(Context, AL_INVALID_NAME);
316  else
317  {
318  /* Call the appropriate handler */
319  ALeffect_GetParamf(ALEffect, Context, param, value);
320  }
321 
322  ALCcontext_DecRef(Context);
323 }
324 
326 {
327  ALCcontext *Context;
328  ALCdevice *Device;
329  ALeffect *ALEffect;
330 
331  Context = GetContextRef();
332  if(!Context) return;
333 
334  Device = Context->Device;
335  if((ALEffect=LookupEffect(Device, effect)) == NULL)
336  alSetError(Context, AL_INVALID_NAME);
337  else
338  {
339  /* Call the appropriate handler */
340  ALeffect_GetParamfv(ALEffect, Context, param, values);
341  }
342 
343  ALCcontext_DecRef(Context);
344 }
345 
346 
348 {
349  switch(param)
350  {
353  effect->Reverb.DecayHFLimit = val;
354  else
355  alSetError(context, AL_INVALID_VALUE);
356  break;
357 
358  default:
359  alSetError(context, AL_INVALID_ENUM);
360  break;
361  }
362 }
363 static void eaxreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
364 {
365  eaxreverb_SetParami(effect, context, param, vals[0]);
366 }
368 {
369  switch(param)
370  {
372  if(val >= AL_EAXREVERB_MIN_DENSITY &&
374  effect->Reverb.Density = val;
375  else
376  alSetError(context, AL_INVALID_VALUE);
377  break;
378 
380  if(val >= AL_EAXREVERB_MIN_DIFFUSION &&
382  effect->Reverb.Diffusion = val;
383  else
384  alSetError(context, AL_INVALID_VALUE);
385  break;
386 
387  case AL_EAXREVERB_GAIN:
388  if(val >= AL_EAXREVERB_MIN_GAIN &&
389  val <= AL_EAXREVERB_MAX_GAIN)
390  effect->Reverb.Gain = val;
391  else
392  alSetError(context, AL_INVALID_VALUE);
393  break;
394 
395  case AL_EAXREVERB_GAINHF:
396  if(val >= AL_EAXREVERB_MIN_GAINHF &&
398  effect->Reverb.GainHF = val;
399  else
400  alSetError(context, AL_INVALID_VALUE);
401  break;
402 
403  case AL_EAXREVERB_GAINLF:
404  if(val >= AL_EAXREVERB_MIN_GAINLF &&
406  effect->Reverb.GainLF = val;
407  else
408  alSetError(context, AL_INVALID_VALUE);
409  break;
410 
412  if(val >= AL_EAXREVERB_MIN_DECAY_TIME &&
414  effect->Reverb.DecayTime = val;
415  else
416  alSetError(context, AL_INVALID_VALUE);
417  break;
418 
420  if(val >= AL_EAXREVERB_MIN_DECAY_HFRATIO &&
422  effect->Reverb.DecayHFRatio = val;
423  else
424  alSetError(context, AL_INVALID_VALUE);
425  break;
426 
428  if(val >= AL_EAXREVERB_MIN_DECAY_LFRATIO &&
430  effect->Reverb.DecayLFRatio = val;
431  else
432  alSetError(context, AL_INVALID_VALUE);
433  break;
434 
438  effect->Reverb.ReflectionsGain = val;
439  else
440  alSetError(context, AL_INVALID_VALUE);
441  break;
442 
446  effect->Reverb.ReflectionsDelay = val;
447  else
448  alSetError(context, AL_INVALID_VALUE);
449  break;
450 
454  effect->Reverb.LateReverbGain = val;
455  else
456  alSetError(context, AL_INVALID_VALUE);
457  break;
458 
462  effect->Reverb.LateReverbDelay = val;
463  else
464  alSetError(context, AL_INVALID_VALUE);
465  break;
466 
470  effect->Reverb.AirAbsorptionGainHF = val;
471  else
472  alSetError(context, AL_INVALID_VALUE);
473  break;
474 
476  if(val >= AL_EAXREVERB_MIN_ECHO_TIME &&
478  effect->Reverb.EchoTime = val;
479  else
480  alSetError(context, AL_INVALID_VALUE);
481  break;
482 
484  if(val >= AL_EAXREVERB_MIN_ECHO_DEPTH &&
486  effect->Reverb.EchoDepth = val;
487  else
488  alSetError(context, AL_INVALID_VALUE);
489  break;
490 
494  effect->Reverb.ModulationTime = val;
495  else
496  alSetError(context, AL_INVALID_VALUE);
497  break;
498 
502  effect->Reverb.ModulationDepth = val;
503  else
504  alSetError(context, AL_INVALID_VALUE);
505  break;
506 
508  if(val >= AL_EAXREVERB_MIN_HFREFERENCE &&
510  effect->Reverb.HFReference = val;
511  else
512  alSetError(context, AL_INVALID_VALUE);
513  break;
514 
516  if(val >= AL_EAXREVERB_MIN_LFREFERENCE &&
518  effect->Reverb.LFReference = val;
519  else
520  alSetError(context, AL_INVALID_VALUE);
521  break;
522 
524  if(val >= 0.0f && val <= 10.0f)
525  effect->Reverb.RoomRolloffFactor = val;
526  else
527  alSetError(context, AL_INVALID_VALUE);
528  break;
529 
530  default:
531  alSetError(context, AL_INVALID_ENUM);
532  break;
533  }
534 }
535 static void eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
536 {
537  switch(param)
538  {
540  if(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))
541  {
542  LockContext(context);
543  effect->Reverb.ReflectionsPan[0] = vals[0];
544  effect->Reverb.ReflectionsPan[1] = vals[1];
545  effect->Reverb.ReflectionsPan[2] = vals[2];
546  UnlockContext(context);
547  }
548  else
549  alSetError(context, AL_INVALID_VALUE);
550  break;
552  if(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))
553  {
554  LockContext(context);
555  effect->Reverb.LateReverbPan[0] = vals[0];
556  effect->Reverb.LateReverbPan[1] = vals[1];
557  effect->Reverb.LateReverbPan[2] = vals[2];
558  UnlockContext(context);
559  }
560  else
561  alSetError(context, AL_INVALID_VALUE);
562  break;
563 
564  default:
565  eaxreverb_SetParamf(effect, context, param, vals[0]);
566  break;
567  }
568 }
569 
571 {
572  switch(param)
573  {
575  *val = effect->Reverb.DecayHFLimit;
576  break;
577 
578  default:
579  alSetError(context, AL_INVALID_ENUM);
580  break;
581  }
582 }
584 {
585  eaxreverb_GetParami(effect, context, param, vals);
586 }
588 {
589  switch(param)
590  {
592  *val = effect->Reverb.Density;
593  break;
594 
596  *val = effect->Reverb.Diffusion;
597  break;
598 
599  case AL_EAXREVERB_GAIN:
600  *val = effect->Reverb.Gain;
601  break;
602 
603  case AL_EAXREVERB_GAINHF:
604  *val = effect->Reverb.GainHF;
605  break;
606 
607  case AL_EAXREVERB_GAINLF:
608  *val = effect->Reverb.GainLF;
609  break;
610 
612  *val = effect->Reverb.DecayTime;
613  break;
614 
616  *val = effect->Reverb.DecayHFRatio;
617  break;
618 
620  *val = effect->Reverb.DecayLFRatio;
621  break;
622 
624  *val = effect->Reverb.ReflectionsGain;
625  break;
626 
628  *val = effect->Reverb.ReflectionsDelay;
629  break;
630 
632  *val = effect->Reverb.LateReverbGain;
633  break;
634 
636  *val = effect->Reverb.LateReverbDelay;
637  break;
638 
640  *val = effect->Reverb.AirAbsorptionGainHF;
641  break;
642 
644  *val = effect->Reverb.EchoTime;
645  break;
646 
648  *val = effect->Reverb.EchoDepth;
649  break;
650 
652  *val = effect->Reverb.ModulationTime;
653  break;
654 
656  *val = effect->Reverb.ModulationDepth;
657  break;
658 
660  *val = effect->Reverb.HFReference;
661  break;
662 
664  *val = effect->Reverb.LFReference;
665  break;
666 
668  *val = effect->Reverb.RoomRolloffFactor;
669  break;
670 
671  default:
672  alSetError(context, AL_INVALID_ENUM);
673  break;
674  }
675 }
677 {
678  switch(param)
679  {
681  LockContext(context);
682  vals[0] = effect->Reverb.ReflectionsPan[0];
683  vals[1] = effect->Reverb.ReflectionsPan[1];
684  vals[2] = effect->Reverb.ReflectionsPan[2];
685  UnlockContext(context);
686  break;
688  LockContext(context);
689  vals[0] = effect->Reverb.LateReverbPan[0];
690  vals[1] = effect->Reverb.LateReverbPan[1];
691  vals[2] = effect->Reverb.LateReverbPan[2];
692  UnlockContext(context);
693  break;
694 
695  default:
696  eaxreverb_GetParamf(effect, context, param, vals);
697  break;
698  }
699 }
700 
701 
703 {
704  switch(param)
705  {
707  if(val >= AL_REVERB_MIN_DECAY_HFLIMIT &&
709  effect->Reverb.DecayHFLimit = val;
710  else
711  alSetError(context, AL_INVALID_VALUE);
712  break;
713 
714  default:
715  alSetError(context, AL_INVALID_ENUM);
716  break;
717  }
718 }
719 static void reverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
720 {
721  reverb_SetParami(effect, context, param, vals[0]);
722 }
724 {
725  switch(param)
726  {
727  case AL_REVERB_DENSITY:
728  if(val >= AL_REVERB_MIN_DENSITY &&
729  val <= AL_REVERB_MAX_DENSITY)
730  effect->Reverb.Density = val;
731  else
732  alSetError(context, AL_INVALID_VALUE);
733  break;
734 
735  case AL_REVERB_DIFFUSION:
736  if(val >= AL_REVERB_MIN_DIFFUSION &&
738  effect->Reverb.Diffusion = val;
739  else
740  alSetError(context, AL_INVALID_VALUE);
741  break;
742 
743  case AL_REVERB_GAIN:
744  if(val >= AL_REVERB_MIN_GAIN &&
745  val <= AL_REVERB_MAX_GAIN)
746  effect->Reverb.Gain = val;
747  else
748  alSetError(context, AL_INVALID_VALUE);
749  break;
750 
751  case AL_REVERB_GAINHF:
752  if(val >= AL_REVERB_MIN_GAINHF &&
753  val <= AL_REVERB_MAX_GAINHF)
754  effect->Reverb.GainHF = val;
755  else
756  alSetError(context, AL_INVALID_VALUE);
757  break;
758 
760  if(val >= AL_REVERB_MIN_DECAY_TIME &&
762  effect->Reverb.DecayTime = val;
763  else
764  alSetError(context, AL_INVALID_VALUE);
765  break;
766 
768  if(val >= AL_REVERB_MIN_DECAY_HFRATIO &&
770  effect->Reverb.DecayHFRatio = val;
771  else
772  alSetError(context, AL_INVALID_VALUE);
773  break;
774 
776  if(val >= AL_REVERB_MIN_REFLECTIONS_GAIN &&
778  effect->Reverb.ReflectionsGain = val;
779  else
780  alSetError(context, AL_INVALID_VALUE);
781  break;
782 
786  effect->Reverb.ReflectionsDelay = val;
787  else
788  alSetError(context, AL_INVALID_VALUE);
789  break;
790 
792  if(val >= AL_REVERB_MIN_LATE_REVERB_GAIN &&
794  effect->Reverb.LateReverbGain = val;
795  else
796  alSetError(context, AL_INVALID_VALUE);
797  break;
798 
802  effect->Reverb.LateReverbDelay = val;
803  else
804  alSetError(context, AL_INVALID_VALUE);
805  break;
806 
810  effect->Reverb.AirAbsorptionGainHF = val;
811  else
812  alSetError(context, AL_INVALID_VALUE);
813  break;
814 
818  effect->Reverb.RoomRolloffFactor = val;
819  else
820  alSetError(context, AL_INVALID_VALUE);
821  break;
822 
823  default:
824  alSetError(context, AL_INVALID_ENUM);
825  break;
826  }
827 }
828 static void reverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
829 {
830  reverb_SetParamf(effect, context, param, vals[0]);
831 }
832 
834 {
835  switch(param)
836  {
838  *val = effect->Reverb.DecayHFLimit;
839  break;
840 
841  default:
842  alSetError(context, AL_INVALID_ENUM);
843  break;
844  }
845 }
847 {
848  reverb_GetParami(effect, context, param, vals);
849 }
851 {
852  switch(param)
853  {
854  case AL_REVERB_DENSITY:
855  *val = effect->Reverb.Density;
856  break;
857 
858  case AL_REVERB_DIFFUSION:
859  *val = effect->Reverb.Diffusion;
860  break;
861 
862  case AL_REVERB_GAIN:
863  *val = effect->Reverb.Gain;
864  break;
865 
866  case AL_REVERB_GAINHF:
867  *val = effect->Reverb.GainHF;
868  break;
869 
871  *val = effect->Reverb.DecayTime;
872  break;
873 
875  *val = effect->Reverb.DecayHFRatio;
876  break;
877 
879  *val = effect->Reverb.ReflectionsGain;
880  break;
881 
883  *val = effect->Reverb.ReflectionsDelay;
884  break;
885 
887  *val = effect->Reverb.LateReverbGain;
888  break;
889 
891  *val = effect->Reverb.LateReverbDelay;
892  break;
893 
895  *val = effect->Reverb.AirAbsorptionGainHF;
896  break;
897 
899  *val = effect->Reverb.RoomRolloffFactor;
900  break;
901 
902  default:
903  alSetError(context, AL_INVALID_ENUM);
904  break;
905  }
906 }
908 {
909  reverb_GetParamf(effect, context, param, vals);
910 }
911 
912 
914 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
915 static void echo_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
916 {
917  echo_SetParami(effect, context, param, vals[0]);
918 }
920 {
921  switch(param)
922  {
923  case AL_ECHO_DELAY:
924  if(val >= AL_ECHO_MIN_DELAY && val <= AL_ECHO_MAX_DELAY)
925  effect->Echo.Delay = val;
926  else
927  alSetError(context, AL_INVALID_VALUE);
928  break;
929 
930  case AL_ECHO_LRDELAY:
931  if(val >= AL_ECHO_MIN_LRDELAY && val <= AL_ECHO_MAX_LRDELAY)
932  effect->Echo.LRDelay = val;
933  else
934  alSetError(context, AL_INVALID_VALUE);
935  break;
936 
937  case AL_ECHO_DAMPING:
938  if(val >= AL_ECHO_MIN_DAMPING && val <= AL_ECHO_MAX_DAMPING)
939  effect->Echo.Damping = val;
940  else
941  alSetError(context, AL_INVALID_VALUE);
942  break;
943 
944  case AL_ECHO_FEEDBACK:
945  if(val >= AL_ECHO_MIN_FEEDBACK && val <= AL_ECHO_MAX_FEEDBACK)
946  effect->Echo.Feedback = val;
947  else
948  alSetError(context, AL_INVALID_VALUE);
949  break;
950 
951  case AL_ECHO_SPREAD:
952  if(val >= AL_ECHO_MIN_SPREAD && val <= AL_ECHO_MAX_SPREAD)
953  effect->Echo.Spread = val;
954  else
955  alSetError(context, AL_INVALID_VALUE);
956  break;
957 
958  default:
959  alSetError(context, AL_INVALID_ENUM);
960  break;
961  }
962 }
963 static void echo_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
964 {
965  echo_SetParamf(effect, context, param, vals[0]);
966 }
967 
969 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
971 {
972  echo_GetParami(effect, context, param, vals);
973 }
975 {
976  switch(param)
977  {
978  case AL_ECHO_DELAY:
979  *val = effect->Echo.Delay;
980  break;
981 
982  case AL_ECHO_LRDELAY:
983  *val = effect->Echo.LRDelay;
984  break;
985 
986  case AL_ECHO_DAMPING:
987  *val = effect->Echo.Damping;
988  break;
989 
990  case AL_ECHO_FEEDBACK:
991  *val = effect->Echo.Feedback;
992  break;
993 
994  case AL_ECHO_SPREAD:
995  *val = effect->Echo.Spread;
996  break;
997 
998  default:
999  alSetError(context, AL_INVALID_ENUM);
1000  break;
1001  }
1002 }
1004 {
1005  echo_GetParamf(effect, context, param, vals);
1006 }
1007 
1008 
1010 {
1011  switch(param)
1012  {
1014  if(val >= AL_RING_MODULATOR_MIN_FREQUENCY &&
1016  effect->Modulator.Frequency = val;
1017  else
1018  alSetError(context, AL_INVALID_VALUE);
1019  break;
1020 
1024  effect->Modulator.HighPassCutoff = val;
1025  else
1026  alSetError(context, AL_INVALID_VALUE);
1027  break;
1028 
1029  default:
1030  alSetError(context, AL_INVALID_ENUM);
1031  break;
1032  }
1033 }
1034 static void mod_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
1035 {
1036  mod_SetParamf(effect, context, param, vals[0]);
1037 }
1039 {
1040  switch(param)
1041  {
1044  mod_SetParamf(effect, context, param, (ALfloat)val);
1045  break;
1046 
1048  if(val >= AL_RING_MODULATOR_MIN_WAVEFORM &&
1050  effect->Modulator.Waveform = val;
1051  else
1052  alSetError(context, AL_INVALID_VALUE);
1053  break;
1054 
1055  default:
1056  alSetError(context, AL_INVALID_ENUM);
1057  break;
1058  }
1059 }
1060 static void mod_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
1061 {
1062  mod_SetParami(effect, context, param, vals[0]);
1063 }
1064 
1066 {
1067  switch(param)
1068  {
1070  *val = (ALint)effect->Modulator.Frequency;
1071  break;
1073  *val = (ALint)effect->Modulator.HighPassCutoff;
1074  break;
1076  *val = effect->Modulator.Waveform;
1077  break;
1078 
1079  default:
1080  alSetError(context, AL_INVALID_ENUM);
1081  break;
1082  }
1083 }
1085 {
1086  mod_GetParami(effect, context, param, vals);
1087 }
1089 {
1090  switch(param)
1091  {
1093  *val = effect->Modulator.Frequency;
1094  break;
1096  *val = effect->Modulator.HighPassCutoff;
1097  break;
1098 
1099  default:
1100  alSetError(context, AL_INVALID_ENUM);
1101  break;
1102  }
1103 }
1105 {
1106  mod_GetParamf(effect, context, param, vals);
1107 }
1108 
1109 
1111 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
1112 static void ded_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
1113 {
1114  ded_SetParami(effect, context, param, vals[0]);
1115 }
1117 {
1118  switch(param)
1119  {
1120  case AL_DEDICATED_GAIN:
1121  if(val >= 0.0f && isfinite(val))
1122  effect->Dedicated.Gain = val;
1123  else
1124  alSetError(context, AL_INVALID_VALUE);
1125  break;
1126 
1127  default:
1128  alSetError(context, AL_INVALID_ENUM);
1129  break;
1130  }
1131 }
1132 static void ded_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
1133 {
1134  ded_SetParamf(effect, context, param, vals[0]);
1135 }
1136 
1138 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
1140 {
1141  ded_GetParami(effect, context, param, vals);
1142 }
1144 {
1145  switch(param)
1146  {
1147  case AL_DEDICATED_GAIN:
1148  *val = effect->Dedicated.Gain;
1149  break;
1150 
1151  default:
1152  alSetError(context, AL_INVALID_ENUM);
1153  break;
1154  }
1155 }
1157 {
1158  ded_GetParamf(effect, context, param, vals);
1159 }
1160 
1161 
1163 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
1164 static void null_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
1165 { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
1167 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
1168 static void null_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
1169 { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
1170 
1172 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
1174 { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
1176 { (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
1178 { (void)effect;(void)param;(void)vals; alSetError(context, AL_INVALID_ENUM); }
1179 
1180 
1182 {
1184  return AL_NO_ERROR;
1185 }
1186 
1188 {
1189  ALsizei i;
1190  for(i = 0;i < device->EffectMap.size;i++)
1191  {
1192  ALeffect *temp = device->EffectMap.array[i].value;
1193  device->EffectMap.array[i].value = NULL;
1194 
1195  // Release effect structure
1196  FreeThunkEntry(temp->id);
1197  memset(temp, 0, sizeof(ALeffect));
1198  free(temp);
1199  }
1200 }
1201 
1202 
1203 static void InitEffectParams(ALeffect *effect, ALenum type)
1204 {
1205  switch(type)
1206  {
1207  case AL_EFFECT_EAXREVERB:
1235  effect->SetParami = eaxreverb_SetParami;
1236  effect->SetParamiv = eaxreverb_SetParamiv;
1237  effect->SetParamf = eaxreverb_SetParamf;
1238  effect->SetParamfv = eaxreverb_SetParamfv;
1239  effect->GetParami = eaxreverb_GetParami;
1240  effect->GetParamiv = eaxreverb_GetParamiv;
1241  effect->GetParamf = eaxreverb_GetParamf;
1242  effect->GetParamfv = eaxreverb_GetParamfv;
1243  break;
1244  case AL_EFFECT_REVERB:
1258  effect->SetParami = reverb_SetParami;
1259  effect->SetParamiv = reverb_SetParamiv;
1260  effect->SetParamf = reverb_SetParamf;
1261  effect->SetParamfv = reverb_SetParamfv;
1262  effect->GetParami = reverb_GetParami;
1263  effect->GetParamiv = reverb_GetParamiv;
1264  effect->GetParamf = reverb_GetParamf;
1265  effect->GetParamfv = reverb_GetParamfv;
1266  break;
1267  case AL_EFFECT_ECHO:
1268  effect->Echo.Delay = AL_ECHO_DEFAULT_DELAY;
1273  effect->SetParami = echo_SetParami;
1274  effect->SetParamiv = echo_SetParamiv;
1275  effect->SetParamf = echo_SetParamf;
1276  effect->SetParamfv = echo_SetParamfv;
1277  effect->GetParami = echo_GetParami;
1278  effect->GetParamiv = echo_GetParamiv;
1279  effect->GetParamf = echo_GetParamf;
1280  effect->GetParamfv = echo_GetParamfv;
1281  break;
1286  effect->SetParami = mod_SetParami;
1287  effect->SetParamiv = mod_SetParamiv;
1288  effect->SetParamf = mod_SetParamf;
1289  effect->SetParamfv = mod_SetParamfv;
1290  effect->GetParami = mod_GetParami;
1291  effect->GetParamiv = mod_GetParamiv;
1292  effect->GetParamf = mod_GetParamf;
1293  effect->GetParamfv = mod_GetParamfv;
1294  break;
1297  effect->Dedicated.Gain = 1.0f;
1298  effect->SetParami = ded_SetParami;
1299  effect->SetParamiv = ded_SetParamiv;
1300  effect->SetParamf = ded_SetParamf;
1301  effect->SetParamfv = ded_SetParamfv;
1302  effect->GetParami = ded_GetParami;
1303  effect->GetParamiv = ded_GetParamiv;
1304  effect->GetParamf = ded_GetParamf;
1305  effect->GetParamfv = ded_GetParamfv;
1306  break;
1307  default:
1308  effect->SetParami = null_SetParami;
1309  effect->SetParamiv = null_SetParamiv;
1310  effect->SetParamf = null_SetParamf;
1311  effect->SetParamfv = null_SetParamfv;
1312  effect->GetParami = null_GetParami;
1313  effect->GetParamiv = null_GetParamiv;
1314  effect->GetParamf = null_GetParamf;
1315  effect->GetParamfv = null_GetParamfv;
1316  break;
1317  }
1318  effect->type = type;
1319 }
1320 
1321 
1322 #include "AL/efx-presets.h"
1323 
1324 #define DECL(x) { #x, EFX_REVERB_PRESET_##x }
1325 static const struct {
1326  const char name[32];
1328 } reverblist[] = {
1329  DECL(GENERIC),
1330  DECL(PADDEDCELL),
1331  DECL(ROOM),
1332  DECL(BATHROOM),
1333  DECL(LIVINGROOM),
1334  DECL(STONEROOM),
1335  DECL(AUDITORIUM),
1336  DECL(CONCERTHALL),
1337  DECL(CAVE),
1338  DECL(ARENA),
1339  DECL(HANGAR),
1340  DECL(CARPETEDHALLWAY),
1341  DECL(HALLWAY),
1342  DECL(STONECORRIDOR),
1343  DECL(ALLEY),
1344  DECL(FOREST),
1345  DECL(CITY),
1346  DECL(MOUNTAINS),
1347  DECL(QUARRY),
1348  DECL(PLAIN),
1349  DECL(PARKINGLOT),
1350  DECL(SEWERPIPE),
1351  DECL(UNDERWATER),
1352  DECL(DRUGGED),
1353  DECL(DIZZY),
1354  DECL(PSYCHOTIC),
1355 
1356  DECL(CASTLE_SMALLROOM),
1357  DECL(CASTLE_SHORTPASSAGE),
1358  DECL(CASTLE_MEDIUMROOM),
1359  DECL(CASTLE_LARGEROOM),
1360  DECL(CASTLE_LONGPASSAGE),
1361  DECL(CASTLE_HALL),
1362  DECL(CASTLE_CUPBOARD),
1363  DECL(CASTLE_COURTYARD),
1364  DECL(CASTLE_ALCOVE),
1365 
1366  DECL(FACTORY_SMALLROOM),
1367  DECL(FACTORY_SHORTPASSAGE),
1368  DECL(FACTORY_MEDIUMROOM),
1369  DECL(FACTORY_LARGEROOM),
1370  DECL(FACTORY_LONGPASSAGE),
1371  DECL(FACTORY_HALL),
1372  DECL(FACTORY_CUPBOARD),
1373  DECL(FACTORY_COURTYARD),
1374  DECL(FACTORY_ALCOVE),
1375 
1376  DECL(ICEPALACE_SMALLROOM),
1377  DECL(ICEPALACE_SHORTPASSAGE),
1378  DECL(ICEPALACE_MEDIUMROOM),
1379  DECL(ICEPALACE_LARGEROOM),
1380  DECL(ICEPALACE_LONGPASSAGE),
1381  DECL(ICEPALACE_HALL),
1382  DECL(ICEPALACE_CUPBOARD),
1383  DECL(ICEPALACE_COURTYARD),
1384  DECL(ICEPALACE_ALCOVE),
1385 
1386  DECL(SPACESTATION_SMALLROOM),
1387  DECL(SPACESTATION_SHORTPASSAGE),
1388  DECL(SPACESTATION_MEDIUMROOM),
1389  DECL(SPACESTATION_LARGEROOM),
1390  DECL(SPACESTATION_LONGPASSAGE),
1391  DECL(SPACESTATION_HALL),
1392  DECL(SPACESTATION_CUPBOARD),
1393  DECL(SPACESTATION_ALCOVE),
1394 
1395  DECL(WOODEN_SMALLROOM),
1396  DECL(WOODEN_SHORTPASSAGE),
1397  DECL(WOODEN_MEDIUMROOM),
1398  DECL(WOODEN_LARGEROOM),
1399  DECL(WOODEN_LONGPASSAGE),
1400  DECL(WOODEN_HALL),
1401  DECL(WOODEN_CUPBOARD),
1402  DECL(WOODEN_COURTYARD),
1403  DECL(WOODEN_ALCOVE),
1404 
1405  DECL(SPORT_EMPTYSTADIUM),
1406  DECL(SPORT_SQUASHCOURT),
1407  DECL(SPORT_SMALLSWIMMINGPOOL),
1408  DECL(SPORT_LARGESWIMMINGPOOL),
1409  DECL(SPORT_GYMNASIUM),
1410  DECL(SPORT_FULLSTADIUM),
1411  DECL(SPORT_STADIUMTANNOY),
1412 
1413  DECL(PREFAB_WORKSHOP),
1414  DECL(PREFAB_SCHOOLROOM),
1415  DECL(PREFAB_PRACTISEROOM),
1416  DECL(PREFAB_OUTHOUSE),
1417  DECL(PREFAB_CARAVAN),
1418 
1419  DECL(DOME_TOMB),
1420  DECL(PIPE_SMALL),
1421  DECL(DOME_SAINTPAULS),
1422  DECL(PIPE_LONGTHIN),
1423  DECL(PIPE_LARGE),
1424  DECL(PIPE_RESONANT),
1425 
1426  DECL(OUTDOORS_BACKYARD),
1427  DECL(OUTDOORS_ROLLINGPLAINS),
1428  DECL(OUTDOORS_DEEPCANYON),
1429  DECL(OUTDOORS_CREEK),
1430  DECL(OUTDOORS_VALLEY),
1431 
1432  DECL(MOOD_HEAVEN),
1433  DECL(MOOD_HELL),
1434  DECL(MOOD_MEMORY),
1435 
1436  DECL(DRIVING_COMMENTATOR),
1437  DECL(DRIVING_PITGARAGE),
1438  DECL(DRIVING_INCAR_RACER),
1439  DECL(DRIVING_INCAR_SPORTS),
1440  DECL(DRIVING_INCAR_LUXURY),
1441  DECL(DRIVING_FULLGRANDSTAND),
1442  DECL(DRIVING_EMPTYGRANDSTAND),
1443  DECL(DRIVING_TUNNEL),
1444 
1445  DECL(CITY_STREETS),
1446  DECL(CITY_SUBWAY),
1447  DECL(CITY_MUSEUM),
1448  DECL(CITY_LIBRARY),
1449  DECL(CITY_UNDERPASS),
1450  DECL(CITY_ABANDONED),
1451 
1452  DECL(DUSTYROOM),
1453  DECL(CHAPEL),
1454  DECL(SMALLWATERROOM),
1455 };
1456 #undef DECL
1458 
1459 ALvoid LoadReverbPreset(const char *name, ALeffect *effect)
1460 {
1461  int i;
1462 
1463  if(strcasecmp(name, "NONE") == 0)
1464  {
1466  TRACE("Loading reverb '%s'\n", "NONE");
1467  return;
1468  }
1469 
1472  else if(!DisabledEffects[REVERB])
1474  else
1476  for(i = 0;i < reverblistsize;i++)
1477  {
1479 
1480  if(strcasecmp(name, reverblist[i].name) != 0)
1481  continue;
1482 
1483  TRACE("Loading reverb '%s'\n", reverblist[i].name);
1484  props = &reverblist[i].props;
1485  effect->Reverb.Density = props->flDensity;
1486  effect->Reverb.Diffusion = props->flDiffusion;
1487  effect->Reverb.Gain = props->flGain;
1488  effect->Reverb.GainHF = props->flGainHF;
1489  effect->Reverb.GainLF = props->flGainLF;
1490  effect->Reverb.DecayTime = props->flDecayTime;
1491  effect->Reverb.DecayHFRatio = props->flDecayHFRatio;
1492  effect->Reverb.DecayLFRatio = props->flDecayLFRatio;
1493  effect->Reverb.ReflectionsGain = props->flReflectionsGain;
1494  effect->Reverb.ReflectionsDelay = props->flReflectionsDelay;
1495  effect->Reverb.ReflectionsPan[0] = props->flReflectionsPan[0];
1496  effect->Reverb.ReflectionsPan[1] = props->flReflectionsPan[1];
1497  effect->Reverb.ReflectionsPan[2] = props->flReflectionsPan[2];
1498  effect->Reverb.LateReverbGain = props->flLateReverbGain;
1499  effect->Reverb.LateReverbDelay = props->flLateReverbDelay;
1500  effect->Reverb.LateReverbPan[0] = props->flLateReverbPan[0];
1501  effect->Reverb.LateReverbPan[1] = props->flLateReverbPan[1];
1502  effect->Reverb.LateReverbPan[2] = props->flLateReverbPan[2];
1503  effect->Reverb.EchoTime = props->flEchoTime;
1504  effect->Reverb.EchoDepth = props->flEchoDepth;
1505  effect->Reverb.ModulationTime = props->flModulationTime;
1506  effect->Reverb.ModulationDepth = props->flModulationDepth;
1508  effect->Reverb.HFReference = props->flHFReference;
1509  effect->Reverb.LFReference = props->flLFReference;
1510  effect->Reverb.RoomRolloffFactor = props->flRoomRolloffFactor;
1511  effect->Reverb.DecayHFLimit = props->iDecayHFLimit;
1512  break;
1513  }
1514  if(i == reverblistsize)
1515  WARN("Reverb preset '%s' not found\n", name);
1516 }
ALfloat GainHF
Definition: alEffect.h:34
#define ALeffect_GetParamfv(x, c, p, v)
Definition: alEffect.h:100
#define AL_EAXREVERB_LATE_REVERB_DELAY
Definition: efx.h:63
ALfloat Spread
Definition: alEffect.h:65
#define AL_APIENTRY
Definition: al.h:21
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY
Definition: efx.h:420
#define AL_REVERB_MAX_DENSITY
Definition: efx.h:320
#define AL_EAXREVERB_DEFAULT_DIFFUSION
Definition: efx.h:378
#define AL_EAXREVERB_LATE_REVERB_GAIN
Definition: efx.h:62
#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY
Definition: efx.h:349
#define AL_REVERB_GAIN
Definition: efx.h:38
void FreeThunkEntry(ALuint index)
Definition: alThunk.c:83
#define AL_EFFECT_TYPE
Definition: efx.h:151
#define AL_REVERB_MAX_LATE_REVERB_DELAY
Definition: efx.h:356
GLuint const GLfloat * val
Definition: glew.h:2715
#define AL_REVERB_MIN_DIFFUSION
Definition: efx.h:323
#define AL_REVERB_MIN_DECAY_HFLIMIT
Definition: efx.h:367
GLenum GLuint GLsizei const GLenum * props
Definition: glew.h:5068
static void null_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.c:1168
#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY
Definition: efx.h:409
static void null_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.c:1173
void ALvoid
Definition: al.h:74
GLenum GLint param
Definition: gl2ext.h:1491
#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF
Definition: efx.h:360
void(* SetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.h:81
static void echo_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.c:968
#define AL_ECHO_MAX_FEEDBACK
Definition: efx.h:523
#define AL_REVERB_REFLECTIONS_GAIN
Definition: efx.h:42
static void ded_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.c:1143
struct ALeffect::@52 Reverb
#define AL_EAXREVERB_DIFFUSION
Definition: efx.h:52
static void ded_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.c:1116
void(* GetParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.h:83
static void mod_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.c:1038
ALfloat Frequency
Definition: alEffect.h:69
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
#define CHECK_VALUE(ctx, cond)
Definition: alMain.h:875
#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN
Definition: efx.h:415
#define AL_TRUE
Definition: al.h:86
#define AL_REVERB_LATE_REVERB_DELAY
Definition: efx.h:45
ALfloat ModulationTime
Definition: alEffect.h:52
#define AL_EAXREVERB_MIN_GAIN
Definition: efx.h:380
#define NULL
Definition: ftobjs.h:61
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN
Definition: efx.h:406
#define TRACE(...)
Definition: alMain.h:806
#define AL_REVERB_MAX_DIFFUSION
Definition: efx.h:324
ALfloat LFReference
Definition: alEffect.h:55
static void ded_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.c:1139
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
Definition: efx.h:422
GLclampf f
Definition: glew.h:3390
#define AL_ECHO_DEFAULT_FEEDBACK
Definition: efx.h:524
struct UIntMap::@59 * array
#define AL_REVERB_MAX_GAINHF
Definition: efx.h:332
#define AL_EAXREVERB_ECHO_TIME
Definition: efx.h:65
#define AL_EAXREVERB_MAX_GAINLF
Definition: efx.h:389
#define AL_EAXREVERB_REFLECTIONS_DELAY
Definition: efx.h:60
static void reverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.c:828
static void null_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.c:1166
#define AL_ECHO_FEEDBACK
Definition: efx.h:94
static void echo_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.c:974
#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR
Definition: efx.h:364
#define AL_EAXREVERB_DEFAULT_HFREFERENCE
Definition: efx.h:446
#define AL_REVERB_MIN_GAIN
Definition: efx.h:327
#define al_throwerr(ctx, err)
Definition: alMain.h:866
GLclampd n
Definition: glew.h:7287
#define AL_INVALID_VALUE
Definition: al.h:373
#define AL_EAXREVERB_MIN_HFREFERENCE
Definition: efx.h:444
static void eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.c:535
#define AL_EAXREVERB_DEFAULT_MODULATION_TIME
Definition: efx.h:434
ALfloat ReflectionsGain
Definition: alEffect.h:37
LPALISEFFECT alIsEffect
Definition: alreverb.c:52
static void eaxreverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.c:583
int ALsizei
Definition: al.h:62
SDL_EventEntry * free
Definition: SDL_events.c:80
#define AL_EAXREVERB_DECAY_HFRATIO
Definition: efx.h:57
#define AL_ECHO_DELAY
Definition: efx.h:91
#define al_try
Definition: alMain.h:838
#define AL_REVERB_MAX_REFLECTIONS_DELAY
Definition: efx.h:348
#define AL_REVERB_DECAY_HFRATIO
Definition: efx.h:41
int ALint
Definition: al.h:56
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN
Definition: efx.h:416
#define memset
Definition: SDL_malloc.c:633
#define ALeffect_GetParamiv(x, c, p, v)
Definition: alEffect.h:98
#define AL_FALSE
Definition: al.h:83
#define AL_EAXREVERB_HFREFERENCE
Definition: efx.h:70
#define AL_REVERB_MIN_LATE_REVERB_DELAY
Definition: efx.h:355
#define AL_EAXREVERB_MAX_HFREFERENCE
Definition: efx.h:445
#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY
Definition: efx.h:419
#define AL_EAXREVERB_MIN_MODULATION_DEPTH
Definition: efx.h:436
#define AL_EAXREVERB_MODULATION_DEPTH
Definition: efx.h:68
#define AL_REVERB_GAINHF
Definition: efx.h:39
static void mod_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.c:1034
#define AL_EAXREVERB_MAX_DECAY_HFRATIO
Definition: efx.h:397
ALfloat ReflectionsPan[3]
Definition: alEffect.h:48
#define AL_REVERB_MIN_GAINHF
Definition: efx.h:331
EGLImageKHR EGLint * name
Definition: eglext.h:284
#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF
Definition: efx.h:650
#define AL_RING_MODULATOR_MAX_FREQUENCY
Definition: efx.h:646
struct ALeffect::@54 Modulator
#define AL_ECHO_MIN_DELAY
Definition: efx.h:510
#define AL_REVERB_DECAY_TIME
Definition: efx.h:40
struct ALeffect::@53 Echo
#define al_endtry
Definition: alMain.h:853
#define AL_REVERB_MAX_GAIN
Definition: efx.h:328
ALfloat Diffusion
Definition: alEffect.h:32
LPALGETEFFECTI alGetEffecti
Definition: alreverb.c:57
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY
Definition: efx.h:410
#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR
Definition: efx.h:363
#define AL_EAXREVERB_MAX_DENSITY
Definition: efx.h:373
#define AL_EAXREVERB_MAX_MODULATION_DEPTH
Definition: efx.h:437
static void ded_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.c:1110
#define AL_ECHO_SPREAD
Definition: efx.h:95
ALuint id
Definition: alEffect.h:89
ALfloat DecayLFRatio
Definition: alEffect.h:47
ALCcontext * GetContextRef(void)
Definition: ALc.c:1999
UIntMap EffectMap
Definition: alMain.h:592
#define AL_EAXREVERB_MIN_DECAY_TIME
Definition: efx.h:392
#define AL_EAXREVERB_MIN_DECAY_LFRATIO
Definition: efx.h:400
LPALGETEFFECTF alGetEffectf
Definition: alreverb.c:59
#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN
Definition: efx.h:414
float ALfloat
Definition: al.h:68
#define AL_REVERB_DEFAULT_DIFFUSION
Definition: efx.h:325
#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF
Definition: efx.h:440
#define calloc
Definition: SDL_malloc.c:636
#define AL_EAXREVERB_MIN_DECAY_HFRATIO
Definition: efx.h:396
#define AL_EAXREVERB_LATE_REVERB_PAN
Definition: efx.h:64
void(* SetParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.h:79
#define ALeffect_SetParami(x, c, p, v)
Definition: alEffect.h:92
#define AL_EAXREVERB_DEFAULT_GAINHF
Definition: efx.h:386
#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN
Definition: efx.h:345
#define AL_EAXREVERB_MAX_GAINHF
Definition: efx.h:385
#define AL_REVERB_AIR_ABSORPTION_GAINHF
Definition: efx.h:46
#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY
Definition: efx.h:408
#define AL_ECHO_MIN_FEEDBACK
Definition: efx.h:522
#define AL_RING_MODULATOR_MIN_FREQUENCY
Definition: efx.h:645
#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF
Definition: efx.h:442
#define AL_EAXREVERB_MAX_GAIN
Definition: efx.h:381
#define AL_REVERB_DECAY_HFLIMIT
Definition: efx.h:48
#define AL_ECHO_DEFAULT_DELAY
Definition: efx.h:512
#define AL_REVERB_MAX_DECAY_TIME
Definition: efx.h:336
#define AL_REVERB_MAX_DECAY_HFLIMIT
Definition: efx.h:368
void(* GetParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.h:84
static void ded_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.c:1132
#define AL_EAXREVERB_REFLECTIONS_GAIN
Definition: efx.h:59
static void eaxreverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.c:587
ALfloat HFReference
Definition: alEffect.h:54
void(* GetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.h:85
ALvoid * value
Definition: alMain.h:310
#define AL_EAXREVERB_MAX_MODULATION_TIME
Definition: efx.h:433
ALfloat AirAbsorptionGainHF
Definition: alEffect.h:41
ALvoid ReleaseALEffects(ALCdevice *device)
Definition: alEffect.c:1187
#define AL_REVERB_DEFAULT_GAIN
Definition: efx.h:329
#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO
Definition: efx.h:402
#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY
Definition: efx.h:357
ALfloat ReflectionsDelay
Definition: alEffect.h:38
#define AL_EAXREVERB_MAX_DIFFUSION
Definition: efx.h:377
ALfloat Delay
Definition: alEffect.h:59
#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
Definition: efx.h:454
LPALEFFECTF alEffectf
Definition: alreverb.c:55
static void ded_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.c:1137
#define AL_REVERB_DIFFUSION
Definition: efx.h:37
static void mod_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.c:1060
ALfloat HighPassCutoff
Definition: alEffect.h:70
static void null_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.c:1175
#define AL_EAXREVERB_DEFAULT_GAINLF
Definition: efx.h:390
#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN
Definition: efx.h:353
#define AL_REVERB_REFLECTIONS_DELAY
Definition: efx.h:43
static void reverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.c:719
static void mod_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.c:1009
GLuint64EXT * result
Definition: glew.h:12708
static void echo_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.c:913
ALfloat LateReverbDelay
Definition: alEffect.h:40
static void mod_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.c:1065
#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH
Definition: efx.h:430
ALfloat LRDelay
Definition: alEffect.h:60
#define al_catchany()
Definition: alMain.h:851
#define AL_REVERB_MIN_DENSITY
Definition: efx.h:319
#define AL_ECHO_DAMPING
Definition: efx.h:93
#define AL_INVALID_NAME
Definition: al.h:367
ALfloat DecayHFRatio
Definition: alEffect.h:36
#define AL_EAXREVERB_MAX_LFREFERENCE
Definition: efx.h:449
ALfloat RoomRolloffFactor
Definition: alEffect.h:42
static void reverb_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.c:846
#define ROOM()
Definition: infback.c:201
static void echo_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
Definition: alEffect.c:963
#define AL_REVERB_MIN_LATE_REVERB_GAIN
Definition: efx.h:351
static void eaxreverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.c:347
#define AL_EAXREVERB_DEFAULT_GAIN
Definition: efx.h:382
#define AL_EFFECT_REVERB
Definition: efx.h:155
#define RemoveEffect(m, k)
Definition: alMain.h:671
#define AL_ECHO_LRDELAY
Definition: efx.h:92
#define AL_EAXREVERB_MODULATION_TIME
Definition: efx.h:67
#define AL_EFFECT_DEDICATED_DIALOGUE
Definition: alext.h:202
#define AL_ECHO_DEFAULT_SPREAD
Definition: efx.h:528
ALsizei size
Definition: alMain.h:312
ALfloat EchoDepth
Definition: alEffect.h:51
ALenum InitEffect(ALeffect *effect)
Definition: alEffect.c:1181
static void InitEffectParams(ALeffect *effect, ALenum type)
Definition: alEffect.c:1203
#define AL_EAXREVERB_MIN_MODULATION_TIME
Definition: efx.h:432
#define AL_EAXREVERB_MAX_ECHO_TIME
Definition: efx.h:425
ALfloat Damping
Definition: alEffect.h:62
ALboolean DecayHFLimit
Definition: alEffect.h:43
#define AL_REVERB_DENSITY
Definition: efx.h:36
#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN
Definition: efx.h:405
#define AL_EAXREVERB_MIN_DECAY_HFLIMIT
Definition: efx.h:456
#define AL_EAXREVERB_GAIN
Definition: efx.h:53
#define ALeffect_SetParamiv(x, c, p, v)
Definition: alEffect.h:93
#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF
Definition: efx.h:361
#define AL_ECHO_MAX_LRDELAY
Definition: efx.h:515
int ALenum
Definition: al.h:65
LPALGETEFFECTIV alGetEffectiv
Definition: alreverb.c:58
#define AL_REVERB_MAX_REFLECTIONS_GAIN
Definition: efx.h:344
#define AL_EFFECT_NULL
Definition: efx.h:154
#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN
Definition: efx.h:404
static void eaxreverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.c:367
ALboolean DisabledEffects[MAX_EFFECTS]
Definition: alEffect.c:35
ALenum NewThunkEntry(ALuint *index)
Definition: alThunk.c:47
ALfloat Feedback
Definition: alEffect.h:63
static const ALsizei reverblistsize
Definition: alEffect.c:1457
unsigned int ALuint
Definition: al.h:59
#define AL_ECHO_MAX_DAMPING
Definition: efx.h:519
#define AL_EAXREVERB_MIN_DENSITY
Definition: efx.h:372
#define AL_API
Definition: al.h:14
#define WARN(...)
Definition: alMain.h:811
#define ALeffect_GetParami(x, c, p, v)
Definition: alEffect.h:97
#define AL_DEDICATED_GAIN
Definition: alext.h:201
#define AL_EAXREVERB_GAINHF
Definition: efx.h:54
static void echo_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.c:915
ALvoid LoadReverbPreset(const char *name, ALeffect *effect)
Definition: alEffect.c:1459
static void echo_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.c:1003
#define AL_ECHO_DEFAULT_LRDELAY
Definition: efx.h:516
static void reverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.c:907
#define AL_EAXREVERB_DECAY_LFRATIO
Definition: efx.h:58
#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT
Definition: efx.h:458
#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF
Definition: efx.h:649
#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF
Definition: efx.h:651
#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
Definition: efx.h:365
#define AL_REVERB_MIN_REFLECTIONS_DELAY
Definition: efx.h:347
#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR
Definition: efx.h:72
#define AL_REVERB_DEFAULT_DECAY_TIME
Definition: efx.h:337
#define AL_RING_MODULATOR_MIN_WAVEFORM
Definition: efx.h:657
#define AL_ECHO_MIN_DAMPING
Definition: efx.h:518
#define ALeffect_SetParamf(x, c, p, v)
Definition: alEffect.h:94
#define AL_ECHO_MAX_DELAY
Definition: efx.h:511
#define AL_EAXREVERB_DECAY_TIME
Definition: efx.h:56
#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF
Definition: efx.h:69
#define AL_EAXREVERB_MIN_GAINLF
Definition: efx.h:388
#define AL_ECHO_MIN_SPREAD
Definition: efx.h:526
#define AL_RING_MODULATOR_WAVEFORM
Definition: efx.h:125
#define AL_RING_MODULATOR_DEFAULT_WAVEFORM
Definition: efx.h:659
#define AL_EAXREVERB_DECAY_HFLIMIT
Definition: efx.h:73
#define LookupEffect(m, k)
Definition: alMain.h:668
#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH
Definition: efx.h:438
#define AL_REVERB_DEFAULT_DECAY_HFLIMIT
Definition: efx.h:369
static void eaxreverb_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.c:363
static void ded_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.c:1156
#define AL_EAXREVERB_DENSITY
Definition: efx.h:51
static void reverb_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.c:723
void ALCcontext_DecRef(ALCcontext *context)
Definition: ALc.c:1949
#define AL_EAXREVERB_REFLECTIONS_PAN
Definition: efx.h:61
ALfloat ModulationDepth
Definition: alEffect.h:53
EGLSurface EGLint void ** value
Definition: eglext.h:301
#define ALeffect_SetParamfv(x, c, p, v)
Definition: alEffect.h:95
static void mod_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.c:1084
#define AL_REVERB_MIN_REFLECTIONS_GAIN
Definition: efx.h:343
#define AL_EAXREVERB_MAX_DECAY_HFLIMIT
Definition: efx.h:457
#define AL_REVERB_MAX_LATE_REVERB_GAIN
Definition: efx.h:352
#define AL_REVERB_DEFAULT_DECAY_HFRATIO
Definition: efx.h:341
static void null_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.c:1171
#define AL_EAXREVERB_DEFAULT_DECAY_TIME
Definition: efx.h:394
static void null_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.c:1162
static void echo_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
Definition: alEffect.c:970
#define AL_REVERB_LATE_REVERB_GAIN
Definition: efx.h:44
#define AL_ECHO_DEFAULT_DAMPING
Definition: efx.h:520
struct ALeffect::@55 Dedicated
#define AL_EAXREVERB_MIN_ECHO_TIME
Definition: efx.h:424
#define AL_OUT_OF_MEMORY
Definition: al.h:379
static void eaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.c:570
#define AL_EAXREVERB_MIN_ECHO_DEPTH
Definition: efx.h:428
#define AL_EAXREVERB_LFREFERENCE
Definition: efx.h:71
LPALEFFECTIV alEffectiv
Definition: alreverb.c:54
void(* SetParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.h:78
char ALboolean
Definition: al.h:38
LPALGENEFFECTS alGenEffects
Definition: alreverb.c:50
#define AL_REVERB_MAX_DECAY_HFRATIO
Definition: efx.h:340
#define AL_EAXREVERB_GAINLF
Definition: efx.h:55
static void mod_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.c:1088
#define AL_EFFECT_RING_MODULATOR
Definition: efx.h:163
#define AL_RING_MODULATOR_HIGHPASS_CUTOFF
Definition: efx.h:124
ALfloat LateReverbPan[3]
Definition: alEffect.h:49
void(* GetParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.h:86
static void null_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.c:1164
ALfloat Gain
Definition: alEffect.h:33
LPALGETEFFECTFV alGetEffectfv
Definition: alreverb.c:60
#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT
Definition: alext.h:203
#define AL_EAXREVERB_MAX_DECAY_LFRATIO
Definition: efx.h:401
#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF
Definition: efx.h:441
static void ded_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
Definition: alEffect.c:1112
ALCdevice * Device
Definition: alMain.h:704
#define AL_REVERB_MIN_DECAY_TIME
Definition: efx.h:335
#define AL_REVERB_DEFAULT_GAINHF
Definition: efx.h:333
#define AL_EAXREVERB_DEFAULT_LFREFERENCE
Definition: efx.h:450
#define AL_RING_MODULATOR_MAX_WAVEFORM
Definition: efx.h:658
static __inline void LockContext(ALCcontext *context)
Definition: alMain.h:728
#define AL_RING_MODULATOR_FREQUENCY
Definition: efx.h:123
static void null_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.c:1177
static void reverb_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
Definition: alEffect.c:702
#define AL_ECHO_MAX_SPREAD
Definition: efx.h:527
#define AL_EFFECT_ECHO
Definition: efx.h:158
ALfloat DecayTime
Definition: alEffect.h:35
TParseContext * context
int i
Definition: pngrutil.c:1377
ALvoid alSetError(ALCcontext *Context, ALenum errorCode)
Definition: alError.c:31
#define AL_EAXREVERB_MAX_ECHO_DEPTH
Definition: efx.h:429
static void reverb_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
Definition: alEffect.c:850
#define AL_EFFECT_EAXREVERB
Definition: efx.h:167
#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO
Definition: efx.h:398
static void reverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
Definition: alEffect.c:833
#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF
Definition: efx.h:359
LPALEFFECTI alEffecti
Definition: alreverb.c:53
#define AL_EAXREVERB_MIN_GAINHF
Definition: efx.h:384
ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value)
Definition: helpers.c:565
static __inline void UnlockContext(ALCcontext *context)
Definition: alMain.h:730
#define AL_EAXREVERB_MIN_LFREFERENCE
Definition: efx.h:448
#define AL_REVERB_DEFAULT_DENSITY
Definition: efx.h:321
#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY
Definition: efx.h:418
static void mod_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.c:1104
#define AL_EAXREVERB_DEFAULT_ECHO_TIME
Definition: efx.h:426
#define AL_INVALID_ENUM
Definition: al.h:370
#define DECL(x)
Definition: alEffect.c:1324
#define AL_EAXREVERB_ECHO_DEPTH
Definition: efx.h:66
#define AL_RING_MODULATOR_DEFAULT_FREQUENCY
Definition: efx.h:647
LPALEFFECTFV alEffectfv
Definition: alreverb.c:56
#define ALeffect_GetParamf(x, c, p, v)
Definition: alEffect.h:99
ALenum type
Definition: alEffect.h:27
ALfloat LateReverbGain
Definition: alEffect.h:39
#define AL_REVERB_MIN_DECAY_HFRATIO
Definition: efx.h:339
#define AL_NO_ERROR
Definition: al.h:364
static void echo_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.c:919
#define AL_REVERB_ROOM_ROLLOFF_FACTOR
Definition: efx.h:47
static struct @50 reverblist[]
ALint Waveform
Definition: alEffect.h:71
ALfloat EchoTime
Definition: alEffect.h:50
ALenum val
Definition: alMain.h:534
GLint GLsizei const GLuint64 * values
Definition: glew.h:3473
#define AL_EAXREVERB_DEFAULT_DENSITY
Definition: efx.h:374
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
Definition: efx.h:412
LPALDELETEEFFECTS alDeleteEffects
Definition: alreverb.c:51
static void eaxreverb_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
Definition: alEffect.c:676
ALfloat GainLF
Definition: alEffect.h:46
void(* SetParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
Definition: alEffect.h:80
#define AL_ECHO_MIN_LRDELAY
Definition: efx.h:514
#define COUNTOF(x)
Definition: alMain.h:63
ALfloat Density
Definition: alEffect.h:31
#define AL_EAXREVERB_MIN_DIFFUSION
Definition: efx.h:376
#define AL_EAXREVERB_MAX_DECAY_TIME
Definition: efx.h:393