Main repository of MikuMikuStudio
Revisión | 00effb1783ddd359c4b20c21fd7c3a0ba5986763 (tree) |
---|---|
Tiempo | 2013-02-28 08:18:44 |
Autor | julien.gouesse@gmail.com <julien.gouesse@gmai...> |
Commiter | julien.gouesse@gmail.com |
Fixes some compile errors in JoalAudioRenderer (work in progress)
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10452 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -202,14 +202,14 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
202 | 202 | //supportEfx = alc.alcIsExtensionPresent(device, "ALC_EXT_EFX"); |
203 | 203 | if (supportEfx) { |
204 | 204 | ib.position(0).limit(1); |
205 | - alc.alcGetIntegerv(device, AL.ALC_EFX_MAJOR_VERSION, 1, ib); | |
205 | + alc.alcGetIntegerv(device, ALExtConstants.ALC_EFX_MAJOR_VERSION, 1, ib); | |
206 | 206 | int major = ib.get(0); |
207 | 207 | ib.position(0).limit(1); |
208 | - alc.alcGetIntegerv(device, AL.ALC_EFX_MINOR_VERSION, 1, ib); | |
208 | + alc.alcGetIntegerv(device, ALExtConstants.ALC_EFX_MINOR_VERSION, 1, ib); | |
209 | 209 | int minor = ib.get(0); |
210 | 210 | logger.log(Level.FINE, "Audio effect extension version: {0}.{1}", new Object[]{major, minor}); |
211 | 211 | |
212 | - alc.alcGetIntegerv(device, AL.ALC_MAX_AUXILIARY_SENDS, 1, ib); | |
212 | + alc.alcGetIntegerv(device, ALExtConstants.ALC_MAX_AUXILIARY_SENDS, 1, ib); | |
213 | 213 | auxSends = ib.get(0); |
214 | 214 | logger.log(Level.FINE, "Audio max auxilary sends: {0}", auxSends); |
215 | 215 |
@@ -222,10 +222,10 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
222 | 222 | ib.position(0).limit(1); |
223 | 223 | al.alGenEffects(1, ib); |
224 | 224 | reverbFx = ib.get(0); |
225 | - al.alEffecti(reverbFx, AL.AL_EFFECT_TYPE, AL.AL_EFFECT_REVERB); | |
225 | + al.alEffecti(reverbFx, ALExtConstants.AL_EFFECT_TYPE, ALExtConstants.AL_EFFECT_REVERB); | |
226 | 226 | |
227 | 227 | // attach reverb effect to effect slot |
228 | - al.alAuxiliaryEffectSloti(reverbFxSlot, AL.AL_EFFECTSLOT_EFFECT, reverbFx); | |
228 | + al.alAuxiliaryEffectSloti(reverbFxSlot, ALExtConstants.AL_EFFECTSLOT_EFFECT, reverbFx); | |
229 | 229 | } else { |
230 | 230 | logger.log(Level.WARNING, "OpenAL EFX not available! Audio effects won't work."); |
231 | 231 | } |
@@ -297,9 +297,9 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
297 | 297 | |
298 | 298 | if (f instanceof LowPassFilter) { |
299 | 299 | LowPassFilter lpf = (LowPassFilter) f; |
300 | - al.alFilteri(id, AL.AL_FILTER_TYPE, AL.AL_FILTER_LOWPASS); | |
301 | - al.alFilterf(id, AL.AL_LOWPASS_GAIN, lpf.getVolume()); | |
302 | - al.alFilterf(id, AL.AL_LOWPASS_GAINHF, lpf.getHighFreqVolume()); | |
300 | + al.alFilteri(id, ALExtConstants.AL_FILTER_TYPE, ALExtConstants.AL_FILTER_LOWPASS); | |
301 | + al.alFilterf(id, ALExtConstants.AL_LOWPASS_GAIN, lpf.getVolume()); | |
302 | + al.alFilterf(id, ALExtConstants.AL_LOWPASS_GAINHF, lpf.getHighFreqVolume()); | |
303 | 303 | } else { |
304 | 304 | throw new UnsupportedOperationException("Filter type unsupported: " |
305 | 305 | + f.getClass().getName()); |
@@ -373,7 +373,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
373 | 373 | return; |
374 | 374 | } |
375 | 375 | |
376 | - int filter = AL.AL_FILTER_NULL; | |
376 | + int filter = ALExtConstants.AL_FILTER_NULL; | |
377 | 377 | if (src.getReverbFilter() != null) { |
378 | 378 | Filter f = src.getReverbFilter(); |
379 | 379 | if (f.isUpdateNeeded()) { |
@@ -381,7 +381,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
381 | 381 | } |
382 | 382 | filter = f.getId(); |
383 | 383 | } |
384 | - al.alSource3i(id, AL.AL_AUXILIARY_SEND_FILTER, reverbFxSlot, 0, filter); | |
384 | + al.alSource3i(id, ALExtConstants.AL_AUXILIARY_SEND_FILTER, reverbFxSlot, 0, filter); | |
385 | 385 | break; |
386 | 386 | case ReverbEnabled: |
387 | 387 | if (!supportEfx || !src.isPositional()) { |
@@ -391,7 +391,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
391 | 391 | if (src.isReverbEnabled()) { |
392 | 392 | updateSourceParam(src, AudioParam.ReverbFilter); |
393 | 393 | } else { |
394 | - al.alSource3i(id, AL.AL_AUXILIARY_SEND_FILTER, 0, 0, AL.AL_FILTER_NULL); | |
394 | + al.alSource3i(id, ALExtConstants.AL_AUXILIARY_SEND_FILTER, 0, 0, ALExtConstants.AL_FILTER_NULL); | |
395 | 395 | } |
396 | 396 | break; |
397 | 397 | case IsPositional: |
@@ -402,7 +402,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
402 | 402 | al.alSource3f(id, ALConstants.AL_VELOCITY, 0, 0, 0); |
403 | 403 | |
404 | 404 | // Disable reverb |
405 | - al.alSource3i(id, AL.AL_AUXILIARY_SEND_FILTER, 0, 0, AL.AL_FILTER_NULL); | |
405 | + al.alSource3i(id, ALExtConstants.AL_AUXILIARY_SEND_FILTER, 0, 0, ALExtConstants.AL_FILTER_NULL); | |
406 | 406 | } else { |
407 | 407 | al.alSourcei(id, ALConstants.AL_SOURCE_RELATIVE, ALConstants.AL_FALSE); |
408 | 408 | updateSourceParam(src, AudioParam.Position); |
@@ -457,10 +457,10 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
457 | 457 | updateFilter(f); |
458 | 458 | |
459 | 459 | // NOTE: must re-attach filter for changes to apply. |
460 | - al.alSourcei(id, AL.AL_DIRECT_FILTER, f.getId()); | |
460 | + al.alSourcei(id, ALExtConstants.AL_DIRECT_FILTER, f.getId()); | |
461 | 461 | } |
462 | 462 | } else { |
463 | - al.alSourcei(id, AL.AL_DIRECT_FILTER, AL.AL_FILTER_NULL); | |
463 | + al.alSourcei(id, ALExtConstants.AL_DIRECT_FILTER, ALExtConstants.AL_FILTER_NULL); | |
464 | 464 | } |
465 | 465 | break; |
466 | 466 | case Looping: |
@@ -493,7 +493,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
493 | 493 | al.alSourcei(id, ALConstants.AL_SOURCE_RELATIVE, ALConstants.AL_FALSE); |
494 | 494 | |
495 | 495 | if (src.isReverbEnabled() && supportEfx) { |
496 | - int filter = AL.AL_FILTER_NULL; | |
496 | + int filter = ALExtConstants.AL_FILTER_NULL; | |
497 | 497 | if (src.getReverbFilter() != null) { |
498 | 498 | Filter f = src.getReverbFilter(); |
499 | 499 | if (f.isUpdateNeeded()) { |
@@ -501,7 +501,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
501 | 501 | } |
502 | 502 | filter = f.getId(); |
503 | 503 | } |
504 | - al.alSource3i(id, AL.AL_AUXILIARY_SEND_FILTER, reverbFxSlot, 0, filter); | |
504 | + al.alSource3i(id, ALExtConstants.AL_AUXILIARY_SEND_FILTER, reverbFxSlot, 0, filter); | |
505 | 505 | } |
506 | 506 | } else { |
507 | 507 | // play in headspace |
@@ -516,7 +516,7 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
516 | 516 | updateFilter(f); |
517 | 517 | |
518 | 518 | // NOTE: must re-attach filter for changes to apply. |
519 | - al.alSourcei(id, AL.AL_DIRECT_FILTER, f.getId()); | |
519 | + al.alSourcei(id, ALExtConstants.AL_DIRECT_FILTER, f.getId()); | |
520 | 520 | } |
521 | 521 | } |
522 | 522 |
@@ -627,21 +627,21 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
627 | 627 | return; |
628 | 628 | } |
629 | 629 | |
630 | - al.alEffectf(reverbFx, AL.AL_REVERB_DENSITY, env.getDensity()); | |
631 | - al.alEffectf(reverbFx, AL.AL_REVERB_DIFFUSION, env.getDiffusion()); | |
632 | - al.alEffectf(reverbFx, AL.AL_REVERB_GAIN, env.getGain()); | |
633 | - al.alEffectf(reverbFx, AL.AL_REVERB_GAINHF, env.getGainHf()); | |
634 | - al.alEffectf(reverbFx, AL.AL_REVERB_DECAY_TIME, env.getDecayTime()); | |
635 | - al.alEffectf(reverbFx, AL.AL_REVERB_DECAY_HFRATIO, env.getDecayHFRatio()); | |
636 | - al.alEffectf(reverbFx, AL.AL_REVERB_REFLECTIONS_GAIN, env.getReflectGain()); | |
637 | - al.alEffectf(reverbFx, AL.AL_REVERB_REFLECTIONS_DELAY, env.getReflectDelay()); | |
638 | - al.alEffectf(reverbFx, AL.AL_REVERB_LATE_REVERB_GAIN, env.getLateReverbGain()); | |
639 | - al.alEffectf(reverbFx, AL.AL_REVERB_LATE_REVERB_DELAY, env.getLateReverbDelay()); | |
640 | - al.alEffectf(reverbFx, AL.AL_REVERB_AIR_ABSORPTION_GAINHF, env.getAirAbsorbGainHf()); | |
641 | - al.alEffectf(reverbFx, AL.AL_REVERB_ROOM_ROLLOFF_FACTOR, env.getRoomRolloffFactor()); | |
630 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_DENSITY, env.getDensity()); | |
631 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_DIFFUSION, env.getDiffusion()); | |
632 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_GAIN, env.getGain()); | |
633 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_GAINHF, env.getGainHf()); | |
634 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_DECAY_TIME, env.getDecayTime()); | |
635 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_DECAY_HFRATIO, env.getDecayHFRatio()); | |
636 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_REFLECTIONS_GAIN, env.getReflectGain()); | |
637 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_REFLECTIONS_DELAY, env.getReflectDelay()); | |
638 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_LATE_REVERB_GAIN, env.getLateReverbGain()); | |
639 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_LATE_REVERB_DELAY, env.getLateReverbDelay()); | |
640 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_AIR_ABSORPTION_GAINHF, env.getAirAbsorbGainHf()); | |
641 | + al.alEffectf(reverbFx, ALExtConstants.AL_REVERB_ROOM_ROLLOFF_FACTOR, env.getRoomRolloffFactor()); | |
642 | 642 | |
643 | 643 | // attach effect to slot |
644 | - al.alAuxiliaryEffectSloti(reverbFxSlot, AL.AL_EFFECTSLOT_EFFECT, reverbFx); | |
644 | + al.alAuxiliaryEffectSloti(reverbFxSlot, ALExtConstants.AL_EFFECTSLOT_EFFECT, reverbFx); | |
645 | 645 | } |
646 | 646 | } |
647 | 647 |
@@ -747,12 +747,12 @@ public class JoalAudioRenderer implements AudioRenderer, Runnable { | ||
747 | 747 | |
748 | 748 | if (src.getDryFilter() != null && supportEfx) { |
749 | 749 | // detach filter |
750 | - al.alSourcei(sourceId, AL.AL_DIRECT_FILTER, AL.AL_FILTER_NULL); | |
750 | + al.alSourcei(sourceId, ALExtConstants.AL_DIRECT_FILTER, ALExtConstants.AL_FILTER_NULL); | |
751 | 751 | } |
752 | 752 | if (src.isPositional()) { |
753 | 753 | AudioSource pas = (AudioSource) src; |
754 | 754 | if (pas.isReverbEnabled() && supportEfx) { |
755 | - al.alSource3i(sourceId, AL.AL_AUXILIARY_SEND_FILTER, 0, 0, AL.AL_FILTER_NULL); | |
755 | + al.alSource3i(sourceId, ALExtConstants.AL_AUXILIARY_SEND_FILTER, 0, 0, ALExtConstants.AL_FILTER_NULL); | |
756 | 756 | } |
757 | 757 | } |
758 | 758 |