00001 #region --- OpenTK.OpenAL License ---
00002
00003
00004
00005
00006
00007
00008 #endregion
00009
00010 using System;
00011 using System.Diagnostics;
00012 using System.Runtime.InteropServices;
00013
00014
00015 namespace OpenTK.Audio.OpenAL
00016 {
00020 public partial class EffectsExtension
00021 {
00022 #region Helpers
00023
00024 #region BindEffect
00025
00029 [CLSCompliant(false)]
00030 public void BindEffect(uint eid, EfxEffectType type)
00031 {
00032 Imported_alEffecti(eid, EfxEffecti.EffectType, (int)type);
00033 }
00034
00038
00039 public void BindEffect(int eid, EfxEffectType type)
00040 {
00041 Imported_alEffecti((uint)eid, EfxEffecti.EffectType, (int)type);
00042 }
00043
00044 #endregion BindEffect
00045
00046 #region BindFilterToSource
00047
00051 [CLSCompliant(false)]
00052 public void BindFilterToSource(uint source, uint filter)
00053 {
00054 AL.Source(source, ALSourcei.EfxDirectFilter, (int)filter);
00055 }
00056
00060
00061 public void BindFilterToSource(int source, int filter)
00062 {
00063 AL.Source((uint)source, ALSourcei.EfxDirectFilter, (int)filter);
00064 }
00065
00066 #endregion BindFilterToSource
00067
00068 #region BindEffectToAuxiliarySlot
00069
00073 [CLSCompliant(false)]
00074 public void BindEffectToAuxiliarySlot(uint auxiliaryeffectslot, uint effect)
00075 {
00076 AuxiliaryEffectSlot(auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect);
00077 }
00078
00082
00083 public void BindEffectToAuxiliarySlot(int auxiliaryeffectslot, int effect)
00084 {
00085 AuxiliaryEffectSlot((uint)auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect);
00086 }
00087
00088 #endregion BindEffectToAuxiliarySlot
00089
00090 #region BindSourceToAuxiliarySlot
00091
00097 [CLSCompliant(false)]
00098 public void BindSourceToAuxiliarySlot(uint source, uint slot, int slotnumber, uint filter)
00099 {
00100 AL.Source(source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter);
00101 }
00102
00108
00109 public void BindSourceToAuxiliarySlot(int source, int slot, int slotnumber, int filter)
00110 {
00111 AL.Source((uint)source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter);
00112 }
00113
00114 #endregion BindSourceToAuxiliarySlot
00115
00116 #endregion Helpers
00117
00118 #region Effect Object
00119
00120 #region alGenEffects
00121
00122
00123 unsafe private delegate void Delegate_alGenEffects(int n, [Out] uint* effects);
00124
00125
00126
00127 private Delegate_alGenEffects Imported_alGenEffects;
00128
00133 [CLSCompliant(false)]
00134 public void GenEffects(int n, out uint effects)
00135 {
00136 unsafe
00137 {
00138 fixed (uint* ptr = &effects)
00139 {
00140 Imported_alGenEffects(n, ptr);
00141 effects = *ptr;
00142 }
00143 }
00144 }
00145
00150 public void GenEffects(int n, out int effects)
00151 {
00152 unsafe
00153 {
00154 fixed (int* ptr = &effects)
00155 {
00156 Imported_alGenEffects(n, (uint*)ptr);
00157 effects = *ptr;
00158 }
00159 }
00160 }
00161
00168 public int[] GenEffects(int n)
00169 {
00170 if (n <= 0) throw new ArgumentOutOfRangeException("n", "Must be higher than 0.");
00171 int[] effects = new int[n];
00172 GenEffects(n, out effects[0]);
00173 return effects;
00174 }
00175
00182 public int GenEffect()
00183 {
00184 int temp;
00185 GenEffects(1, out temp);
00186 return temp;
00187 }
00188
00191 [CLSCompliant(false)]
00192 public void GenEffect(out uint effect)
00193 {
00194 unsafe
00195 {
00196 fixed (uint* ptr = &effect)
00197 {
00198 Imported_alGenEffects(1, ptr);
00199 effect = *ptr;
00200 }
00201 }
00202
00203 }
00204
00205 #endregion alGenEffects
00206
00207 #region alDeleteEffects
00208
00209
00210 unsafe private delegate void Delegate_alDeleteEffects(int n, [In] uint* effects);
00211
00212
00213
00214 private Delegate_alDeleteEffects Imported_alDeleteEffects;
00215
00219 [CLSCompliant(false)]
00220 public void DeleteEffects(int n, ref uint effects)
00221 {
00222 unsafe
00223 {
00224 fixed (uint* ptr = &effects)
00225 {
00226 Imported_alDeleteEffects(n, ptr);
00227 }
00228 }
00229 }
00230
00234 public void DeleteEffects(int n, ref int effects)
00235 {
00236 unsafe
00237 {
00238 fixed (int* ptr = &effects)
00239 {
00240 Imported_alDeleteEffects(n, (uint*)ptr);
00241 }
00242 }
00243 }
00244
00247 public void DeleteEffects(int[] effects)
00248 {
00249 if (effects == null) throw new ArgumentNullException("effects");
00250 DeleteEffects(effects.Length, ref effects[0]);
00251 }
00252
00255 [CLSCompliant(false)]
00256 public void DeleteEffects(uint[] effects)
00257 {
00258 if (effects == null) throw new ArgumentNullException("effects");
00259 DeleteEffects(effects.Length, ref effects[0]);
00260 }
00261
00264 public void DeleteEffect(int effect)
00265 {
00266 DeleteEffects(1, ref effect);
00267 }
00268
00271 [CLSCompliant(false)]
00272 public void DeleteEffect(ref uint effect)
00273 {
00274 unsafe
00275 {
00276 fixed (uint* ptr = &effect)
00277 {
00278 Imported_alDeleteEffects(1, ptr);
00279 }
00280 }
00281 }
00282
00283 #endregion alDeleteEffects
00284
00285 #region alIsEffect
00286
00287
00288 private delegate bool Delegate_alIsEffect(uint eid);
00289
00290
00291
00292 private Delegate_alIsEffect Imported_alIsEffect;
00293
00297 [CLSCompliant(false)]
00298 public bool IsEffect(uint eid)
00299 {
00300 return Imported_alIsEffect(eid);
00301 }
00302
00306
00307 public bool IsEffect(int eid)
00308 {
00309 return Imported_alIsEffect((uint)eid);
00310 }
00311
00312 #endregion alIsEffect
00313
00314 #region alEffecti
00315
00316
00317 private delegate void Delegate_alEffecti(uint eid, EfxEffecti param, int value);
00318
00319
00320
00321 private Delegate_alEffecti Imported_alEffecti;
00322
00327 [CLSCompliant(false)]
00328 public void Effect(uint eid, EfxEffecti param, int value)
00329 {
00330 Imported_alEffecti(eid, param, value);
00331 }
00332
00337
00338 public void Effect(int eid, EfxEffecti param, int value)
00339 {
00340 Imported_alEffecti((uint)eid, param, value);
00341 }
00342
00343 #endregion alEffecti
00344
00345 #region alEffectf
00346
00347
00348 private delegate void Delegate_alEffectf(uint eid, EfxEffectf param, float value);
00349
00350
00351
00352 private Delegate_alEffectf Imported_alEffectf;
00353
00358 [CLSCompliant(false)]
00359 public void Effect(uint eid, EfxEffectf param, float value)
00360 {
00361 Imported_alEffectf(eid, param, value);
00362 }
00363
00368
00369 public void Effect(int eid, EfxEffectf param, float value)
00370 {
00371 Imported_alEffectf((uint)eid, param, value);
00372 }
00373
00374 #endregion alEffectf
00375
00376 #region alEffectfv
00377
00378
00379 unsafe private delegate void Delegate_alEffectfv(uint eid, EfxEffect3f param, [In] float* values);
00380
00381
00382
00383 private Delegate_alEffectfv Imported_alEffectfv;
00384
00389 [CLSCompliant(false)]
00390 public void Effect(uint eid, EfxEffect3f param, ref Vector3 values)
00391 {
00392 unsafe
00393 {
00394 fixed (float* ptr = &values.X)
00395 {
00396 Imported_alEffectfv(eid, param, ptr);
00397 }
00398 }
00399 }
00400
00405
00406 public void Effect(int eid, EfxEffect3f param, ref Vector3 values)
00407 {
00408 Effect((uint)eid, param, ref values);
00409 }
00410
00411 #endregion alEffectfv
00412
00413 #region alGetEffecti
00414
00415
00416 unsafe private delegate void Delegate_alGetEffecti(uint eid, EfxEffecti pname, [Out] int* value);
00417
00418
00419
00420 private Delegate_alGetEffecti Imported_alGetEffecti;
00421
00426 [CLSCompliant(false)]
00427 public void GetEffect(uint eid, EfxEffecti pname, out int value)
00428 {
00429 unsafe
00430 {
00431 fixed (int* ptr = &value)
00432 {
00433 Imported_alGetEffecti(eid, pname, ptr);
00434 }
00435 }
00436 }
00437
00442
00443 public void GetEffect(int eid, EfxEffecti pname, out int value)
00444 {
00445 GetEffect((uint)eid, pname, out value);
00446 }
00447
00448 #endregion alGetEffecti
00449
00450 #region alGetEffectf
00451
00452
00453 unsafe private delegate void Delegate_alGetEffectf(uint eid, EfxEffectf pname, [Out]float* value);
00454
00455
00456
00457 private Delegate_alGetEffectf Imported_alGetEffectf;
00458
00463 [CLSCompliant(false)]
00464 public void GetEffect(uint eid, EfxEffectf pname, out float value)
00465 {
00466 unsafe
00467 {
00468 fixed (float* ptr = &value)
00469 {
00470 Imported_alGetEffectf(eid, pname, ptr);
00471 }
00472 }
00473 }
00474
00479
00480 public void GetEffect(int eid, EfxEffectf pname, out float value)
00481 {
00482 GetEffect((uint)eid, pname, out value);
00483 }
00484
00485 #endregion alGetEffectf
00486
00487 #region alGetEffectfv
00488
00489
00490 unsafe private delegate void Delegate_alGetEffectfv(uint eid, EfxEffect3f param, [Out] float* values);
00491
00492
00493
00494 private Delegate_alGetEffectfv Imported_alGetEffectfv;
00495
00500 [CLSCompliant(false)]
00501 public void GetEffect(uint eid, EfxEffect3f param, out Vector3 values)
00502 {
00503 unsafe
00504 {
00505 fixed (float* ptr = &values.X)
00506 {
00507 Imported_alGetEffectfv(eid, param, ptr);
00508 values.X = ptr[0];
00509 values.Y = ptr[1];
00510 values.Z = ptr[2];
00511 }
00512 }
00513 }
00514
00519
00520 public void GetEffect(int eid, EfxEffect3f param, out Vector3 values)
00521 {
00522 GetEffect((uint)eid, param, out values);
00523 }
00524
00525 #endregion alGetEffectfv
00526
00527
00528
00529
00530
00531 #endregion Effect Object
00532
00533 #region Filter Object
00534
00535 #region alGenFilters
00536
00537
00538 unsafe private delegate void Delegate_alGenFilters(int n, [Out] uint* filters);
00539
00540
00541
00542 private Delegate_alGenFilters Imported_alGenFilters;
00543
00548 [CLSCompliant(false)]
00549 public void GenFilters(int n, out uint filters)
00550 {
00551 unsafe
00552 {
00553 fixed (uint* ptr = &filters)
00554 {
00555 Imported_alGenFilters(n, ptr);
00556 filters = *ptr;
00557 }
00558 }
00559 }
00560
00565 public void GenFilters(int n, out int filters)
00566 {
00567 unsafe
00568 {
00569 fixed (int* ptr = &filters)
00570 {
00571 Imported_alGenFilters(n, (uint*)ptr);
00572 filters = *ptr;
00573 }
00574 }
00575 }
00576
00577
00582 public int[] GenFilters(int n)
00583 {
00584
00585 if (n <= 0) throw new ArgumentOutOfRangeException("n", "Must be higher than 0.");
00586 int[] filters = new int[n];
00587 GenFilters(filters.Length, out filters[0]);
00588 return filters;
00589 }
00590
00593 public int GenFilter()
00594 {
00595 int filter;
00596 GenFilters(1, out filter);
00597 return filter;
00598 }
00599
00602 [CLSCompliant(false)]
00603 unsafe public void GenFilter(out uint filter)
00604 {
00605 unsafe
00606 {
00607 fixed (uint* ptr = &filter)
00608 {
00609 Imported_alGenFilters(1, ptr);
00610 filter = *ptr;
00611 }
00612 }
00613 }
00614
00615 #endregion alGenFilters
00616
00617 #region alDeleteFilters
00618
00619
00620 unsafe private delegate void Delegate_alDeleteFilters(int n, [In] uint* filters);
00621
00622
00623
00624 private Delegate_alDeleteFilters Imported_alDeleteFilters;
00625
00629 [CLSCompliant(false)]
00630 public void DeleteFilters(int n, ref uint filters)
00631 {
00632 unsafe
00633 {
00634 fixed (uint* ptr = &filters)
00635 {
00636 Imported_alDeleteFilters(n, ptr);
00637 }
00638 }
00639 }
00640
00644 public void DeleteFilters(int n, ref int filters)
00645 {
00646 unsafe
00647 {
00648 fixed (int* ptr = &filters)
00649 {
00650 Imported_alDeleteFilters(n, (uint*)ptr);
00651 }
00652 }
00653 }
00654
00657 [CLSCompliant(false)]
00658 public void DeleteFilters(uint[] filters)
00659 {
00660 if (filters == null) throw new ArgumentNullException("filters");
00661 DeleteFilters(filters.Length, ref filters[0]);
00662 }
00663
00666 public void DeleteFilters(int[] filters)
00667 {
00668 if (filters == null) throw new ArgumentNullException("filters");
00669 DeleteFilters(filters.Length, ref filters[0]);
00670 }
00671
00674 public void DeleteFilter(int filter)
00675 {
00676 DeleteFilters(1, ref filter);
00677 }
00678
00681 [CLSCompliant(false)]
00682 public void DeleteFilter(ref uint filter)
00683 {
00684 unsafe
00685 {
00686 fixed (uint* ptr = &filter)
00687 {
00688 Imported_alDeleteFilters(1, ptr);
00689 }
00690 }
00691 }
00692
00693 #endregion alDeleteFilters
00694
00695 #region alIsFilter
00696
00697
00698 private delegate bool Delegate_alIsFilter(uint fid);
00699
00700
00701
00702 private Delegate_alIsFilter Imported_alIsFilter;
00703
00707 [CLSCompliant(false)]
00708 public bool IsFilter(uint fid)
00709 {
00710 return Imported_alIsFilter(fid);
00711 }
00712
00716
00717 public bool IsFilter(int fid)
00718 {
00719 return Imported_alIsFilter((uint)fid);
00720 }
00721
00722 #endregion alIsFilter
00723
00724 #region alFilteri
00725
00726
00727 private delegate void Delegate_alFilteri(uint fid, EfxFilteri param, int value);
00728
00729
00730
00731 private Delegate_alFilteri Imported_alFilteri;
00732
00737 [CLSCompliant(false)]
00738 public void Filter(uint fid, EfxFilteri param, int value)
00739 {
00740 Imported_alFilteri(fid, param, value);
00741 }
00742
00747
00748 public void Filter(int fid, EfxFilteri param, int value)
00749 {
00750 Imported_alFilteri((uint)fid, param, value);
00751 }
00752
00753 #endregion alFilteri
00754
00755 #region alFilterf
00756
00757
00758 private delegate void Delegate_alFilterf(uint fid, EfxFilterf param, float value);
00759
00760
00761
00762 private Delegate_alFilterf Imported_alFilterf;
00763
00768 [CLSCompliant(false)]
00769 public void Filter(uint fid, EfxFilterf param, float value)
00770 {
00771 Imported_alFilterf(fid, param, value);
00772 }
00773
00778
00779 public void Filter(int fid, EfxFilterf param, float value)
00780 {
00781 Imported_alFilterf((uint)fid, param, value);
00782 }
00783
00784 #endregion alFilterf
00785
00786 #region alGetFilteri
00787
00788
00789 unsafe private delegate void Delegate_alGetFilteri(uint fid, EfxFilteri pname, [Out] int* value);
00790
00791
00792
00793 private Delegate_alGetFilteri Imported_alGetFilteri;
00794
00799 [CLSCompliant(false)]
00800 public void GetFilter(uint fid, EfxFilteri pname, out int value)
00801 {
00802 unsafe
00803 {
00804 fixed (int* ptr = &value)
00805 {
00806 Imported_alGetFilteri(fid, pname, ptr);
00807 }
00808 }
00809 }
00810
00815
00816 public void GetFilter(int fid, EfxFilteri pname, out int value)
00817 {
00818 GetFilter((uint)fid, pname, out value);
00819 }
00820
00821 #endregion alGetFilteri
00822
00823 #region alGetFilterf
00824
00825
00826 unsafe private delegate void Delegate_alGetFilterf(uint fid, EfxFilterf pname, [Out] float* value);
00827
00828
00829
00830 private Delegate_alGetFilterf Imported_alGetFilterf;
00831
00836 [CLSCompliant(false)]
00837 public void GetFilter(uint fid, EfxFilterf pname, out float value)
00838 {
00839 unsafe
00840 {
00841 fixed (float* ptr = &value)
00842 {
00843 Imported_alGetFilterf(fid, pname, ptr);
00844 }
00845 }
00846 }
00847
00852
00853 public void GetFilter(int fid, EfxFilterf pname, out float value)
00854 {
00855 GetFilter((uint)fid, pname, out value);
00856 }
00857
00858 #endregion alGetFilterf
00859
00860
00861
00862
00863
00864
00865
00866 #endregion Filter Object
00867
00868 #region Auxiliary Effect Slot Object
00869
00870 #region alGenAuxiliaryEffectSlots
00871
00872
00873 unsafe private delegate void Delegate_alGenAuxiliaryEffectSlots(int n, [Out] uint* slots);
00874
00875
00876
00877 private Delegate_alGenAuxiliaryEffectSlots Imported_alGenAuxiliaryEffectSlots;
00878
00883 [CLSCompliant(false)]
00884 public void GenAuxiliaryEffectSlots(int n, out uint slots)
00885 {
00886 unsafe
00887 {
00888 fixed (uint* ptr = &slots)
00889 {
00890 Imported_alGenAuxiliaryEffectSlots(n, ptr);
00891 slots = *ptr;
00892 }
00893 }
00894 }
00895
00900 public void GenAuxiliaryEffectSlots(int n, out int slots)
00901 {
00902 unsafe
00903 {
00904 fixed (int* ptr = &slots)
00905 {
00906 Imported_alGenAuxiliaryEffectSlots(n, (uint*)ptr);
00907 slots = *ptr;
00908 }
00909 }
00910 }
00911
00916 public int[] GenAuxiliaryEffectSlots(int n)
00917 {
00918 if (n <= 0) throw new ArgumentOutOfRangeException("n", "Must be higher than 0.");
00919 int[] slots = new int[n];
00920 GenAuxiliaryEffectSlots(slots.Length, out slots[0]);
00921 return slots;
00922 }
00923
00926 public int GenAuxiliaryEffectSlot()
00927 {
00928 int temp;
00929 GenAuxiliaryEffectSlots(1, out temp);
00930 return temp;
00931 }
00932
00935 [CLSCompliant(false)]
00936 public void GenAuxiliaryEffectSlot(out uint slot)
00937 {
00938 unsafe
00939 {
00940 fixed (uint* ptr = &slot)
00941 {
00942 Imported_alGenAuxiliaryEffectSlots(1, ptr);
00943 slot = *ptr;
00944 }
00945 }
00946 }
00947
00948 #endregion alGenAuxiliaryEffectSlots
00949
00950 #region DeleteAuxiliaryEffectSlots
00951
00952 unsafe private delegate void Delegate_alDeleteAuxiliaryEffectSlots(int n, [In] uint* slots);
00953
00954
00955 private Delegate_alDeleteAuxiliaryEffectSlots Imported_alDeleteAuxiliaryEffectSlots;
00956
00960 [CLSCompliant(false)]
00961 public void DeleteAuxiliaryEffectSlots(int n, ref uint slots)
00962 {
00963 unsafe
00964 {
00965 fixed (uint* ptr = &slots)
00966 {
00967 Imported_alDeleteAuxiliaryEffectSlots(n, ptr);
00968 }
00969 }
00970 }
00971
00975 public void DeleteAuxiliaryEffectSlots(int n, ref int slots)
00976 {
00977 unsafe
00978 {
00979 fixed (int* ptr = &slots)
00980 {
00981 Imported_alDeleteAuxiliaryEffectSlots(n, (uint*)ptr);
00982 }
00983 }
00984 }
00985
00988 public void DeleteAuxiliaryEffectSlots(int[] slots)
00989 {
00990 if (slots == null) throw new ArgumentNullException("slots");
00991 DeleteAuxiliaryEffectSlots(slots.Length, ref slots[0]);
00992 }
00993
00996 [CLSCompliant(false)]
00997 public void DeleteAuxiliaryEffectSlots(uint[] slots)
00998 {
00999 if (slots == null) throw new ArgumentNullException("slots");
01000 DeleteAuxiliaryEffectSlots(slots.Length, ref slots[0]);
01001 }
01002
01005 public void DeleteAuxiliaryEffectSlot(int slot)
01006 {
01007 DeleteAuxiliaryEffectSlots(1, ref slot);
01008 }
01009
01012 [CLSCompliant(false)]
01013 public void DeleteAuxiliaryEffectSlot(ref uint slot)
01014 {
01015 unsafe
01016 {
01017 fixed (uint* ptr = &slot)
01018 {
01019 Imported_alDeleteAuxiliaryEffectSlots(1, ptr);
01020 }
01021 }
01022 }
01023
01024 #endregion alDeleteAuxiliaryEffectSlots
01025
01026 #region alIsAuxiliaryEffectSlot
01027
01028
01029 private delegate bool Delegate_alIsAuxiliaryEffectSlot(uint slot);
01030
01031
01032
01033 private Delegate_alIsAuxiliaryEffectSlot Imported_alIsAuxiliaryEffectSlot;
01034
01038 [CLSCompliant(false)]
01039 public bool IsAuxiliaryEffectSlot(uint slot)
01040 {
01041 return Imported_alIsAuxiliaryEffectSlot(slot);
01042 }
01043
01047
01048 public bool IsAuxiliaryEffectSlot(int slot)
01049 {
01050 return Imported_alIsAuxiliaryEffectSlot((uint)slot);
01051 }
01052
01053 #endregion alIsAuxiliaryEffectSlot
01054
01055 #region alAuxiliaryEffectSloti
01056
01057
01058 private delegate void Delegate_alAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi param, int value);
01059
01060
01061
01062 private Delegate_alAuxiliaryEffectSloti Imported_alAuxiliaryEffectSloti;
01063
01068 [CLSCompliant(false)]
01069 public void AuxiliaryEffectSlot(uint asid, EfxAuxiliaryi param, int value)
01070 {
01071 Imported_alAuxiliaryEffectSloti(asid, param, value);
01072 }
01073
01078
01079 public void AuxiliaryEffectSlot(int asid, EfxAuxiliaryi param, int value)
01080 {
01081 Imported_alAuxiliaryEffectSloti((uint)asid, param, value);
01082 }
01083
01084 #endregion alAuxiliaryEffectSloti
01085
01086 #region alAuxiliaryEffectSlotf
01087
01088
01089 private delegate void Delegate_alAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf param, float value);
01090
01091
01092
01093 private Delegate_alAuxiliaryEffectSlotf Imported_alAuxiliaryEffectSlotf;
01094
01099 [CLSCompliant(false)]
01100 public void AuxiliaryEffectSlot(uint asid, EfxAuxiliaryf param, float value)
01101 {
01102 Imported_alAuxiliaryEffectSlotf(asid, param, value);
01103 }
01104
01109
01110 public void AuxiliaryEffectSlot(int asid, EfxAuxiliaryf param, float value)
01111 {
01112 Imported_alAuxiliaryEffectSlotf((uint)asid, param, value);
01113 }
01114
01115 #endregion alAuxiliaryEffectSlotf
01116
01117 #region alGetAuxiliaryEffectSloti
01118
01119
01120 unsafe private delegate void Delegate_alGetAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi pname, [Out] int* value);
01121
01122
01123
01124 private Delegate_alGetAuxiliaryEffectSloti Imported_alGetAuxiliaryEffectSloti;
01125
01130 [CLSCompliant(false)]
01131 public void GetAuxiliaryEffectSlot(uint asid, EfxAuxiliaryi pname, out int value)
01132 {
01133 unsafe
01134 {
01135 fixed (int* ptr = &value)
01136 {
01137 Imported_alGetAuxiliaryEffectSloti(asid, pname, ptr);
01138 }
01139 }
01140 }
01141
01146
01147 public void GetAuxiliaryEffectSlot(int asid, EfxAuxiliaryi pname, out int value)
01148 {
01149 GetAuxiliaryEffectSlot((uint)asid, pname, out value);
01150 }
01151
01152 #endregion alGetAuxiliaryEffectSloti
01153
01154 #region alGetAuxiliaryEffectSlotf
01155
01156
01157 unsafe private delegate void Delegate_alGetAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf pname, [Out] float* value);
01158
01159
01160
01161 private Delegate_alGetAuxiliaryEffectSlotf Imported_alGetAuxiliaryEffectSlotf;
01162
01167 [CLSCompliant(false)]
01168 public void GetAuxiliaryEffectSlot(uint asid, EfxAuxiliaryf pname, out float value)
01169 {
01170 unsafe
01171 {
01172 fixed (float* ptr = &value)
01173 {
01174 Imported_alGetAuxiliaryEffectSlotf(asid, pname, ptr);
01175 }
01176 }
01177 }
01178
01183
01184 public void GetAuxiliaryEffectSlot(int asid, EfxAuxiliaryf pname, out float value)
01185 {
01186 GetAuxiliaryEffectSlot((uint)asid, pname, out value);
01187 }
01188
01189 #endregion alGetAuxiliaryEffectSlotf
01190
01191
01192
01193
01194
01195
01196
01197 #endregion Auxiliary Effect Slot Object
01198
01199 #region Constructor / Extension Loading
01200
01201 private bool _valid;
01202
01204 public bool IsInitialized
01205 {
01206 get
01207 {
01208 return _valid;
01209 }
01210 }
01211
01215 public EffectsExtension()
01216 {
01217 _valid = false;
01218
01219 if (AudioContext.CurrentContext == null)
01220 throw new InvalidOperationException("AL.LoadAll() needs a current AudioContext.");
01221
01222 if (!AudioContext.CurrentContext.SupportsExtension("ALC_EXT_EFX"))
01223 {
01224 Debug.Print("EFX Extension (ALC_EXT_EFX) is not supported(AudioContext: {0}).", AudioContext.CurrentContext.ToString());
01225 return;
01226 }
01227
01228
01229 try
01230 {
01231 Imported_alGenEffects = (Delegate_alGenEffects)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenEffects"), typeof(Delegate_alGenEffects));
01232 Imported_alDeleteEffects = (Delegate_alDeleteEffects)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteEffects"), typeof(Delegate_alDeleteEffects));
01233 Imported_alIsEffect = (Delegate_alIsEffect)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsEffect"), typeof(Delegate_alIsEffect));
01234 Imported_alEffecti = (Delegate_alEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffecti"), typeof(Delegate_alEffecti));
01235 Imported_alEffectf = (Delegate_alEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffectf"), typeof(Delegate_alEffectf));
01236 Imported_alEffectfv = (Delegate_alEffectfv)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffectfv"), typeof(Delegate_alEffectfv));
01237 Imported_alGetEffecti = (Delegate_alGetEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffecti"), typeof(Delegate_alGetEffecti));
01238 Imported_alGetEffectf = (Delegate_alGetEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectf"), typeof(Delegate_alGetEffectf));
01239 Imported_alGetEffectfv = (Delegate_alGetEffectfv)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectfv"), typeof(Delegate_alGetEffectfv));
01240 }
01241 catch (Exception e)
01242 {
01243 Debug.WriteLine("Failed to marshal Effect functions. " + e.ToString());
01244 return;
01245 }
01246
01247
01248 try
01249 {
01250 Imported_alGenFilters = (Delegate_alGenFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenFilters"), typeof(Delegate_alGenFilters));
01251 Imported_alDeleteFilters = (Delegate_alDeleteFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteFilters"), typeof(Delegate_alDeleteFilters));
01252 Imported_alIsFilter = (Delegate_alIsFilter)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsFilter"), typeof(Delegate_alIsFilter));
01253 Imported_alFilteri = (Delegate_alFilteri)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilteri"), typeof(Delegate_alFilteri));
01254 Imported_alFilterf = (Delegate_alFilterf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilterf"), typeof(Delegate_alFilterf));
01255 Imported_alGetFilteri = (Delegate_alGetFilteri)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetFilteri"), typeof(Delegate_alGetFilteri));
01256 Imported_alGetFilterf = (Delegate_alGetFilterf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetFilterf"), typeof(Delegate_alGetFilterf));
01257 }
01258 catch (Exception e)
01259 {
01260 Debug.WriteLine("Failed to marshal Filter functions. " + e.ToString());
01261 return;
01262 }
01263
01264
01265 try
01266 {
01267 Imported_alGenAuxiliaryEffectSlots = (Delegate_alGenAuxiliaryEffectSlots)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenAuxiliaryEffectSlots"), typeof(Delegate_alGenAuxiliaryEffectSlots));
01268 Imported_alDeleteAuxiliaryEffectSlots = (Delegate_alDeleteAuxiliaryEffectSlots)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteAuxiliaryEffectSlots"), typeof(Delegate_alDeleteAuxiliaryEffectSlots));
01269 Imported_alIsAuxiliaryEffectSlot = (Delegate_alIsAuxiliaryEffectSlot)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsAuxiliaryEffectSlot"), typeof(Delegate_alIsAuxiliaryEffectSlot));
01270 Imported_alAuxiliaryEffectSloti = (Delegate_alAuxiliaryEffectSloti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alAuxiliaryEffectSloti"), typeof(Delegate_alAuxiliaryEffectSloti));
01271 Imported_alAuxiliaryEffectSlotf = (Delegate_alAuxiliaryEffectSlotf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alAuxiliaryEffectSlotf"), typeof(Delegate_alAuxiliaryEffectSlotf));
01272 Imported_alGetAuxiliaryEffectSloti = (Delegate_alGetAuxiliaryEffectSloti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetAuxiliaryEffectSloti"), typeof(Delegate_alGetAuxiliaryEffectSloti));
01273 Imported_alGetAuxiliaryEffectSlotf = (Delegate_alGetAuxiliaryEffectSlotf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetAuxiliaryEffectSlotf"), typeof(Delegate_alGetAuxiliaryEffectSlotf));
01274 }
01275 catch (Exception e)
01276 {
01277 Debug.WriteLine("Failed to marshal AuxiliaryEffectSlot functions. " + e.ToString());
01278 return;
01279 }
01280
01281
01282
01283 _valid = true;
01284 }
01285
01286 #endregion Constructor / Extension Loading
01287 }
01288 }