Skip to content

Commit

Permalink
[XAudio2] Remove XAudio2 2.9 Windows 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Jun 30, 2015
1 parent 7938653 commit de3a67c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Source/SharpDX.XAudio2/Fx/Reverb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public Reverb(XAudio2 device, bool isUsingDebug)
{
XAudio28Functions.CreateAudioReverb(this);
}
#if STORE_APP_10
else if (device.Version == XAudio2Version.Version29)
{
XAudio29Functions.CreateAudioReverb(this);
}
#endif
else
{
throw new InvalidOperationException("XAudio2 must be initialized before calling this constructor");
Expand Down
2 changes: 2 additions & 0 deletions Source/SharpDX.XAudio2/Fx/VolumeMeter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ public VolumeMeter(XAudio2 device, bool isUsingDebug)
{
XAudio28Functions.CreateAudioVolumeMeter(this);
}
#if STORE_APP_10
else if (device.Version == XAudio2Version.Version29)
{
XAudio29Functions.CreateAudioVolumeMeter(this);
}
#endif
else
{
throw new InvalidOperationException("XAudio2 must be initialized before calling this constructor");
Expand Down
3 changes: 2 additions & 1 deletion Source/SharpDX.XAudio2/X3DAudio/X3DAudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public X3DAudio(Speakers speakers, float speedOfSound, X3DAudioVersion requestVe
}
catch (DllNotFoundException) { }
break;

#if STORE_APP_10
case X3DAudioVersion.Version29:
try
{
Expand All @@ -119,6 +119,7 @@ public X3DAudio(Speakers speakers, float speedOfSound, X3DAudioVersion requestVe
}
catch (DllNotFoundException) { }
break;
#endif
}

if(version != X3DAudioVersion.Default)
Expand Down
2 changes: 2 additions & 0 deletions Source/SharpDX.XAudio2/X3DAudio/X3DAudio29.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#if STORE_APP_10
using System;
using System.Runtime.InteropServices;
using System.Security;
Expand Down Expand Up @@ -101,3 +102,4 @@ public static void X3DAudioInitialize(SharpDX.Multimedia.Speakers speakerChannel
private unsafe static extern int X3DAudioInitialize_(int arg0,float arg1,void* arg2);
}
}
#endif
3 changes: 2 additions & 1 deletion Source/SharpDX.XAudio2/XAPO/Fx/XAPOFx.Interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SharpDX.XAPO.Fx
/// </summary>
/// <include file='..\..\Documentation\CodeComments.xml' path="/comments/comment[@id='SharpDX.XAPO.Fx.XAPOFx']/*"/>
static partial class XAPOFx {
#if STORE_APP_10
/// <summary>
/// <p>Creates an instance of the requested XAPOFX effect.</p>
/// </summary>
Expand Down Expand Up @@ -37,6 +37,7 @@ public static void CreateFX29(System.Guid clsid, SharpDX.ComObject effectRef, Sy
}
[DllImport("xaudio2_9.dll", EntryPoint = "CreateFX", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int CreateFX_29(void* arg0,void* arg1,void* arg2,int arg3);
#endif

public static void CreateFX28(System.Guid clsid, SharpDX.ComObject effectRef, System.IntPtr initDataRef, int initDataByteSize)
{
Expand Down
2 changes: 2 additions & 0 deletions Source/SharpDX.XAudio2/XAPO/Fx/XAPOFx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ public static void CreateFX(SharpDX.XAudio2.XAudio2 device, System.Guid clsid, S
{
CreateFX28(clsid, effectRef, IntPtr.Zero, 0);
}
#if STORE_APP_10
else if (device.Version == XAudio2Version.Version29)
{
CreateFX29(clsid, effectRef, IntPtr.Zero, 0);
}
#endif
else
{
throw new NotSupportedException(string.Format("XAudio2 Version [{0}] is not supported for this effect", device.Version));
Expand Down
3 changes: 2 additions & 1 deletion Source/SharpDX.XAudio2/XAudio2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public XAudio2(XAudio2Flags flags, ProcessorSpecifier processorSpecifier, XAudio
}
catch (DllNotFoundException) { }
break;

#if STORE_APP_10
case XAudio2Version.Version29:
try
{
Expand All @@ -114,6 +114,7 @@ public XAudio2(XAudio2Flags flags, ProcessorSpecifier processorSpecifier, XAudio
}
catch (DllNotFoundException) { }
break;
#endif
}

// Early exit if we found a requestedVersion
Expand Down
4 changes: 3 additions & 1 deletion Source/SharpDX.XAudio2/XAudio29Functions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if STORE_APP_10
using System;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -114,4 +115,5 @@ public static void CreateAudioVolumeMeter(SharpDX.ComObject apoOut) {
[DllImport("xaudio2_9.dll", EntryPoint = "CreateAudioVolumeMeter", CallingConvention = CallingConvention.StdCall)]
private unsafe static extern int CreateAudioVolumeMeter_(void* arg0);
}
}
}
#endif

0 comments on commit de3a67c

Please sign in to comment.