Browse Source

NativeDirectSoundOut becomes the new DirectSoundOut

pull/1/head
markheath 17 years ago
parent
commit
edb26ed046
  1. 6
      NAudio/Changes.xml
  2. 2
      NAudio/NAudio.csproj
  3. 1
      NAudio/Wave/WaveOutputs/AsioOut.cs
  4. 16
      NAudio/Wave/WaveOutputs/DirectSoundOut.cs
  5. 2
      NAudioDemo/AudioPlaybackForm.cs

6
NAudio/Changes.xml

@ -915,4 +915,10 @@
<date>27 June 2008</date>
<desc>IWavePlayer using IWaveProvider and WaveBuffer (initial port)</desc>
</change>
<change>
<version>1.3.2.0</version>
<author>Mark Heath</author>
<date>28 June 2008</date>
<desc>NativeDirectSoundOut now becomes DirectSoundOut as Managed Direct X is retired</desc>
</change>
</changes>

2
NAudio/NAudio.csproj

@ -311,7 +311,7 @@
<Compile Include="Wave\WaveOutputs\IWaveBuffer.cs" />
<Compile Include="Wave\WaveOutputs\IWavePlayer.cs" />
<Compile Include="Wave\WaveOutputs\IWaveProvider.cs" />
<Compile Include="Wave\WaveOutputs\NativeDirectSoundOut.cs" />
<Compile Include="Wave\WaveOutputs\DirectSoundOut.cs" />
<Compile Include="Wave\WaveOutputs\PlaybackState.cs" />
<Compile Include="Wave\WaveOutputs\WasapiOut.cs" />
<Compile Include="Wave\WaveOutputs\WaveBuffer.cs" />

1
NAudio/Wave/WaveOutputs/AsioOut.cs

@ -224,6 +224,7 @@ namespace NAudio.Wave
get { return playbackState; }
}
/// <summary>
/// Sets the volume (1.0 is unity gain)
/// </summary>

16
NAudio/Wave/WaveOutputs/NativeDirectSoundOut.cs → NAudio/Wave/WaveOutputs/DirectSoundOut.cs

@ -7,12 +7,10 @@ namespace NAudio.Wave
{
/// <summary>
/// NativeDirectSoundOut using DirectSound COM interop.
/// WARNING, This class is working only if application is running in MTAThread mode.
/// TODO: Change code to support STAThread. Need some rework and transfer all COM code to a single thread.
/// TODO: Add better exception/error handling
/// Contact author: Alexandre Mutel - alexandre_mutel at yahoo.fr
/// </summary>
public class NativeDirectSoundOut : IWavePlayer
public class DirectSoundOut : IWavePlayer
{
private PlaybackState playbackState;
private WaveFormat waveFormat;
@ -31,28 +29,28 @@ namespace NAudio.Wave
private Thread notifyThread;
/// <summary>
/// Initializes a new instance of the <see cref="NativeDirectSoundOut"/> class.
/// Initializes a new instance of the <see cref="DirectSoundOut"/> class.
/// </summary>
public NativeDirectSoundOut()
public DirectSoundOut()
: this(40)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="NativeDirectSoundOut"/> class.
/// Initializes a new instance of the <see cref="DirectSoundOut"/> class.
/// (40ms seems to work under Vista).
/// </summary>
/// <param name="latency">The latency.</param>
public NativeDirectSoundOut(int latency)
public DirectSoundOut(int latency)
{
desiredLatency = latency;
}
/// <summary>
/// Releases unmanaged resources and performs other cleanup operations before the
/// <see cref="NativeDirectSoundOut"/> is reclaimed by garbage collection.
/// <see cref="DirectSoundOut"/> is reclaimed by garbage collection.
/// </summary>
~NativeDirectSoundOut()
~DirectSoundOut()
{
Dispose();
}

2
NAudioDemo/AudioPlaybackForm.cs

@ -129,7 +129,7 @@ namespace NAudioDemo
}
else if (radioButtonDirectSound.Checked)
{
waveOut = new NativeDirectSoundOut(latency);
waveOut = new DirectSoundOut(latency);
}
else if (radioButtonAsio.Checked)
{

Loading…
Cancel
Save