diff --git a/Library/DirectSound.cs b/Library/DirectSound.cs index 50f378c..a2da0c8 100644 --- a/Library/DirectSound.cs +++ b/Library/DirectSound.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Threading; @@ -56,7 +55,6 @@ public void Stop() _thread.Join(); } - [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Runtime.InteropServices.SafeHandle.DangerousGetHandle")] private void Initialize() { int hresult = NativeMethods.DirectSoundCreate(IntPtr.Zero, out _device, IntPtr.Zero); @@ -76,8 +74,7 @@ private void Initialize() BufferPositionNotify[] positionEvents = new BufferPositionNotify[BlockCount] { - new BufferPositionNotify(0 * _sampleSize, _position1Event.SafeWaitHandle.DangerousGetHandle()), - new BufferPositionNotify(1 * _sampleSize, _position2Event.SafeWaitHandle.DangerousGetHandle()) + new BufferPositionNotify(0 * _sampleSize, _position1Event), new BufferPositionNotify(1 * _sampleSize, _position2Event) }; ((IDirectSoundNotify)_buffer).SetNotificationPositions(positionEvents.Length, positionEvents); @@ -170,7 +167,6 @@ private void Run() // com mta thread public event EventHandler Update; private const int BlockCount = 2; - private const int WaveFormatPcm = 1; private int _sampleRate; private int _sampleChannels; diff --git a/Library/DirectSoundInterop.cs b/Library/DirectSoundInterop.cs index 8391208..a066c97 100644 --- a/Library/DirectSoundInterop.cs +++ b/Library/DirectSoundInterop.cs @@ -1,6 +1,8 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Security; +using System.Threading; namespace Jellyfish.Library { @@ -66,10 +68,11 @@ public BufferDescription(BufferCapabilities capabilities, int size, IntPtr forma [StructLayout(LayoutKind.Sequential)] private struct BufferPositionNotify { - public BufferPositionNotify(int offset, IntPtr notifyEvent) + [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Runtime.InteropServices.SafeHandle.DangerousGetHandle")] + public BufferPositionNotify(int offset, EventWaitHandle notifyEvent) { dwOffset = offset; - hEventNotify = notifyEvent; + hEventNotify = notifyEvent.SafeWaitHandle.DangerousGetHandle(); } public int dwOffset; @@ -146,5 +149,7 @@ private static class NativeMethods [DllImport("dsound.dll")] public static extern int DirectSoundCreate(IntPtr pcGuidDevice, [MarshalAs(UnmanagedType.Interface)] out IDirectSound pDS, IntPtr pUnkOuter); } + + private const int WaveFormatPcm = 1; } } diff --git a/Virtu/Silverlight/Properties/AssemblyInfo.cs b/Virtu/Silverlight/Properties/AssemblyInfo.cs index e05b267..980bc38 100644 --- a/Virtu/Silverlight/Properties/AssemblyInfo.cs +++ b/Virtu/Silverlight/Properties/AssemblyInfo.cs @@ -11,8 +11,8 @@ [assembly: AssemblyCopyright("Copyright © 1995-2009 Digital Jellyfish Design Ltd")] [assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] -[assembly: AssemblyVersion("0.6.0.0")] -[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: AssemblyVersion("0.7.0.0")] +[assembly: AssemblyFileVersion("0.7.0.0")] [assembly: CLSCompliant(false)] [assembly: ComVisible(false)] diff --git a/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj b/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj index 0ffcf84..c78aed4 100644 --- a/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj +++ b/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj @@ -29,6 +29,7 @@ true + x86 pdbonly @@ -40,6 +41,7 @@ true + x86 diff --git a/Virtu/Wpf/Properties/AssemblyInfo.cs b/Virtu/Wpf/Properties/AssemblyInfo.cs index 3e0772b..6ff3f60 100644 --- a/Virtu/Wpf/Properties/AssemblyInfo.cs +++ b/Virtu/Wpf/Properties/AssemblyInfo.cs @@ -12,8 +12,8 @@ [assembly: AssemblyCopyright("Copyright © 1995-2009 Digital Jellyfish Design Ltd")] [assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] -[assembly: AssemblyVersion("0.6.0.0")] -[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: AssemblyVersion("0.7.0.0")] +[assembly: AssemblyFileVersion("0.7.0.0")] [assembly: CLSCompliant(false)] [assembly: ComVisible(false)] diff --git a/Virtu/Xna/Properties/AssemblyInfo.cs b/Virtu/Xna/Properties/AssemblyInfo.cs index eeb52c2..8f1e9f0 100644 --- a/Virtu/Xna/Properties/AssemblyInfo.cs +++ b/Virtu/Xna/Properties/AssemblyInfo.cs @@ -15,9 +15,9 @@ [assembly: AssemblyCopyright("Copyright © 1995-2009 Digital Jellyfish Design Ltd")] [assembly: AssemblyComment("Developed by Sean Fausett & Nick Westgate")] -[assembly: AssemblyVersion("0.6.0.0")] +[assembly: AssemblyVersion("0.7.0.0")] #if WINDOWS -[assembly: AssemblyFileVersion("0.6.0.0")] +[assembly: AssemblyFileVersion("0.7.0.0")] #endif [assembly: CLSCompliant(false)]